[pbuilder] 01/02: buildpackage-funcs: turn getdscfiles() into deb822files() to support retriving file list from .changes files as well

Mattia Rizzolo mattia at debian.org
Fri Sep 2 12:56:43 UTC 2016


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

mattia pushed a commit to branch master
in repository pbuilder.

commit 9e50ef1d7a18c9c62d14ad0a7499729ad28b01f2
Author: Mattia Rizzolo <mattia at debian.org>
Date:   Sat Jul 23 10:55:47 2016 +0000

    buildpackage-funcs: turn getdscfiles() into deb822files() to support retriving file list from .changes files as well
---
 pbuilder-buildpackage-funcs        | 23 +++++++++------
 t/data/changes1                    | 58 ++++++++++++++++++++++++++++++++++++++
 t/test_pbuilder-buildpackage-funcs | 11 +++++---
 3 files changed, 80 insertions(+), 12 deletions(-)

diff --git a/pbuilder-buildpackage-funcs b/pbuilder-buildpackage-funcs
index ed9587d..f05515c 100644
--- a/pbuilder-buildpackage-funcs
+++ b/pbuilder-buildpackage-funcs
@@ -20,23 +20,30 @@
 
 # functions local to pbuilder-buildpackage
 
-getdscfiles () {
-    local DSCFILE="$1"
-    local DSCFILES=()
-    DSCFILES+=("$DSCFILE")
-    DSCFILES+=("$(cat "$DSCFILE" |
+get822files () {
+    # get list of files listed in the Files field of a .changes or .dsc (to
+    # be specified in the first parameter)
+    local type="$1"
+    local input="$2"
+    local files=("$2")
+    case $type in
+        changes) local field=5 ;;
+        dsc) local field=3 ;;
+        *) log.error "unexpected error in get822files()" ; exit 1 ;;
+    esac
+    files+=("$(cat "$input" |
         awk 'BEGIN{p=0}
              ! /^[ \t]/ {p=0}
              /^Files:/ {p=1}
              ! /^[ \t]*/ {p=0}
-             /^ / {if (p){print "'$(dirname "$DSCFILE")'/" $3}}' |
+             /^ / {if (p){print "'$(dirname "$input")'/" $'${field}'}}' |
         tr '\n' ' ' | sed -e 's/[[:space:]]*$//')")
     #  ↑↑↑ because we are really picky (and we have picky tests...)
-    echo "${DSCFILES[@]}"
+    echo "${files[@]}"
 }
 
 function copydsc () {
-    local DSCFILE=$(getdscfiles "$1")
+    local DSCFILE=$(get822files "dsc" "$1")
     local TARGET="$2"
     for FILE in ${DSCFILE[@]} ; do
     log.i "copying [$FILE]"
diff --git a/t/data/changes1 b/t/data/changes1
new file mode 100644
index 0000000..54ccc80
--- /dev/null
+++ b/t/data/changes1
@@ -0,0 +1,58 @@
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA512
+
+Format: 1.8
+Date: Wed, 20 Jul 2016 20:27:55 +0000
+Source: pbuilder
+Binary: pbuilder
+Architecture: source all
+Version: 0.225.2~bpo8+1
+Distribution: jessie-backports
+Urgency: high
+Maintainer: Debian pbuilder maintenance team <pbuilder-maint at lists.alioth.debian.org>
+Changed-By: Mattia Rizzolo <mattia at debian.org>
+Description:
+ pbuilder   - personal package builder for Debian packages
+Closes: 831823
+Changes:
+ pbuilder (0.225.2~bpo8+1) jessie-backports; urgency=medium
+ .
+   * Rebuild for jessie-backports.
+   * Revert "pbuilderrc: add --force-check-gpg to DEBOOTSTRAPOPTS: this makes
+     debootstrap fail if the keyring is not available".
+     This option is not in jessie version of debootstrap.
+ .
+ pbuilder (0.225.2) unstable; urgency=high
+ .
+   [ James Clarke ]
+   * modules: Don't trash CHROOTEXEC when using eatmydata.  Closes: #831823
+Checksums-Sha1:
+ 6e11aa5aface3c9981108298d245403952ea5673 1843 pbuilder_0.225.2~bpo8+1.dsc
+ 9f0f8c821d5f3ae6d4da36e0acffe0f45a9c3631 307720 pbuilder_0.225.2~bpo8+1.tar.xz
+ 77118e5b6c716aac45db2245aba1ef5d87fcfe42 353256 pbuilder_0.225.2~bpo8+1_all.deb
+Checksums-Sha256:
+ 45089d41a1e458d6535b18f57fcd293a93ade3ab956e29b0d543668ae33b6c86 1843 pbuilder_0.225.2~bpo8+1.dsc
+ 7fe4913c9f5a484a757d458482a9dea2d60b12cf0e944bd4af7459df99c734e3 307720 pbuilder_0.225.2~bpo8+1.tar.xz
+ 22061403205a3c60506bb977285154ba3dd26311c0ec16cf40d3d5364fa23a6f 353256 pbuilder_0.225.2~bpo8+1_all.deb
+Files:
+ 25260bbd3d2768130aa234fdb8c25845 1843 devel extra pbuilder_0.225.2~bpo8+1.dsc
+ bcf648f66bf265d9efba327e9914cd85 307720 devel extra pbuilder_0.225.2~bpo8+1.tar.xz
+ 0dcfbbbcf3a56e69be1d48072a269a5c 353256 devel extra pbuilder_0.225.2~bpo8+1_all.deb
+
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v1
+
+iQIcBAEBCgAGBQJXj+DgAAoJEEsEP825REVA8dIQAMmgS5JdUCrPVHIXiFtuGrFv
+nSksaMf/R+ZzoZtAIddx5EzJt9Tj59TE2s/jdvad8frelthjfgYJTCpMMZMnaS/e
+YC4U3nzvmR2qji23IRgommXtddCvFdcCZTpxLSDHyRfxQOXugSOkWYBsGfy226Py
+5UfnNFFwWMuc0tmv3dIMWx77iuZdnno+ziXqlk32ca5ZrcLAvdjmi6pB1Vsy+TiC
+zltFLrBaS8XzI+0ZDsWUg35a+MZnQL/K5Z+bJ+ucpjCZhqLAUaboG2KXZaQ3YZJ7
+m75662Pk6XBQ8eVYHkarCaIjlk+lSYTinxRmYypQPSAYGHaOQEY6JqAV0hOYLKQg
+YkdnazSuetusIftxCP+RVZgQHsRHGsRaeh0IMRwBjFWSrYM3wPuI/wyTHRRQho6p
+HXBeDqTECLbKCP71JKtMy/T4ZZPQF4d+mC/+ZTevFuoYiuJbWtqpUOSiPR43thun
+N89qLR3lUFgVGY/MsgRBUvdPRv5ujMC0mZJGK/gymvccWTKDBOSWd4ajg69DpXHk
+4cCTzlSFjStsjZw5mz+3DlDPJvsczGIyCRVm/qaj2btZ4/X+d2/N0WPUl3Lld1eP
+98+W4VjaTNcyFwT0NVCzx/vVrGJU6H2fKFZp15NpfeUHzT1TwxdUdkYHDAONzZqY
+Jdltkz9afxN7d/2PZB2k
+=mjqd
+-----END PGP SIGNATURE-----
diff --git a/t/test_pbuilder-buildpackage-funcs b/t/test_pbuilder-buildpackage-funcs
index 8707247..a49ad62 100755
--- a/t/test_pbuilder-buildpackage-funcs
+++ b/t/test_pbuilder-buildpackage-funcs
@@ -41,16 +41,18 @@ cleanup() {
 }
 
 test_getdscfilesNormal () {
-
     cat "$TESTDATA_DIR/dsc1" > "$DEBIAN_CONTROL"
-    getdscfiles "$DEBIAN_CONTROL"
+    get822files dsc "$DEBIAN_CONTROL"
 }
 
 test_getdscfilesWithoutNL () {
-
     cat "$TESTDATA_DIR/dsc2_withoutNL" > "$DEBIAN_CONTROL"
-    getdscfiles "$DEBIAN_CONTROL"
+    get822files dsc "$DEBIAN_CONTROL"
+}
 
+test_getchangesfilesNormal () {
+    cat "$TESTDATA_DIR/changes1" > "$DEBIAN_CONTROL"
+    get822files changes "$DEBIAN_CONTROL"
 }
 
 trap cleanup sigpipe sighup exit
@@ -60,5 +62,6 @@ DEBIAN_CONTROL="$(mktemp)"
 
 expect_output "$DEBIAN_CONTROL /tmp/haskell-concrete-typerep_0.1.0.2.orig.tar.gz /tmp/haskell-concrete-typerep_0.1.0.2-2.debian.tar.gz" test_getdscfilesNormal
 expect_output "$DEBIAN_CONTROL /tmp/golang-xmpp-dev_0.0~git20140304.orig.tar.gz /tmp/golang-xmpp-dev_0.0~git20140304-1.debian.tar.xz" test_getdscfilesWithoutNL
+expect_output "$DEBIAN_CONTROL /tmp/pbuilder_0.225.2~bpo8+1.dsc /tmp/pbuilder_0.225.2~bpo8+1.tar.xz /tmp/pbuilder_0.225.2~bpo8+1_all.deb" test_getchangesfilesNormal
 
 testlib_summary

-- 
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