From 8ebc5b314a039ea5dee9f26ad8ef3a1edaf75311 Mon Sep 17 00:00:00 2001 From: Andreas Jaeger Date: Wed, 10 Aug 2016 19:03:31 +0200 Subject: [PATCH] cache-bindep: Handle bindep.txt Enhance cache-bindep so that it handles both bindep.txt and other-requirements.txt. Change-Id: Ifabb94e0cf50f89e876b8011293286f2b8ffb40e --- .../cache-bindep/install.d/50-cache-pkgs | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/nodepool/elements/cache-bindep/install.d/50-cache-pkgs b/nodepool/elements/cache-bindep/install.d/50-cache-pkgs index b31a867a91..1869774e09 100755 --- a/nodepool/elements/cache-bindep/install.d/50-cache-pkgs +++ b/nodepool/elements/cache-bindep/install.d/50-cache-pkgs @@ -26,19 +26,22 @@ FALLBACKREPO=/opt/git/openstack-infra/project-config FALLBACKFILE=jenkins/data/bindep-fallback.txt PACKAGES=`git --git-dir=$FALLBACKREPO/.git show master:$FALLBACKFILE` -# NOTE(pabelanger): We currently don't gate on other-requirements.txt +# NOTE(pabelanger): We currently don't gate on bindep.txt/other-requirements.txt # for centos and fedora nodes. As such, we have no way to ensure this will # not break DIB process. So we only run this for ubuntu-trusty. +# bindep.txt is new filename, other-requirements.txt is the old one. We should +# handle both for now. if [ -f /usr/bin/apt-get ] ; then - REQSFILE=other-requirements.txt for REPO in /opt/git/*/* ; do 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` - if [ -n "$REQS" ] ; then - PACKAGES=`echo -e "$PACKAGES\n$REQS" | sort -u` - fi + for reqsfile in bindep.txt other-requirements.txt ; do + REQS=`git --git-dir=$REPO/.git show $BRANCH:$reqsfile 2>/dev/null \ + || true` + if [ -n "$REQS" ] ; then + PACKAGES=`echo -e "$PACKAGES\n$REQS" | sort -u` + fi + done done done fi