view contrib/packaging/dockerrpm @ 39690:e0c5017124b3

localrepo: load extensions in makelocalrepository() Behavior does change subtly. First, we now load the hgrc before optionally setting up the vfs ward. That's fine: the vfs ward is for debugging and we know we won't hit it when reading .hg/hgrc. If the loaded extension were performing repo/vfs I/O, then we'd be worried. But extensions don't have access to the repo object that loaded them when they are loaded. Unless they are doing stack walking as part of module loading (which would be crazy), they shouldn't have access to the repo that incurred their load. Second, we now load extensions outside of the try..except IOError block. Previously, if loading an extension raised IOError, it would be silently ignored. I'm pretty sure the IOError is there for missing .hgrc files and should never have been ignored for issues loading extensions. I don't think this matters in reality because extension loading traps I/O errors. Differential Revision: https://phab.mercurial-scm.org/D4566
author Gregory Szorc <gregory.szorc@gmail.com>
date Wed, 12 Sep 2018 11:44:57 -0700
parents e5916f1236f3
children 4c0d4bbdc395
line wrap: on
line source

#!/bin/bash -e

BUILDDIR=$(dirname $0)
export ROOTDIR=$(cd $BUILDDIR/../..; pwd)

PLATFORM="$1"
shift # extra params are passed to buildrpm

DOCKER=$($BUILDDIR/hg-docker docker-path)

CONTAINER=hg-docker-$PLATFORM

$BUILDDIR/hg-docker build $BUILDDIR/docker/$PLATFORM $CONTAINER

RPMBUILDDIR=$ROOTDIR/packages/$PLATFORM
$ROOTDIR/contrib/packaging/buildrpm --rpmbuilddir $RPMBUILDDIR --prepare $*

DSHARED=/mnt/shared
DBUILDUSER=build

$DOCKER run -e http_proxy -e https_proxy -u $DBUILDUSER --rm -v $RPMBUILDDIR:$DSHARED $CONTAINER \
    rpmbuild --define "_topdir $DSHARED" -ba $DSHARED/SPECS/mercurial.spec --clean

$DOCKER run -e http_proxy -e https_proxy -u $DBUILDUSER --rm -v $RPMBUILDDIR:$DSHARED $CONTAINER \
    createrepo $DSHARED

cat << EOF > $RPMBUILDDIR/mercurial.repo
# Place this file in /etc/yum.repos.d/mercurial.repo
[mercurial]
name=Mercurial packages for $PLATFORM
# baseurl=file://$RPMBUILDDIR/
baseurl=http://hg.example.com/build/$PLATFORM/
skip_if_unavailable=True
gpgcheck=0
enabled=1
EOF

echo
echo "Build complete - results can be found in $RPMBUILDDIR"