SPECS: sed_to_patch.pl - fixed support for seds longer than 2 lines
sparky
sparky at pld-linux.org
Thu Aug 3 04:04:24 CEST 2006
Author: sparky Date: Thu Aug 3 02:04:24 2006 GMT
Module: SPECS Tag: HEAD
---- Log message:
- fixed support for seds longer than 2 lines
---- Files affected:
SPECS:
sed_to_patch.pl (1.2 -> 1.3)
---- Diffs:
================================================================
Index: SPECS/sed_to_patch.pl
diff -u SPECS/sed_to_patch.pl:1.2 SPECS/sed_to_patch.pl:1.3
--- SPECS/sed_to_patch.pl:1.2 Wed Aug 2 02:27:49 2006
+++ SPECS/sed_to_patch.pl Thu Aug 3 04:04:19 2006
@@ -25,9 +25,9 @@
while (<F_IN> !~ /\%prep/) {};
while (<F_IN>) {
- chomp;
- last if $_ eq '%build';
- $_ .= <F_IN> while s/\\$//;
+ last if $_ eq "\%build\n";
+ $_ .= <F_IN> while s/\\\n$//;
+ print "S: $_\n";
push @seds, $_ if /^sed.*\s-i\s/;
}
close F_IN;
@@ -78,9 +78,8 @@
last if /\%prep/;
}
while (<F_IN>) {
- chomp;
die "Can't find sed line\n" if $_ eq '%build';
- $_ .= <F_IN> while s/\\$//;
+ $_ .= <F_IN> while s/\\\n//;
if (/^sed.*\s-i\s/) {
last if ($_ eq $outseds[0]);
}
@@ -166,15 +165,16 @@
$_ = "\%patch$patch_num -p1\n";
} elsif (/^sed/) {
my @sed_command = ($_);
- while (s/\\$//) {
+ while (s/\\\n//) {
my $l = shift @spec;
push @sed_command, $l;
$_ .= $l;
}
- chomp;
my $found = 0;
foreach my $s (@outseds) {
+ #print "EQ?\n''$_''\n''$s''\n";
$found = 1 if $_ eq $s;
+ #print "$found\n";
}
unless ($found) {
foreach (@sed_command) {
================================================================
---- CVS-web:
http://cvs.pld-linux.org/SPECS/sed_to_patch.pl?r1=1.2&r2=1.3&f=u
More information about the pld-cvs-commit
mailing list