From: Matthijs Kooijman Date: Wed, 29 Jul 2009 09:18:07 +0000 (+0200) Subject: apt-repository: Only call equivs with an actual equivs file. X-Git-Url: https://git.stderr.nl/gitweb?p=apt-repository.git;a=commitdiff_plain;h=b04eb9d625d594481f2940a4e4c97bf6b4667430 apt-repository: Only call equivs with an actual equivs file. This adds checks for directories, non-regular files, non-readable files and files that do not look like equivs files. --- diff --git a/rebuild b/rebuild index 326175a..95f7699 100755 --- a/rebuild +++ b/rebuild @@ -7,15 +7,34 @@ mkdir -p $PACKAGES cd $PACKAGES for i in ../../$SOURCES/*; do + BASE=`basename "$i"` + if [ -d "$i" ]; then + echo "Skipping directory '$BASE'" + continue; + fi + if [ ! -f "$i" ]; then + echo "Skipping special file file '$BASE'" + continue; + fi + if [ ! -r "$i" ]; then + echo "Skipping non-readable file '$BASE'" + continue; + fi + VERSION=`cat $i | grep "^Version:" | sed "s/^Version: //"` PACKAGE=`cat $i | grep "^Package:" | sed "s/^Package: //"` - - if [ ! -f "${PACKAGE}_${VERSION}_all.deb" ]; then - echo "Building version $VERSION of $PACKAGE" - equivs-build $i - else + + if [ -z "${PACKAGE}" -o -z "${VERSION}" ]; then + echo "Skipping non-equivs file '$BASE'" + continue; + fi + if [ -f "${PACKAGE}_${VERSION}_all.deb" ]; then echo "Skipping $PACKAGE, version $VERSION already built" + continue; fi + + echo "Building version $VERSION of $PACKAGE" + equivs-build $i done cd ../..