contrib/dockerdeb
author Hollis Blanchard <hollis_blanchard@mentor.com>
Thu, 18 Jan 2018 13:33:21 -0800
changeset 35742 7a1806e0daea
parent 29007 78074575df2e
permissions -rwxr-xr-x
sparse: --include 'dir1/dir2' should not include 'dir1/*' In 2015 there was a workaround added (f39bace2d6cad32907c0d7961b3c0dbd64a1b7ad) to sparse in the hg-experimental repo. That workaround: a) no longer seems to be needed, since its testcase passes even with the code removed, and b) caused a new problem: --include 'dir1/dir2' ended up including dir1/* too. (--include 'glob:dir1/dir2' is a user-level workaround.) Remove the offending code, and add a testcase for situation B.

#!/bin/bash -eu

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

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

checkdocker

DISTID="$1"
CODENAME="$2"
PLATFORM="$1-$2"
shift; shift # extra params are passed to build process

OUTPUTDIR=${OUTPUTDIR:=$ROOTDIR/packages/$PLATFORM}

initcontainer $PLATFORM

# debuild only appears to be able to save built debs etc to .., so we
# have to share the .. of the current directory with the docker
# container and hope it's writable. Whee.
dn=$(basename $PWD)

if [ $(uname) = "Darwin" ] ; then
    $DOCKER run -u $DBUILDUSER --rm -v $PWD/..:/mnt $CONTAINER \
            sh -c "cd /mnt/$dn && make clean && make local"
fi
$DOCKER run -u $DBUILDUSER --rm -v $PWD/..:/mnt $CONTAINER \
  sh -c "cd /mnt/$dn && DEB_BUILD_OPTIONS='${DEB_BUILD_OPTIONS:=}' contrib/builddeb --build --distid $DISTID --codename $CODENAME $@"
contrib/builddeb --cleanup --distid $DISTID --codename $CODENAME
if [ $(uname) = "Darwin" ] ; then
    $DOCKER run -u $DBUILDUSER --rm -v $PWD/..:/mnt $CONTAINER \
            sh -c "cd /mnt/$dn && make clean"
fi