contrib/dockerdeb
author Yuya Nishihara <yuya@tcha.org>
Sun, 24 May 2015 14:49:41 +0900
changeset 25341 9d6cc87bd507
parent 24973 4c4d0012db4f
child 26108 05306b9359d3
permissions -rwxr-xr-x
revset: make internal _list() expression remove duplicated revisions This allows us to optimize chained 'or' operations to _list() expression. Unlike _intlist() or _hexlist(), it's difficult to remove duplicates by the caller of _list() because different symbols can point to the same revision. If the caller knows all symbols are unique, that probably means revisions or nodes are known, therefore, _intlist() or _hexlist() should be used instead. So, it makes sense to check duplicates by _list() function. '%ls' is no longer used in core, this won't cause performance regression.

#!/bin/bash -eu

. $(dirname $0)/dockerlib.sh
. $(dirname $0)/packagelib.sh

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

checkdocker

PLATFORM="debian-$1"
shift # extra params are passed to build process

initcontainer $PLATFORM

DEBBUILDDIR=$ROOTDIR/packages/$PLATFORM
contrib/builddeb --debbuilddir $DEBBUILDDIR/staged --prepare

DSHARED=/mnt/shared/
if [ $(uname) = "Darwin" ] ; then
    $DOCKER run -u $DBUILDUSER --rm -v $DEBBUILDDIR:$DSHARED -v $PWD:/mnt/hg $CONTAINER \
            sh -c "cd /mnt/hg && make clean && make local"
fi
$DOCKER run -u $DBUILDUSER --rm -v $DEBBUILDDIR:$DSHARED -v $PWD:/mnt/hg $CONTAINER \
  sh -c "cd /mnt/hg && make PREFIX=$DSHARED/staged/usr install"
$DOCKER run -u $DBUILDUSER --rm -v $DEBBUILDDIR:$DSHARED $CONTAINER \
  dpkg-deb --build $DSHARED/staged
if [ $(uname) = "Darwin" ] ; then
    $DOCKER run -u $DBUILDUSER --rm -v $DEBBUILDDIR:$DSHARED -v $PWD:/mnt/hg $CONTAINER \
            sh -c "cd /mnt/hg && make clean"
fi

gethgversion

rm -r $DEBBUILDDIR/staged
mv $DEBBUILDDIR/staged.deb $DEBBUILDDIR/mercurial-$version-$release.deb

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