OpenPKG CVS Repository
http://cvs.openpkg.org/
____________________________________________________________________________
Server: cvs.openpkg.org Name: Ralf S. Engelschall
Root: /e/openpkg/cvs Email: [EMAIL PROTECTED]
Module: openpkg-tools Date: 22-Dec-2004 09:35:36
Branch: HEAD Handle: 2004122208353600
Modified files:
openpkg-tools/cmd lint-spec.pl
Log:
improve linting of %patch
Summary:
Revision Changes Path
1.5 +4 -4 openpkg-tools/cmd/lint-spec.pl
____________________________________________________________________________
patch -p0 <<'@@ .'
Index: openpkg-tools/cmd/lint-spec.pl
============================================================================
$ cvs diff -u -r1.4 -r1.5 lint-spec.pl
--- openpkg-tools/cmd/lint-spec.pl 24 Sep 2004 09:10:28 -0000 1.4
+++ openpkg-tools/cmd/lint-spec.pl 22 Dec 2004 08:35:36 -0000 1.5
@@ -839,13 +839,13 @@
&lint_warning($file, undef, undef, "section $section:
multiple spaces in \"\%patch\" macro" .
" (reduce to single space)");
}
- if ($this =~ m/^ *%patch.*-p +0/) {
+ if ($this =~ m/^ *%patch.*-p +[01]/) {
&lint_warning($file, undef, undef, "section $section:
syntactically wrong space in \"\%patch\" macro" .
- " (use -p0)");
+ " (use -pN)");
}
if ($this =~ m/^ *%patch.*-P 0\s*$/ and grep(/^\%patch+$/,
@tokens) == 1) {
&lint_warning($file, undef, undef, "section $section:
syntactically wrong space in \"\%patch\" macro" .
- " (omit -P for single patch)");
+ " (omit -P 0 for single patch)");
}
if ($this =~ m/^ *%patch.*-P [^0-9]/ and grep(/^\%patch+$/,
@tokens) > 1) {
&lint_warning($file, undef, undef, "section $section:
syntactically wrong space in \"\%patch\" macro" .
@@ -1093,7 +1093,7 @@
# parse %setup and %patch commands
$done = ''; $this = ''; $todo = $spec;
- $todo =~
s/^(\s*\%patch)((?:\s+-\S+)*)((?:\s+\d+)+)\s*$/&expand_patch($1, $2, $3)/mge;
+ $todo =~
s/^(\s*\%patch)((?:\s+-\S+|\s+-d\s+\S+)*)((?:\s+\d+)+)\s*$/&expand_patch($1,
$2, $3)/mge;
sub expand_patch {
my ($cmd, $opts, $nums) = @_;
my $cmds = '';
@@ .
______________________________________________________________________
The OpenPKG Project www.openpkg.org
CVS Repository Commit List [EMAIL PROTECTED]