[devscripts] 01/01: debrepro: check for dependencies before doing any builds

Antonio Terceiro terceiro at moszumanska.debian.org
Mon May 15 20:58:36 UTC 2017


This is an automated email from the git hooks/post-receive script.

terceiro pushed a commit to branch master
in repository devscripts.

commit ad90af3a73b89f96a8135ce5f07f358245757802
Author: Antonio Terceiro <terceiro at debian.org>
Date:   Mon May 15 17:58:06 2017 -0300

    debrepro:  check for dependencies before doing any builds
    
    Closes: #862586
---
 debian/changelog     |  4 ++++
 scripts/debrepro.pod |  4 ++++
 scripts/debrepro.sh  | 21 +++++++++++++++++++++
 3 files changed, 29 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 4015df8..d12c50f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -18,6 +18,10 @@ devscripts (2.17.6) UNRELEASED; urgency=medium
     bts chdist debcommit dscverify grep-excuses
     namecheck rc-alert svnpath wnpp-alert
 
+  [ Antonio Terceiro ]
+  * debrepro:
+    + check for dependencies before doing any builds (Closes: #862586)
+
  -- Osamu Aoki <osamu at debian.org>  Fri, 31 Mar 2017 02:03:30 +0900
 
 devscripts (2.17.5) unstable; urgency=medium
diff --git a/scripts/debrepro.pod b/scripts/debrepro.pod
index 398757a..80fa2a0 100644
--- a/scripts/debrepro.pod
+++ b/scripts/debrepro.pod
@@ -120,6 +120,10 @@ Package is not reproducible.
 
 The given input is not a valid Debian source package.
 
+=item 3Z<>
+
+Required programs are missing.
+
 =back
 
 =head1 SEE ALSO
diff --git a/scripts/debrepro.sh b/scripts/debrepro.sh
index 80757b9..298d25a 100755
--- a/scripts/debrepro.sh
+++ b/scripts/debrepro.sh
@@ -19,6 +19,25 @@
 
 set -eu
 
+check_dependencies() {
+    for optional in disorderfs diffoscope; do
+        if ! which "$optional" > /dev/null; then
+            echo "W: $optional not installed, there will be missing functionality" >&2
+        fi
+    done
+
+    local failed=''
+    for mandatory in faketime; do
+        if ! which "$mandatory" > /dev/null; then
+            echo "E: $mandatory not installed, cannot proceed." >&2
+            failed=yes
+        fi
+    done
+    if [ -n "$failed" ]; then
+        exit 3
+    fi
+}
+
 usage() {
     echo "usage: $0 [OPTIONS] [SOURCEDIR]"
     echo ""
@@ -190,6 +209,8 @@ fi
 tmpdir=$(mktemp --directory --tmpdir debrepro.XXXXXXXXXX)
 trap "echo; echo 'I: artifacts left in $tmpdir'" INT TERM EXIT
 
+check_dependencies
+
 banner "First build"
 build first
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/collab-maint/devscripts.git



More information about the devscripts-devel mailing list