Просмотр исходного кода

Merge branch 'master' into dpkg-shlibdeps-buxy

Raphael Hertzog лет назад: 19
Родитель
Сommit
6329ea7263
9 измененных файлов с 140 добавлено и 30 удалено
  1. 24 0
      ChangeLog
  2. 5 0
      debian/changelog
  3. 1 1
      debian/copyright
  4. 1 0
      debian/dpkg-dev.install
  5. 12 0
      man/ChangeLog
  6. 3 1
      man/dpkg-buildpackage.1
  7. 42 20
      man/dpkg-source.1
  8. 8 6
      scripts/dpkg-buildpackage.pl
  9. 44 2
      scripts/dpkg-source.pl

+ 24 - 0
ChangeLog

@@ -1,3 +1,27 @@
+2007-09-24  Guillem Jover  <guillem@debian.org>
+
+	* scripts/dpkg-buildpackage.pl (signfile): Do not use absolute path
+	for 'rm'.
+
+2007-09-24  Guillem Jover  <guillem@debian.org>
+
+	* scripts/dpkg-buildpackage.pl (usage): Fix typo
+	s/dpkg-genchangs/dpkg-genchanges/.
+
+2007-09-24  Guillem Jover  <guillem@debian.org>
+
+	* scripts/dpkg-buildpackage.pl ($warnable_errors): Rename to ...
+	($warnable_error): ... this, and declare as 'our'.
+
+2007-09-24  Jari Aalto  <jari.aalto@cante.net>
+            Frank Lichtenheld  <djpig@debian.org>
+
+	* scripts/dpkg-source.pl: Allow use of -I
+	without filename pattern and load a list
+	of default patterns which is in effect as
+	similar as possible to the default regexp
+	of -i.
+
 2007-09-23  Frank Lichtenheld  <djpig@debian.org>
 
 	* scripts/dpkg-buildpackage.pl: Add new option

+ 5 - 0
debian/changelog

@@ -52,6 +52,11 @@ dpkg (1.14.7~newshlib) experimental; urgency=low
     MAKEFLAGS(-j<n>) and DEB_BUILD_OPTIONS(parallel=<n>) accordingly.
     parallel=<n> in DEB_BUILD_OPTIONS will be passed to MAKEFLAGS as
     well. Based on an idea by Robert Millan. Closes: #440636
+  * Allow dpkg-source -I without a pattern which will load a default
+    list of pattern similar to -i without regexp. Patch by
+    Jari Aalto. Closes: #440972
+  * Rework documentation of dpkg-source's -i and -I options.
+    Closes: #323911, #440956
 
   [ Updated dpkg translations ]
   * Basque (Piarres Beobide). Closes: #440859

+ 1 - 1
debian/copyright

@@ -1,6 +1,6 @@
 This is Debian's package maintenance system.
 
-Copyright © 2006 Frank Lichtenheld <djpig@debian.org>
+Copyright © 2006-2007 Frank Lichtenheld <djpig@debian.org>
 Copyright © 2004-2005 Scott James Remnant <scott@netsplit.com>
 Copyright © 2004-2005 Canonical Ltd.
 Copyright © 1999-2002 Wichert Akkerman <wakkerma@debian.org>

+ 1 - 0
debian/dpkg-dev.install

@@ -64,3 +64,4 @@ usr/share/man/*/*/dpkg-shlibdeps.1
 usr/share/man/*/dpkg-shlibdeps.1
 usr/share/man/*/*/dpkg-source.1
 usr/share/man/*/dpkg-source.1
+usr/share/perl5/Dpkg/BuildOptions.pm

+ 12 - 0
man/ChangeLog

@@ -1,3 +1,15 @@
+2007-09-24  Frank Lichtenheld  <djpig@debian.org>
+
+	* dpkg-source.1: Rework documentation of -i
+	and -I options to give clearer explanations and
+	explain the differences between the two in syntax
+	and semantics.
+
+2007-09-24  Jari Aalto  <jari.aalto@cante.net>
+
+	* dpkg-source.1: Document new behaviour
+	of -I option.
+
 2007-09-23  Frank Lichtenheld  <djpig@debian.org>
 
 	* dpkg-buildpackage.1: Document the new -j

+ 3 - 1
man/dpkg-buildpackage.1

@@ -172,7 +172,7 @@ Do not sign the .changes file.
 Passed unchanged to
 .BR dpkg\-source .
 .TP
-.BI \-I filename
+.BI \-I [\fIpattern\fP]
 Passed unchanged to
 .BR dpkg\-source .
 May be repeated multiple times.
@@ -203,6 +203,8 @@ and initial arguments for
 Copyright (C) 1995-1996 Ian Jackson
 .br
 Copyright (C) 2000 Wichert Akkerman
+.br
+Copyright (C) 2007 Frank Lichtenheld
 .sp
 This is free software; see the GNU General Public Licence version 2 or later
 for copying conditions. There is NO WARRANTY.

+ 42 - 20
man/dpkg-source.1

@@ -1,5 +1,5 @@
 .\" Authors: Ian Jackson
-.TH dpkg\-source 1 "2007-07-18" "Debian Project" "dpkg utilities"
+.TH dpkg\-source 1 "2007-09-24" "Debian Project" "dpkg utilities"
 .SH NAME
 dpkg\-source \- Debian source package (.dsc) manipulation tool
 .
@@ -112,31 +112,48 @@ filtered out of the list of files for the diff. (This list is
 generated by a find command.) \fB\-i\fR by itself enables the option,
 with a default that will filter out control files and directories of the
 most common revision control systems, backup and swap files and Libtool
-build output directories.
+build output directories. There can only be one active regexp, of multiple
+\-i options only the last one will take effect.
+
 
 This is very helpful in cutting out extraneous files that get included
-in the .diff.gz, (eg: "debian/BUGS_TODO/*" or "debian/RCS/*,v"). For
-instance, if you maintain a package that you track via remote CVS,
-where you don't have access permissions for committing the debian
-control files and making tags for \fIcvs\-buildpackage(1)\fR, it is
-necessary to perform an extra checkout/update into a directory you
-keep pristine, to generate the .orig.tar.gz from. That directory will
-have CVS/Entries files in it that will contain timestamps that differ
-from the ones in your working directory, thus causing them to be
-unnecessarily included in every .diff.gz, unless you use the \fB\-i\fR
-switch.
-.TP
-.BI \-I filename
-If this option is specified, the filename will be passed to tar's \-\-exclude
+in the .diff.gz, e.g. if you maintain your source in a revision control
+system and want to use a checkout to build a source package without
+including the additional files and directories that it will usually
+contain (e.g. CVS/, .cvsignore, .svn/). The default regexp is already
+very exhaustive, but if you need to replace it, please note that by
+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
+the neccessary anchors (e.g. '(^|/)', '($|/)') yourself.
+.TP
+.BR \-I [\fIfile-pattern\fP]
+If this option is specified, the pattern will be passed to
+.BR tar (1)'s
+\-\-exclude
 option when it is called to generate a .orig.tar.gz or .tar.gz file. For
 example, \-ICVS will make tar skip over CVS directories when generating
 a .tar.gz file. The option may be repeated multiple times to list multiple
-filenames to exclude.
+patterns to exclude.
+
+\fB\-I\fR by itself adds default \-\-exclude options that will
+filter out control files and directories of the most common revision
+control systems, backup and swap files and Libtool build output
+directories.
 .PP
-All the
-.BI \-s X
-options are mutually exclusive. If you specify more than one only the
-last one will be used.
+.B Note:
+While they have similar purposes, \fB-i\fP and \fB-I\fP have very
+different syntax and semantics. \fB-i\fP can only be specified once and
+takes a perl compatible regular expression which is matched against
+the full relative path of each file. \fB-I\fP can specified
+multiple times and takes a filename pattern with shell wildcards.
+The pattern is applied to the full relative path but also
+to each part of the path individually. The exact semantic of tar's
+\-\-exclude option is somewhat complicated, see
+http://www.gnu.org/software/tar/manual/tar.html#wildcards for a full
+documentation.
+
+The default regexp and patterns for both options can be seen
+in the output of the \fB\-\-help\fP command.
 .TP
 .B Build options (with -b):
 .PP
@@ -227,6 +244,11 @@ Unpacks the original source tree.
 Ensures that the original source is neither copied to the current
 directory nor unpacked. Any original source tree that was in the
 current directory is still removed.
+.PP
+All the
+.BI \-s X
+options are mutually exclusive. If you specify more than one only the
+last one will be used.
 .
 .SH BUGS
 The point at which field overriding occurs compared to certain

+ 8 - 6
scripts/dpkg-buildpackage.pl

@@ -13,6 +13,8 @@ use Dpkg::BuildOptions;
 push (@INC, $dpkglibdir);
 require 'controllib.pl';
 
+our $warnable_error;
+
 textdomain("dpkg-dev");
 
 sub showversion {
@@ -54,7 +56,7 @@ Options:
   -v<version>    changes since version <version>.      }
   -m<maint>      maintainer for package is <maint>.    }
   -e<maint>      maintainer for release is <maint>.    } only passed
-  -C<descfile>   changes are described in <descfile>.  } to dpkg-genchangs
+  -C<descfile>   changes are described in <descfile>.  } to dpkg-genchanges
   -si (default)  src includes orig for rev. 0 or 1.    }
   -sa            uploaded src always includes orig.    }
   -sd            uploaded src is diff and .dsc only.   }
@@ -66,7 +68,7 @@ Options:
   -W             turn certain errors into warnings.       } passed to
   -E             when -W is turned on, -E turns it off.   } dpkg-source
   -i[<regex>]    ignore diffs of files matching regex.    } only passed
-  -I<filename>   filter out files when building tarballs. } to dpkg-source
+  -I[<pattern>]  filter out files when building tarballs. } to dpkg-source
   --admindir=<directory>
                  change the administrative directory.
   -h, --help     show this help message.
@@ -95,7 +97,7 @@ if ( ( ($ENV{GNUPGHOME} && -e $ENV{GNUPGHOME})
 }
 
 my ($admindir, $signkey, $forcesigninterface, $usepause, $noclean,
-    $warnable_errors, $sourcestyle, $cleansource,
+    $sourcestyle, $cleansource,
     $binaryonly, $sourceonly, $since, $maint,
     $changedby, $desc, $parallel);
 my (@checkbuilddep_args, @passopts, @tarignore);
@@ -187,10 +189,10 @@ while (@ARGV) {
     } elsif (/^-C(.*)$/) {
 	$desc = $1;
     } elsif (/^-W$/) {
-	$warnable_errors = 1;
+	$warnable_error = 1;
 	push @passopts, '-W';
     } elsif (/^-E$/) {
-	$warnable_errors = 0;
+	$warnable_error = 0;
 	push @passopts, '-E';
     } else {
 	usageerr(sprintf(_g("unknown option or argument %s"), $_));
@@ -309,7 +311,7 @@ sub signfile {
 	system('mv', '--', "../$file.asc", "../$file")
 	    and subprocerr('mv');
     } else {
-	system('/bin/rm', '-f', "../$file.asc")
+	system('rm', '-f', "../$file.asc")
 	    and subprocerr('rm -f');
     }
     print "\n";

+ 44 - 2
scripts/dpkg-source.pl

@@ -34,6 +34,37 @@ my $diff_ignore_default_regexp = '
 \.shelf|_MTN|\.bzr(?:\.backup|tags)?)(?:$|/.*$)
 ';
 
+no warnings 'qw';
+my @tar_ignore_default_pattern = qw(
+*.a
+*.la
+*.o
+*.so
+*.swp
+*~
+,,*
+.[#~]*
+.arch-ids
+.arch-inventory
+.bzr
+.bzr.backup
+.bzr.tags
+.bzrignore
+.cvsignore
+.deps
+.git
+.gitignore
+.hg
+.shelf
+.svn
+CVS
+DEADJOE
+RCS
+_MTN
+_darcs
+{arch}
+);
+
 # Take out comments and newlines
 $diff_ignore_default_regexp =~ s/^#.*$//mg;
 $diff_ignore_default_regexp =~ s/\n//sg;
@@ -129,7 +160,8 @@ Build options:
   -q                       quiet operation, do not print warnings.
   -i[<regexp>]             filter out files to ignore diffs of
                              (defaults to: '%s').
-  -I<filename>             filter out files when building tarballs.
+  -I[<pattern>]            filter out files when building tarballs
+                             (defaults to: %s).
   -sa                      auto select orig source (-sA is default).
   -sk                      use packed orig source (unpack & keep).
   -sp                      use packed orig source (unpack & remove).
@@ -147,7 +179,9 @@ Extract options:
 General options:
   -h, --help               show this help message.
       --version            show the version.
-"), $progname, $diff_ignore_default_regexp;
+"), $progname,
+    $diff_ignore_default_regexp,
+    join('', map { " -I$_" } @tar_ignore_default_pattern);
 }
 
 sub handleformat {
@@ -158,6 +192,7 @@ sub handleformat {
 
 
 my $opmode;
+my $tar_ignore_default_pattern_done;
 
 while (@ARGV && $ARGV[0] =~ m/^-/) {
     $_=shift(@ARGV);
@@ -183,6 +218,13 @@ while (@ARGV && $ARGV[0] =~ m/^-/) {
         $diff_ignore_regexp = $1 ? $1 : $diff_ignore_default_regexp;
     } elsif (m/^-I(.+)$/) {
         push @tar_ignore, "--exclude=$1";
+    } elsif (m/^-I$/) {
+        unless ($tar_ignore_default_pattern_done) {
+            push @tar_ignore,
+                 map { "--exclude=$_" } @tar_ignore_default_pattern;
+            # Prevent adding multiple times
+            $tar_ignore_default_pattern_done = 1;
+        }
     } elsif (m/^-V(\w[-:0-9A-Za-z]*)[=:]/) {
         $substvar{$1}= "$'";
     } elsif (m/^-T/) {