cache-bindep: Handle bindep.txt

Enhance cache-bindep so that it handles both bindep.txt and
other-requirements.txt.

Change-Id: Ifabb94e0cf50f89e876b8011293286f2b8ffb40e
This commit is contained in:
Andreas Jaeger 2016-08-10 19:03:31 +02:00
parent 5dd67b9559
commit 8ebc5b314a

View File

@ -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