Kaynağa Gözat

dpkg-source: fix behaviour of --extend-diff-ignore if used after --diff-ignore

Up to now --extend-diff-ignore was only extending the default diff-ignore.
This is usually enough as this option is usually put in
debian/source/options and interpreted early enough before any other -i
option (that activates the usage of the default diff-ignore regexp).

Should --extend-diff-ignore appear after -i, it should still extend
the regexp that we're going to use.
Raphaël Hertzog 15 yıl önce
ebeveyn
işleme
7665f7d8ae
3 değiştirilmiş dosya ile 10 ekleme ve 5 silme
  1. 2 0
      debian/changelog
  2. 5 5
      man/dpkg-source.1
  3. 3 0
      scripts/dpkg-source.pl

+ 2 - 0
debian/changelog

@@ -10,6 +10,8 @@ dpkg (1.16.1) UNRELEASED; urgency=low
     LP: #344019
   * Tighten the regexp used by dpkg-source to ignore the .pc directory of
     quilt. Thanks to Mike Hommey for noticing the problem.
+  * Change behaviour of dpkg-source's --extend-diff-ignore to also
+    extend the current diff-ignore if it has already been set.
 
   [ Guillem Jover ]
   * Install deb-src-control(5) man pages in dpkg-dev. Closes: #620520

+ 5 - 5
man/dpkg-source.1

@@ -172,11 +172,11 @@ begin of a filename or only full filenames, you will need to provide
 the necessary anchors (e.g. '(^|/)', '($|/)') yourself.
 .TP
 .BR \-\-extend\-diff\-ignore =\fIregexp\fP
-The perl regular expression specified will extend the default regular
-expression associated to \fB\-i\fP by concatenating "\fB|\fP\fIregexp\fP"
-to the default regexp.  This option is convenient to use in
-\fBdebian/source/options\fP to exclude some auto-generated files
-from the automatic patch generation.
+The perl regular expression specified will extend the default value
+of \fB\-\-diff\-ignore\fP and its current value (if set). It does this
+by concatenating "\fB|\fP\fIregexp\fP" to the existing value.
+This option is convenient to use in \fBdebian/source/options\fP to exclude
+some auto-generated files from the automatic patch generation.
 .TP
 .BR \-I "[\fIfile-pattern\fP], " \-\-tar\-ignore [=\fIfile-pattern\fP]
 If this option is specified, the pattern will be passed to

+ 3 - 0
scripts/dpkg-source.pl

@@ -158,6 +158,9 @@ while (@options) {
         $options{'diff_ignore_regexp'} = $1 ? $1 : $Dpkg::Source::Package::diff_ignore_default_regexp;
     } elsif (m/^--extend-diff-ignore=(.+)$/) {
 	$Dpkg::Source::Package::diff_ignore_default_regexp .= "|$1";
+	if ($options{'diff_ignore_regexp'}) {
+	    $options{'diff_ignore_regexp'} .= "|$1";
+	}
     } elsif (m/^-(?:I|-tar-ignore=)(.+)$/) {
         push @{$options{'tar_ignore'}}, $1;
     } elsif (m/^-(?:I|-tar-ignore)$/) {