Patchwork [14,of,22] dockerrpm: better handling of specification of docker name

login
register
mail settings
Submitter Mads Kiilerich
Date May 20, 2014, 2:10 a.m.
Message ID <74bca1400cea133b9408.1400551809@mk-desktop>
Download mbox | patch
Permalink /patch/4835/
State Superseded
Commit d2a00ced3cce2bb4c3736b6ca033b9c0367077f1
Headers show

Comments

Mads Kiilerich - May 20, 2014, 2:10 a.m.
# HG changeset patch
# User Mads Kiilerich <madski@unity3d.com>
# Date 1400551681 -7200
#      Tue May 20 04:08:01 2014 +0200
# Node ID 74bca1400cea133b94089cb4297c12a6e7bd817e
# Parent  2eb36c36ff30a18b6a7ecc76b0592699bd46635f
dockerrpm: better handling of specification of docker name

Patch

diff --git a/contrib/dockerrpm b/contrib/dockerrpm
--- a/contrib/dockerrpm
+++ b/contrib/dockerrpm
@@ -14,6 +14,13 @@  fi
 $DOCKER version | grep -q "^Client version:" || { echo "Error: unexpected output from \"$DOCKER version\""; exit 1; }
 $DOCKER version | grep -q "^Server version:" || { echo "Error: docker server not found - check it is running and your permissions"; exit 1; }
 
-$DOCKER build --tag "hg-dockerrpm-$1" - < $BUILDDIR/docker/$1
-$DOCKER run --rm -v $ROOTDIR:/hg "hg-dockerrpm-$1" bash -c \
+[ "$1" ] || { echo "Error: platform name must be specified"; exit 1; }
+
+DFILE="$ROOTDIR/contrib/docker/$1"
+[ -f "$DFILE" ] || { echo "Error: docker file $DFILE not found"; exit 1; }
+
+CONTAINER="hg-rpm-$1"
+
+$DOCKER build --tag $CONTAINER - < $BUILDDIR/docker/$1
+$DOCKER run --rm -v $ROOTDIR:/hg $CONTAINER bash -c \
     "cp -a hg hg-build; cd hg-build; make clean local $1; cp build/$1/* /hg/build/$1/"