builddeb: rework how output dir and platform are specified
authorAugie Fackler <augie@google.com>
Tue, 25 Aug 2015 00:02:44 -0400
changeset 26108 05306b9359d3
parent 26107 50582df9d7a7
child 26109 bad09bd22b6a
builddeb: rework how output dir and platform are specified This makes it possible to write tests for both builddeb and dockerdeb that actually build .debs and then sanity check the contents.
Makefile
contrib/builddeb
contrib/dockerdeb
--- a/Makefile	Wed Aug 26 10:20:07 2015 -0400
+++ b/Makefile	Tue Aug 25 00:02:44 2015 -0400
@@ -159,9 +159,7 @@
 
 deb:
 	mkdir -p packages/debian-unknown
-	contrib/builddeb
-	mv debbuild/*.deb packages/debian-unknown
-	rm -rf debbuild
+	contrib/builddeb --release unknown
 
 docker-debian-jessie:
 	mkdir -p packages/debian-jessie
--- a/contrib/builddeb	Wed Aug 26 10:20:07 2015 -0400
+++ b/contrib/builddeb	Tue Aug 25 00:02:44 2015 -0400
@@ -7,9 +7,14 @@
 . $(dirname $0)/packagelib.sh
 
 BUILD=1
-DEBBUILDDIR="$PWD/debbuild"
+DEBVERSION=jessie
 while [ "$1" ]; do
     case "$1" in
+    --release )
+        shift
+        DEBVERSION="$1"
+        shift
+        ;;
     --prepare )
         shift
         BUILD=
@@ -26,6 +31,8 @@
     esac
 done
 
+DEBBUILDDIR=${OUTPUTDIR:="$PWD/debbuild"}
+
 set -u
 
 rm -rf $DEBBUILDDIR
--- a/contrib/dockerdeb	Wed Aug 26 10:20:07 2015 -0400
+++ b/contrib/dockerdeb	Tue Aug 25 00:02:44 2015 -0400
@@ -8,13 +8,14 @@
 
 checkdocker
 
+DEBPLATFORM="$1"
 PLATFORM="debian-$1"
 shift # extra params are passed to build process
 
 initcontainer $PLATFORM
 
-DEBBUILDDIR=$ROOTDIR/packages/$PLATFORM
-contrib/builddeb --debbuilddir $DEBBUILDDIR/staged --prepare
+DEBBUILDDIR=${OUTPUTDIR:=$ROOTDIR/packages/$PLATFORM}
+OUTPUTDIR=$DEBBUILDDIR/staged contrib/builddeb --release $DEBPLATFORM --prepare
 
 DSHARED=/mnt/shared/
 if [ $(uname) = "Darwin" ] ; then