From ff8a9f590ec0f0c9c087984abdc35eca7891662a Mon Sep 17 00:00:00 2001 From: Jeremy Stanley Date: Fri, 3 Jul 2015 01:08:02 +0000 Subject: [PATCH] Clean up bindep invocation in cache-bindep element Invoke bindep from the bindir for its virtualenv in /usr/bindep-env, and guard its exit code with true since its normal behavior is to return zero only when all needed packages are already present. While here, replace calls to tempfile with mktemp since the former is not readily available on CentOS 6.x. Change-Id: I926e73f305b1b54f6855cc4acf3407e91b88213a --- nodepool/elements/cache-bindep/install.d/50-cache-pkgs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/nodepool/elements/cache-bindep/install.d/50-cache-pkgs b/nodepool/elements/cache-bindep/install.d/50-cache-pkgs index 8d1a158b6a..c768383d2a 100755 --- a/nodepool/elements/cache-bindep/install.d/50-cache-pkgs +++ b/nodepool/elements/cache-bindep/install.d/50-cache-pkgs @@ -21,10 +21,10 @@ FALLBACKFILE=jenkins/data/bindep-fallback.txt PACKAGES=`git --git-dir=$FALLBACKREPO/.git show master:$FALLBACKFILE` REQSFILE=other-requirements.txt for REPO in /opt/git/*/* ; do - BRANCHES=`git --git-dir=$REPO/.git branch -r|grep '^ origin/[^H]'` + BRANCHES=`git --git-dir=$REPO/.git branch -r | grep '^ origin/[^H]'` for BRANCH in $BRANCHES ; do REQS=`git --git-dir=$REPO/.git show $BRANCH:$REQSFILE 2>/dev/null \ - ||true` + || true` if [ -n "$REQS" ] ; then PACKAGES=`echo -e "$PACKAGES\n$REQS" | sort -u` fi @@ -32,10 +32,10 @@ for REPO in /opt/git/*/* ; do done # TODO(fungi) once https://review.openstack.org/195201 appears in a bindep # release, replace the next four lines with: -# PACKAGELIST=`echo "$PACKAGES" | bindep -b -f -` -PACKAGESFILE=`tempfile` +# PACKAGELIST=`echo "$PACKAGES" | /usr/bindep-env/bin/bindep -b -f - || true` +PACKAGESFILE=`mktemp` echo "$PACKAGES" > $PACKAGESFILE -PACKAGELIST=`bindep -b -f $PACKAGESFILE` +PACKAGELIST=`/usr/bindep-env/bin/bindep -b -f $PACKAGESFILE || true` rm $PACKAGESFILE if grep "^CentOS release 6" /etc/redhat-release ; then