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

Mattia Rizzolo mattia at debian.org
Fri Jan 20 23:46:53 UTC 2017


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

mattia pushed a commit to branch master
in repository pbuilder.

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

    pbuilder-modules: Add should_clean_source function
    
    Signed-off-by: Mattia Rizzolo <mattia at debian.org>
---
 pbuilder-modules | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/pbuilder-modules b/pbuilder-modules
index 827649f..012d378 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
+    local arg
+    for arg in $DEBBUILDOPTS; do
+        # De-escape arg. $(echo $arg) on its own doesn't perform quote
+        # expansion, since quote expansion operates on the *original* word.
+        eval arg="$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