[Debian-l10n-commits] r2250 - in /dl10n/trunk: Changelog lib/Debian/Pkg/Diff.pm
nekral-guest at users.alioth.debian.org
nekral-guest at users.alioth.debian.org
Sun May 23 21:14:55 UTC 2010
Author: nekral-guest
Date: Sun May 23 21:14:51 2010
New Revision: 2250
URL: http://svn.debian.org/wsvn/?sc=1&rev=2250
Log:
* lib/Debian/Pkg/Diff.pm: Allow diff header to end with
spaces/tabulation. This may break parsing of patches for files
ending with a space or tabulation.
Modified:
dl10n/trunk/Changelog
dl10n/trunk/lib/Debian/Pkg/Diff.pm
Modified: dl10n/trunk/Changelog
URL: http://svn.debian.org/wsvn/dl10n/trunk/Changelog?rev=2250&op=diff
==============================================================================
--- dl10n/trunk/Changelog (original)
+++ dl10n/trunk/Changelog Sun May 23 21:14:51 2010
@@ -1,3 +1,9 @@
+2010-04-12 Nicolas François <nicolas.francois at centraliens.net>
+
+ * lib/Debian/Pkg/Diff.pm: Allow diff header to end with
+ spaces/tabulation. This may break parsing of patches for files
+ ending with a space or tabulation.
+
2010-04-12 Nicolas François <nicolas.francois at centraliens.net>
* lib/Debian/L10n/BTS.pm: Do not complain if a bug is reported
Modified: dl10n/trunk/lib/Debian/Pkg/Diff.pm
URL: http://svn.debian.org/wsvn/dl10n/trunk/lib/Debian/Pkg/Diff.pm?rev=2250&op=diff
==============================================================================
--- dl10n/trunk/lib/Debian/Pkg/Diff.pm (original)
+++ dl10n/trunk/lib/Debian/Pkg/Diff.pm Sun May 23 21:14:51 2010
@@ -288,10 +288,13 @@
$self->{offset} += length($self->{curr_line});
$self->{curr_line} = <$fh>;
Carp::croak "Malformed diff: found\n$self->{curr_line}when expecting\n+++ $self->{_newdirprefix}$dir$self->{_newdirsuffix}/$file$self->{_newfilesuffix}"
- unless $self->{curr_line} =~ m#^\+\+\+ $self->{_newdirprefix}\Q$dir\E$self->{_newdirsuffix}/\Q$file\E$self->{_newfilesuffix}(\b|$)#;
+ unless $self->{curr_line} =~ m#^\+\+\+ $self->{_newdirprefix}\Q$dir\E$self->{_newdirsuffix}/\Q$file\E$self->{_newfilesuffix}\s*(\b|$)#;
+ # The \* above allows patch blocks to end with spaces or tabulations
+ # It might not be valid, but handwritten patches tends to contain such
+ # diff header (removal of date)
$self->{offset} += length($self->{curr_line});
$self->{curr_line} = <$fh>;
-
+warn "'$file'\n";
return $file;
}
More information about the Debian-l10n-commits
mailing list