[debrepatch] 01/01: Add a -t flag to override the suite

Ximin Luo infinity0 at debian.org
Mon Apr 17 15:53:18 UTC 2017


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

infinity0 pushed a commit to branch master
in repository debrepatch.

commit d53b600454dc683a10e37ef1f925d351112ae4e2
Author: Ximin Luo <infinity0 at debian.org>
Date:   Mon Apr 17 17:53:04 2017 +0200

    Add a -t flag to override the suite
---
 debrepatch | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/debrepatch b/debrepatch
index d98ba57..d2ed521 100755
--- a/debrepatch
+++ b/debrepatch
@@ -11,9 +11,11 @@ auto_update=false
 force_postpatch=false
 patchdir="./patches"
 builddir="./build"
-while getopts 'hyufb:p:' o; do
+suite="unstable"
+while getopts 'hyut:fb:p:' o; do
     case $o in
     u )     auto_update=true;;
+    t )     suite="$OPTARG";;
     f )     force_postpatch=true;;
     p )     patchdir="$OPTARG";;
     b )     builddir="$OPTARG";;
@@ -27,6 +29,7 @@ unpacked and patched package source directory.
 
   -h            This help text.
   -u            Run "apt-get update" first; requires sudo.
+  -t            Use this suite instead of "unstable".
   -f            Run post_patch_command even if there was no version change,
                 i.e. the current version is the same as what is mentioned in
                 debian/changelog in the patch file.
@@ -83,9 +86,9 @@ fi
 # TODO: yeah this is hacky but is easier than trying to select the
 # right version out of `apt-cache showsrc`. Ideally we'd expose the
 # logic of "static pkgSrcRecords::Parser *FindSrc" in apt-private/private-source.cc
-oldver="$(LC_ALL="en_US.utf8" apt-get -t sid source -s "$srcpkg" | sed -n -e "s/.*version '\(.*\)' .*/\1/p")"
+oldver="$(LC_ALL="en_US.utf8" apt-get -t "$suite" source -s "$srcpkg" | sed -n -e "s/.*version '\(.*\)' .*/\1/p")"
 srcdir="$srcpkg-$(echo "$oldver" | sed -re 's/([^:]*:)?(.*)-.*/\2/')"
-apt-get -t sid source "$srcpkg"
+apt-get -t "$suite" source "$srcpkg"
 olddsc="$(ls -1 *.dsc)" # TODO: probably more correct to use $oldver
 rm -rf "$srcdir"
 debpatch --verbose --no-clean --directory . "$olddsc" "$patchfile"

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



More information about the Reproducible-commits mailing list