When building/testing debian packages, run-build-packages-one-target.sh
authorWard Vandewege <ward@jhvc.com>
Thu, 21 May 2020 15:22:08 +0000 (11:22 -0400)
committerWard Vandewege <ward@jhvc.com>
Thu, 21 May 2020 15:22:08 +0000 (11:22 -0400)
now tests for the presence of dpkg-scanpackages and apt-ftparchive and
aborts if they are not present.

No issue #

Arvados-DCO-1.1-Signed-off-by: Ward Vandewege <ward@jhvc.com>

build/run-build-packages-one-target.sh

index f476a9691cfb70b8b21ca3fd6a2ae2dd2e051dc7..1a845d200a38c53aeaf3f353e279cf7289a01179 100755 (executable)
@@ -143,6 +143,22 @@ if [[ -n "$test_packages" ]]; then
   fi
 
   if [[ -n "$(find $WORKSPACE/packages/$TARGET -name '*.deb')" ]] ; then
+    set +e
+    /usr/bin/which dpkg-scanpackages >/dev/null
+    if [[ "$?" != "0" ]]; then
+      echo >&2
+      echo >&2 "Error: please install dpkg-dev. E.g. sudo apt-get install dpkg-dev"
+      echo >&2
+      exit 1
+    fi
+    /usr/bin/which apt-ftparchive >/dev/null
+    if [[ "$?" != "0" ]]; then
+      echo >&2
+      echo >&2 "Error: please install apt-utils. E.g. sudo apt-get install apt-utils"
+      echo >&2
+      exit 1
+    fi
+    set -e
     (cd $WORKSPACE/packages/$TARGET
       dpkg-scanpackages .  2> >(grep -v 'warning' 1>&2) | tee Packages | gzip -c > Packages.gz
       apt-ftparchive -o APT::FTPArchive::Release::Origin=Arvados release . > Release