Переглянути джерело

dpkg-source: new options --extend-diff-ignore, --diff-ignore, --tar-ignore

--extend-diff-ignore is a truly new option while the others are long names
for the existing -i and -I options.
Raphaël Hertzog 16 роки тому
батько
коміт
bb70204c98
3 змінених файлів з 17 додано та 5 видалено
  1. 3 0
      debian/changelog
  2. 9 2
      man/dpkg-source.1
  3. 5 3
      scripts/dpkg-source.pl

+ 3 - 0
debian/changelog

@@ -53,6 +53,9 @@ dpkg (1.15.6) UNRELEASED; urgency=low
     "2.0" and "3.0 (quilt)" to auto-create the main original tarball when
     "2.0" and "3.0 (quilt)" to auto-create the main original tarball when
     there are supplementary tarballs. This makes it easier to bundle
     there are supplementary tarballs. This makes it easier to bundle
     multiple software together. Closes: #554488
     multiple software together. Closes: #554488
+  * dpkg-source supports long option names --diff-ignore and --tar-ignore for
+    -i and -I. A new option --extend-diff-ignore is introduced. Those options
+    can thus now be used in debian/source/options.
 
 
   [ Guillem Jover ]
   [ Guillem Jover ]
   * Handle argument parsing in dpkg-checkbuilddeps and dpkg-scanpackages
   * Handle argument parsing in dpkg-checkbuilddeps and dpkg-scanpackages

+ 9 - 2
man/dpkg-source.1

@@ -133,7 +133,7 @@ files. Supported values are:
 .IR 1 " to " 9 ", " best ", and " fast .
 .IR 1 " to " 9 ", " best ", and " fast .
 \fI9\fP is the default.
 \fI9\fP is the default.
 .TP
 .TP
-.BR \-i [\fIregexp\fP]
+.BR \-i "[\fIregexp\fP], " \-\-diff\-ignore [=\fIregexp\fP]
 You may specify a perl regular expression to match files you want
 You may specify a perl regular expression to match files you want
 filtered out of the list of files for the diff. (This list is
 filtered out of the list of files for the diff. (This list is
 generated by a find command.) (If the source package is being built as a
 generated by a find command.) (If the source package is being built as a
@@ -155,7 +155,14 @@ default it can match any part of a path, so if you want to match the
 begin of a filename or only full filenames, you will need to provide
 begin of a filename or only full filenames, you will need to provide
 the necessary anchors (e.g. '(^|/)', '($|/)') yourself.
 the necessary anchors (e.g. '(^|/)', '($|/)') yourself.
 .TP
 .TP
-.BR \-I [\fIfile-pattern\fP]
+.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.
+.TP
+.BR \-I "[\fIfile-pattern\fP], " \-\-tar\-ignore [=\fIfile-pattern\fP]
 If this option is specified, the pattern will be passed to
 If this option is specified, the pattern will be passed to
 .BR tar (1)'s
 .BR tar (1)'s
 \-\-exclude
 \-\-exclude

+ 5 - 3
scripts/dpkg-source.pl

@@ -144,11 +144,13 @@ while (@options) {
         $override{$1} = $2;
         $override{$1} = $2;
     } elsif (m/^-U([^\=:]+)$/) {
     } elsif (m/^-U([^\=:]+)$/) {
         $remove{$1} = 1;
         $remove{$1} = 1;
-    } elsif (m/^-i(.*)$/) {
+    } elsif (m/^-(?:i|-diff-ignore(?:$|=))(.*)$/) {
         $options{'diff_ignore_regexp'} = $1 ? $1 : $Dpkg::Source::Package::diff_ignore_default_regexp;
         $options{'diff_ignore_regexp'} = $1 ? $1 : $Dpkg::Source::Package::diff_ignore_default_regexp;
-    } elsif (m/^-I(.+)$/) {
+    } elsif (m/^--extend-diff-ignore=(.+)$/) {
+	$Dpkg::Source::Package::diff_ignore_default_regexp .= "|$1";
+    } elsif (m/^-(?:I|-tar-ignore=)(.+)$/) {
         push @{$options{'tar_ignore'}}, $1;
         push @{$options{'tar_ignore'}}, $1;
-    } elsif (m/^-I$/) {
+    } elsif (m/^-(?:I|-tar-ignore)$/) {
         unless ($tar_ignore_default_pattern_done) {
         unless ($tar_ignore_default_pattern_done) {
             push @{$options{'tar_ignore'}}, @Dpkg::Source::Package::tar_ignore_default_pattern;
             push @{$options{'tar_ignore'}}, @Dpkg::Source::Package::tar_ignore_default_pattern;
             # Prevent adding multiple times
             # Prevent adding multiple times