diff options
author | Colin Watson <cjwatson@debian.org> | 2014-02-07 16:08:40 (GMT) |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2014-02-07 16:08:40 (GMT) |
commit | ede3cf04104a5d21cb2973ce6ab849e8ccd66aa3 (patch) | |
tree | 07c6ddcec7cf1e94fb34d58dffb354976ac9f7df | |
parent | 27fff7c1de46d5215b8d75066625addf4e1a1929 (diff) | |
download | debootstrap-ede3cf04104a5d21cb2973ce6ab849e8ccd66aa3.zip debootstrap-ede3cf04104a5d21cb2973ce6ab849e8ccd66aa3.tar.gz debootstrap-ede3cf04104a5d21cb2973ce6ab849e8ccd66aa3.tar.bz2 |
pkgdetails_perl: Only interpret percentages following whitespace, to cope with GNU wget outputting the local file name (which may contain "%" due to URL-encoding) after it finishes the download (LP: #1172101).
-rw-r--r-- | debian/changelog | 8 | ||||
-rw-r--r-- | functions | 8 |
2 files changed, 14 insertions, 2 deletions
diff --git a/debian/changelog b/debian/changelog index a5d1e8b..819b0a4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +debootstrap (1.0.57) UNRELEASED; urgency=medium + + * pkgdetails_perl: Only interpret percentages following whitespace, to + cope with GNU wget outputting the local file name (which may contain "%" + due to URL-encoding) after it finishes the download (LP: #1172101). + + -- Colin Watson <cjwatson@debian.org> Fri, 07 Feb 2014 16:05:59 +0000 + debootstrap (1.0.56) unstable; urgency=low [ Tollef Fog Heen ] @@ -1138,15 +1138,19 @@ for $v (keys %fields) { shift; perl -e ' $v = 0; +$allow_percentage = 0; while (read STDIN, $x, 1) { - if ($x =~ m/\d/) { + if ($x =~ m/\s/) { + $allow_percentage = 1; + } elsif ($allow_percentage and $x =~ m/\d/) { $v *= 10; $v += $x; - } elsif ($x eq "%") { + } elsif ($allow_percentage and $x eq "%") { printf "P: %d %d%s\n", int($v / 100.0 * ($ARGV[1] - $ARGV[0]) + $ARGV[0]), $ARGV[2], ($#ARGV == 3 ? " $ARGV[3]" : ""); $v = 0; } else { $v = 0; + $allow_percentage = 0; } }' "$@" elif [ "$1" = "GETDEPS" ]; then |