Patchwork [3,of,9,debian-packaging] builddeb: rework how output dir and platform are specified

login
register
mail settings
Submitter Augie Fackler
Date Aug. 26, 2015, 7:08 p.m.
Message ID <c6e7e0fcb0a1a2490078.1440616124@arthedain.pit.corp.google.com>
Download mbox | patch
Permalink /patch/10286/
State Superseded
Commit 05306b9359d3ab39fa5031fa814f188d03ff1c59
Headers show

Comments

Augie Fackler - Aug. 26, 2015, 7:08 p.m.
# HG changeset patch
# User Augie Fackler <augie@google.com>
# Date 1440475364 14400
#      Tue Aug 25 00:02:44 2015 -0400
# Node ID c6e7e0fcb0a1a24900787d70d6e2b2fda844c087
# Parent  b3df36bd5f355272a213c7cefd69bcaff604037c
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.

Patch

diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -159,9 +159,7 @@  osx:
 
 debian-jessie:
 	mkdir -p packages/debian-jessie
-	contrib/builddeb
-	mv debbuild/*.deb packages/debian-jessie
-	rm -rf debbuild
+	contrib/builddeb --release jessie
 
 docker-debian-jessie:
 	mkdir -p packages/debian-jessie
diff --git a/contrib/builddeb b/contrib/builddeb
--- a/contrib/builddeb
+++ b/contrib/builddeb
@@ -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 @@  while [ "$1" ]; do
     esac
 done
 
+DEBBUILDDIR=${OUTPUTDIR:="$PWD/debbuild"}
+
 set -u
 
 rm -rf $DEBBUILDDIR
diff --git a/contrib/dockerdeb b/contrib/dockerdeb
--- a/contrib/dockerdeb
+++ b/contrib/dockerdeb
@@ -8,13 +8,14 @@  export ROOTDIR=$(cd $BUILDDIR/..; pwd)
 
 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