summaryrefslogtreecommitdiff
path: root/pkgtools
diff options
context:
space:
mode:
authorrillig <rillig>2005-09-02 11:43:52 +0000
committerrillig <rillig>2005-09-02 11:43:52 +0000
commit75553e7df9ca8697e6dc26aaf313453c963ba921 (patch)
treee492e11896d7742606023a439bb0f683ab38d460 /pkgtools
parentfff72f0128792ef509d7fe83045e237157b02f3d (diff)
downloadpkgsrc-75553e7df9ca8697e6dc26aaf313453c963ba921.tar.gz
In logical lines from Makefiles, white-space surrounding the
continuation is stripped from the string to make the output shorter.
Diffstat (limited to 'pkgtools')
-rw-r--r--pkgtools/pkglint/files/pkglint.pl21
1 files changed, 13 insertions, 8 deletions
diff --git a/pkgtools/pkglint/files/pkglint.pl b/pkgtools/pkglint/files/pkglint.pl
index 9b9276a09f1..d3f74b011de 100644
--- a/pkgtools/pkglint/files/pkglint.pl
+++ b/pkgtools/pkglint/files/pkglint.pl
@@ -11,7 +11,7 @@
# Freely redistributable. Absolutely no warranty.
#
# From Id: portlint.pl,v 1.64 1998/02/28 02:34:05 itojun Exp
-# $NetBSD: pkglint.pl,v 1.267 2005/09/02 10:42:18 rillig Exp $
+# $NetBSD: pkglint.pl,v 1.268 2005/09/02 11:43:52 rillig Exp $
#
# This version contains lots of changes necessary for NetBSD packages
# done by:
@@ -506,16 +506,21 @@ sub parse_command_line() {
sub get_logical_line($$) {
my ($lines, $ref_lineno) = @_;
- my ($value, $lineno);
+ my ($value, $lineno, $first);
$value = "";
+ $first = true;
for ($lineno = ${$ref_lineno}; $lineno <= $#{$lines}; $lineno++) {
- my $text = $lines->[$lineno]->text;
- if ($text =~ qr"^(.*)\\$") {
- $value .= $1;
- } else {
- $value .= $text;
- last;
+ if ($lines->[$lineno]->text =~ qr"^(\s*)(.*?)\s*(\\?)$") {
+ my ($indent, $text, $cont) = ($1, $2, $3);
+
+ $value .= $first ? "$indent$text" : $text;
+ if ($cont eq "\\") {
+ $value .= " ";
+ } else {
+ last;
+ }
+ $first = false;
}
}
${$ref_lineno} = $lineno + 1;