aboutsummaryrefslogtreecommitdiff
path: root/pbuilder-buildpackage-funcs
diff options
context:
space:
mode:
authorMattia Rizzolo <mattia@mapreri.org>2015-06-25 18:49:37 +0000
committerMattia Rizzolo <mattia@mapreri.org>2015-06-25 19:12:16 +0000
commitd77b8f8c04b2b5e065025356393b3a4ec355383b (patch)
tree7690c388ee3cea6998855841211625030104d6cc /pbuilder-buildpackage-funcs
parentb046dd0cf01ab3cb82c86b88f1d27b67c7effc49 (diff)
downloadpbuilder-d77b8f8c04b2b5e065025356393b3a4ec355383b.tar
pbuilder-d77b8f8c04b2b5e065025356393b3a4ec355383b.tar.gz
pbuilder-buildpackage-functs: allow .dsc to lack a newline between the Files: line and the signature.
Also add a couple of tests for this Closes: #741617
Diffstat (limited to 'pbuilder-buildpackage-funcs')
-rw-r--r--pbuilder-buildpackage-funcs24
1 files changed, 18 insertions, 6 deletions
diff --git a/pbuilder-buildpackage-funcs b/pbuilder-buildpackage-funcs
index 9ec12e7..dff362b 100644
--- a/pbuilder-buildpackage-funcs
+++ b/pbuilder-buildpackage-funcs
@@ -18,14 +18,26 @@
# functions local to pbuilder-buildpackage
-function copydsc () {
+getdscfiles () {
local DSCFILE="$1"
+ local DSCFILES=()
+ DSCFILES+=("$DSCFILE")
+ DSCFILES+=("$(cat "$DSCFILE" |
+ awk 'BEGIN{p=0}
+ ! /^[ \t]/ {p=0}
+ /^Files:/ {p=1}
+ ! /^[ \t]*/ {p=0}
+ /^ / {if (p){print "'$(dirname "$DSCFILE")'/" $3}}' |
+ tr '\n' ' ' | sed -e 's/[[:space:]]*$//')")
+ # ↑↑↑ because we are really picky (and we have picky tests...)
+ echo "${DSCFILES[@]}"
+}
+
+function copydsc () {
+ local DSCFILE=$(getdscfiles "$1")
local TARGET="$2"
- for FILE in \
- "$DSCFILE" \
- $(cat "$DSCFILE" | \
- awk 'BEGIN{p=0} /^$/ {p=0} /^.*:/ {p=0} {if (p){print "'$(dirname "$DSCFILE")'/" $3}} /^Files:/{p=1}' ) ; do
- log "I: copying [$FILE]"
+ for FILE in ${DSCFILE[@]} ; do
+ log "I: copying [$FILE]"
cp -p "$FILE" "$TARGET"
done
}