summaryrefslogtreecommitdiffstats
path: root/functions
diff options
context:
space:
mode:
authorFrans Pop <fjp@debian.org>2007-11-13 12:40:58 (GMT)
committerFrans Pop <fjp@debian.org>2007-11-13 12:40:58 (GMT)
commit5bae6aed48b2289fd00c320ba50baaa2f16c99ab (patch)
treee2db8d84f79bd81667ad205474105485c3a10ed9 /functions
parentadbeae1da243d9124f83ed3a011e85e3ab9b4e74 (diff)
downloaddebootstrap-5bae6aed48b2289fd00c320ba50baaa2f16c99ab.zip
debootstrap-5bae6aed48b2289fd00c320ba50baaa2f16c99ab.tar.gz
debootstrap-5bae6aed48b2289fd00c320ba50baaa2f16c99ab.tar.bz2
Linewrap inlined perl code for readability
r50116
Diffstat (limited to 'functions')
-rw-r--r--functions28
1 files changed, 26 insertions, 2 deletions
diff --git a/functions b/functions
index 0c4ab10..a43ab6b 100644
--- a/functions
+++ b/functions
@@ -940,10 +940,34 @@ for $v (keys %fields) {
pkgdetails_perl () {
if [ "$1" = "WGET%" ]; then
shift;
- perl -e '$v = 0; while (read STDIN, $x, 1) { if ($x =~ m/\d/) { $v *= 10; $v += $x; } elsif ($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; } }' "$@"
+ perl -e '
+$v = 0;
+while (read STDIN, $x, 1) {
+ if ($x =~ m/\d/) {
+ $v *= 10;
+ $v += $x;
+ } elsif ($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;
+ }
+}' "$@"
elif [ "$1" = "GETDEPS" ]; then
local pkgdest="$2"; shift; shift
- perl -e 'while (<STDIN>) { chomp; $in = 1 if (/^Package: (.*)$/ && grep {$_ eq $1} @ARGV); $in = 0 if (/^$/); if ($in and (/^Depends: (.*)$/ or /^Pre-Depends: (.*)$/)) { for $d (split /\s*,\s*/, $1) { $d =~ s/\s*[|].*$//; $d =~ s/\s*[(].*[)]\s*//; print "$d\n"; }}}' <"$pkgdest" "$@" | sort | uniq
+ perl -e '
+while (<STDIN>) {
+ chomp;
+ $in = 1 if (/^Package: (.*)$/ && grep {$_ eq $1} @ARGV);
+ $in = 0 if (/^$/);
+ if ($in and (/^Depends: (.*)$/ or /^Pre-Depends: (.*)$/)) {
+ for $d (split /\s*,\s*/, $1) {
+ $d =~ s/\s*[|].*$//;
+ $d =~ s/\s*[(].*[)]\s*//;
+ print "$d\n";
+ }
+ }
+}' <"$pkgdest" "$@" | sort | uniq
elif [ "$1" = "PKGS" ]; then
local m="$2"
local p="$3"