1
1

* extfs/patchfs.in: Allow diffs with function names after "@@".

Don't consider an empty newline as the end of the diff.
Этот коммит содержится в:
Pavel Roskin 2002-12-19 16:51:04 +00:00
родитель 4718c1105d
Коммит 6ee35e2c55
2 изменённых файлов: 10 добавлений и 5 удалений

Просмотреть файл

@ -1,3 +1,8 @@
2002-12-19 Adam Byrtek <alpha@debian.org>
* extfs/patchfs.in: Allow diffs with function names after "@@".
Don't consider an empty newline as the end of the diff.
2002-12-18 Andrew V. Samoilov <sav@bcs.zp.ua> 2002-12-18 Andrew V. Samoilov <sav@bcs.zp.ua>
* extfs/patchfs.in (openread): Use quoted $archive when opening * extfs/patchfs.in (openread): Use quoted $archive when opening

Просмотреть файл

@ -39,7 +39,7 @@ sub datetime
# print message on stderr and exit # print message on stderr and exit
sub error sub error
{ {
print STDERR $_[0]; print STDERR $_[0], "\n";
exit 1; exit 1;
} }
@ -69,7 +69,7 @@ sub list
$state=1; $state=1;
error "Can't parse unified diff header" error "Can't parse unified diff header"
unless ((($_.=<I>).=<I>)=~/^\-{3} .*\n\+{3} .*\n@@ .* @@\n$/); unless ((($_.=<I>).=<I>)=~/^\-{3} .*\n\+{3} .*\n@@ .* @@.*\n$/);
($fsrc)=/^-{3} ([^\s]+).*\n.*\n.*\n$/; ($fsrc)=/^-{3} ([^\s]+).*\n.*\n.*\n$/;
($fdst)=/^.*\n\+{3} ([^\s]+).*\n.*\n$/; ($fdst)=/^.*\n\+{3} ([^\s]+).*\n.*\n$/;
($time)=/^.*\n\+{3} [^\s]+\s+([^\t\n]+).*\n.*\n$/; ($time)=/^.*\n\+{3} [^\s]+\s+([^\t\n]+).*\n.*\n$/;
@ -108,7 +108,7 @@ sub list
} }
$f=$f.".diff"; $f=$f.".diff";
} elsif ($state==1 && !/^([+\- ]|@@)/) { } elsif ($state==1 && !/^([+\- \n]|@@)/) {
# start of comments, end of diff contents # start of comments, end of diff contents
$npos=tell(I)-length; $npos=tell(I)-length;
printf "-rw-r--r-- 1 %s %s %d %s %s%s\n", $uid, $gid, $npos-$pos, datetime($time), $prefix, $f printf "-rw-r--r-- 1 %s %s %d %s %s%s\n", $uid, $gid, $npos-$pos, datetime($time), $prefix, $f
@ -138,12 +138,12 @@ sub copyout
$state=1; $state=1;
error "Can't parse unified diff header" error "Can't parse unified diff header"
unless ((($_.=<I>).=<I>)=~/^\-{3} .*\n\+{3} .*\n@@ .* @@\n$/); unless ((($_.=<I>).=<I>)=~/^\-{3} .*\n\+{3} .*\n@@ .* @@.*\n$/);
($fsrc)=/^-{3} ([^\s]+).*\n.*\n.*\n$/; ($fsrc)=/^-{3} ([^\s]+).*\n.*\n.*\n$/;
($fdst)=/^.*\n\+{3} ([^\s]+).*\n.*\n$/; ($fdst)=/^.*\n\+{3} ([^\s]+).*\n.*\n$/;
$found=1 if (($fsrc eq $file) || ($fdst eq $file)); $found=1 if (($fsrc eq $file) || ($fdst eq $file));
} elsif ($state==1 && !/^([+\- ]|@@)/) { } elsif ($state==1 && !/^([+\- \n]|@@)/) {
# start of comments, end of diff contents # start of comments, end of diff contents
last if ($found); last if ($found);
$state=0; $state=0;