[pbuilder] 01/04: pbuilder-modules: Add should_clean_source function

James Clarke jrtc27 at moszumanska.debian.org
Thu Jan 19 15:32:48 UTC 2017


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

jrtc27 pushed a commit to branch wip/changes-option
in repository pbuilder.

commit 15a83f7c14a871003e5fef2c60e287a6fa9b327b
Author: James Clarke <jrtc27 at debian.org>
Date:   Thu Jan 19 15:07:47 2017 +0000

    pbuilder-modules: Add should_clean_source function
---
 pbuilder-modules | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/pbuilder-modules b/pbuilder-modules
index 461616d..e1c571c 100644
--- a/pbuilder-modules
+++ b/pbuilder-modules
@@ -944,6 +944,26 @@ function get_changes_options() {
     echo "${changes_options:-}"
 }
 
+function should_clean_source() {
+    local noclean=0
+    for arg in $DEBBUILDOPTS; do
+        # De-escape arg; is this really the easiest way?!
+        # $(echo $arg) on its own doesn't perform quote expansion, since quote
+        # expansion operates on the *original* word.
+        arg=$(bash -c "printf -- '%s' $arg")
+        case $arg in
+            --pre-clean)
+                noclean=0
+                ;;
+            -nc|--no-pre-clean)
+                noclean=1
+                ;;
+        esac
+    done
+    # Exit code, not boolean, so inverted meaning
+    return $noclean
+}
+
 #==========================================================================
 # hooks stuff
 

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



More information about the Pbuilder-maint mailing list