builddeb: add --distid option to specify Distributor ID
This allows builddeb to handle distributions that are not Debian.
Distributor ID is reported by lsb_release --id, and in case of builddeb it's
usually Debian or Ubuntu.
--- a/Makefile Wed Nov 25 14:59:43 2015 +0800
+++ b/Makefile Wed Nov 25 15:15:03 2015 +0800
@@ -162,11 +162,11 @@
deb:
mkdir -p packages/debian-unknown
- contrib/builddeb --codename unknown
+ contrib/builddeb --distid debian --codename unknown
docker-debian-jessie:
mkdir -p packages/debian-jessie
- contrib/dockerdeb jessie
+ contrib/dockerdeb debian jessie
fedora20:
mkdir -p packages/fedora20
--- a/contrib/builddeb Wed Nov 25 14:59:43 2015 +0800
+++ b/contrib/builddeb Wed Nov 25 15:15:03 2015 +0800
@@ -8,9 +8,15 @@
BUILD=1
CLEANUP=1
+DISTID=debian
CODENAME=jessie
while [ "$1" ]; do
case "$1" in
+ --distid )
+ shift
+ DISTID="$1"
+ shift
+ ;;
--codename )
shift
CODENAME="$1"
@@ -82,7 +88,7 @@
fi
if [ "$CLEANUP" ] ; then
echo
- OUTPUTDIR=${OUTPUTDIR:=packages/debian-$CODENAME}
+ OUTPUTDIR=${OUTPUTDIR:=packages/$DISTID-$CODENAME}
find ../mercurial*.deb ../mercurial_*.build ../mercurial_*.changes \
-type f -newer $control -print0 | \
xargs -Inarf -0 mv narf "$OUTPUTDIR"
--- a/contrib/dockerdeb Wed Nov 25 14:59:43 2015 +0800
+++ b/contrib/dockerdeb Wed Nov 25 15:15:03 2015 +0800
@@ -8,8 +8,9 @@
checkdocker
-CODENAME="$1"
-PLATFORM="debian-$1"
+DISTID="$1"
+CODENAME="$2"
+PLATFORM="$1-$2"
shift # extra params are passed to build process
OUTPUTDIR=${OUTPUTDIR:=$ROOTDIR/packages/$PLATFORM}
@@ -26,8 +27,8 @@
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 --codename $CODENAME"
-contrib/builddeb --cleanup --codename $CODENAME
+ 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"