* Sun 2007-09-23 Frank Lichtenheld <djpig AT debian.org> INBOX
>> +'{arch}'
Fixed.
> the quotes don't belong here.
>
>> +.a
Fixed.
> This should be *.a, shouldn't it?
> Similar for .la, .o, .so, and .swp
>
Fixed.
> What are the reasons for differences to the diff ignore default? I
> understand the addition of .a, .o, and .so since these will cause errors
> in diffs anyway but not for tars. But you at least left out the
> tla/bazaar style temp directories (i.e. ',,*'). Any reason?
Added. Please check if I understood that correctly.
>> +# Remove possible leading and trailing whitespace
>> +$ignore_tar_default_regexp =~ s/\A\s+//;
>> +$ignore_tar_default_regexp =~ s/\s+\Z//;
>> +
>> +# Remove possible comment lines; remove newllines to spaces
>> +$ignore_tar_default_regexp =~ s/#*\s*[\r\n]+/ /gm;
>
> I think if we use an array for the default, the rest of the code gets
> much, much easier. I.e. @tar_ignore_default_regexp = qw'...';
Good idea. Implemented.
Jari
diff --git a/man/dpkg-source.1 b/man/dpkg-source.1
index e83156f..faaf238 100644
--- a/man/dpkg-source.1
+++ b/man/dpkg-source.1
@@ -126,12 +126,18 @@ 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
+.BI \-I[\fIfile-pattern\fP]
+
+If this option is specified, the pattern will be passed to tar'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 tar(1) \-\-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
diff --git a/scripts/dpkg-source.pl b/scripts/dpkg-source.pl
index 83f63aa..58d7560 100755
--- a/scripts/dpkg-source.pl
+++ b/scripts/dpkg-source.pl
@@ -34,6 +34,37 @@ my $diff_ignore_default_regexp = '
\.shelf|_MTN|\.bzr(?:\.backup|tags)?)(?:$|/.*$)
';
+my @ignore_tar_default_regexp = qw(
+,,*
+*/,,*
+*.a
+*[#~]
+.[#~]*
+.arch-ids
+.arch-inventory
+.bzr
+.bzr.backup
+.bzr.tags
+.bzrignore
+.cvsignore
+.deps
+.git
+.gitignore
+.hg
+.la
+.o
+.shelf
+.so
+.svn
+.swp
+CVS
+DEADJOE
+RCS
+_MTN
+_darcs
+{arch}
+);
+
# Take out comments and newlines
$diff_ignore_default_regexp =~ s/^#.*$//mg;
$diff_ignore_default_regexp =~ s/\n//sg;
@@ -107,6 +138,9 @@ later for copying conditions. There is NO warranty.
}
sub usage {
+
+ my $tmp = join '', map { " -I$_" } @ignore_tar_default_regexp;
+
printf _g(
"Usage: %s [<option> ...] <command>
@@ -129,7 +163,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 +182,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,
+ $tmp;
}
sub handleformat {
@@ -158,6 +195,7 @@ sub handleformat {
my $opmode;
+my $ignore_tar_default_regexp_done;
while (@ARGV && $ARGV[0] =~ m/^-/) {
$_=shift(@ARGV);
@@ -183,6 +221,15 @@ 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 ($ignore_tar_default_regexp_done)
+ {
+ push @tar_ignore,
+ map { "--exclude=$_" } @ignore_tar_default_regexp;
+
+ # Prevent adding multiple times
+ $ignore_tar_default_regexp_done = 1;
+ }
} elsif (m/^-V(\w[-:0-9A-Za-z]*)[=:]/) {
$substvar{$1}= "$'";
} elsif (m/^-T/) {
--
Welcome to FOSS revolution: we fix and modify until it shines
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]