[pbuilder] 01/03: pbuilder-modules: Add new get_changes_options function

James Clarke jrtc27 at moszumanska.debian.org
Thu Jan 19 01:40:16 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 98c6a5d82489859c0a3ae2b1a0360bf5261e4a27
Author: James Clarke <jrtc27 at debian.org>
Date:   Thu Jan 19 00:23:10 2017 +0000

    pbuilder-modules: Add new get_changes_options function
    
    This extract options for dpkg-genchanges from DEBBUILDOPTS, allowing
    them to be passed to the new source-only dpkg-genchanges calls.
---
 pbuilder-modules | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/pbuilder-modules b/pbuilder-modules
index 141ab0d..461616d 100644
--- a/pbuilder-modules
+++ b/pbuilder-modules
@@ -918,6 +918,32 @@ b paraloop' \
     "$file"
 }
 
+function get_changes_options() {
+    local changes_options
+    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
+            -s[iad]|-v*|-m*|-e*|-C*)
+                changes_options="${changes_options:+$changes_options }'$arg'"
+                ;;
+            --changes-option=*)
+                changes_options="${changes_options:+$changes_options }'${arg#--changes-option=}'"
+                ;;
+            # dpkg-genchanges doesn't support the long form of some options
+            --release-by=*)
+                changes_options="${changes_options:+$changes_options }-m'${arg#--release-by=}'"
+                ;;
+            --build-by=*)
+                changes_options="${changes_options:+$changes_options }-e'${arg#--build-by=}'"
+                ;;
+        esac
+    done
+    echo "${changes_options:-}"
+}
+
 #==========================================================================
 # 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