Bug#26024: dpkg-dev: [patch] files to ignore diffs of...
--- dpkg-source 1998/08/21 12:00:13 1.1
+++ dpkg-source 1998/08/22 11:17:09
@@ -8,6 +8,8 @@
my %notfileobject;
my $fn;
+$diff_ignore_default_regexp = '^.*~$|DEAD_JOE|(?:/CVS|/RCS|/.deps)(?:$|/.*$)';
+
$sourcestyle = 'X';
use POSIX;
@@ -34,6 +36,8 @@
-T<varlistfile> read variables here, not debian/substvars
-D<field>=<value> override or add a .dsc field and value
-U<field> remove a field
+ -i[<regexp>] filter out files to ignore diffs of.
+ Defaults to: '$diff_ignore_default_regexp'
-sa auto select orig source (-sA is default)
-sk use packed orig source (unpack & keep)
-sp use packed orig source (unpack & remove)
@@ -71,6 +75,8 @@
$override{$1}= $';
} elsif (m/^-U([^\=:]+)$/) {
$remove{$1}= 1;
+ } elsif (m/^-i(.*)$/) {
+ $diff_ignore_regexp = $1 ? $1 : $diff_ignore_default_regexp;
} elsif (m/^-V(\w[-:0-9A-Za-z]*)[=:]/) {
$substvar{$1}= $';
} elsif (m/^-T/) {
@@ -338,7 +344,9 @@
file:
while (defined($fn= <FIND>)) {
- $fn =~ s/\0$//; $fn =~ s,^\./,,;
+ $fn =~ s/\0$//;
+ next file if $fn =~ m/$diff_ignore_regexp/o;
+ $fn =~ s,^\./,,;
lstat("$dir/$fn") || &syserr("cannot stat file $dir/$fn");
if (-l _) {
$type{$fn}= 'symlink';
@@ -414,7 +422,9 @@
}
$/= "\0";
while (defined($fn= <FIND>)) {
- $fn =~ s/\0$//; $fn =~ s,^\./,,;
+ $fn =~ s/\0$//;
+ next if $fn =~ m/$diff_ignore_regexp/o;
+ $fn =~ s,^\./,,;
next if defined($type{$fn});
lstat("$origdir/$fn") || &syserr("cannot check orig file $origdir/$fn");
if (-f _) {
--- dpkg-source.1.orig Sat Aug 22 04:38:36 1998
+++ dpkg-source.1 Sat Aug 22 04:40:04 1998
@@ -265,6 +265,26 @@
or the empty string (no original source, and so no diff) depending on
the arguments.
.TP
+.B -i[<regexp>]
+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
+generated by a find command.) \fB-i\fR by itself enables the option,
+with a default that will filter out CVS, RCS and libtool .deps
+subdirectories, and all files within them, as well as ~ suffixed
+backup files and DEAD_JOE's.
+
+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 commiting 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
.BR -sa , -sp , -su , -sk , -sA , -sP , -sU , -sK , -ss " with " -b
If
.BR -sk " or " -sp
@@ -547,6 +567,11 @@
.TP
.BR -us ", " -uc
Do not PGP-sign the source package or the changelog, respectively.
+.TP
+.B -i[<regexp>]
+Passed unchanged to
+.B dpkg-source
+.TP
.SH DPKG-DISTADDFILE ARGUMENTS
.B dpkg-distaddfile
does not take any non-common options. It takes three non-option
--- /usr/bin/dpkg-buildpackage.orig Mon Jul 27 12:21:28 1998
+++ /usr/bin/dpkg-buildpackage Sat Aug 22 03:44:07 1998
@@ -25,6 +25,8 @@
-si (default) src includes orig for rev. 0 or 1 } genchanges
-sa uploaded src always includes orig }
-sd uploaded src is diff and .dsc only }
+ -i[<regex>] ignore diffs of files matching regex
+ passed to dpkg-source, see dpkg-source --help
-nc do not clean source tree (implies -b)
-tc clean source tree when finished
-h print this message
@@ -35,6 +37,7 @@
pgpcommand=pgp
signsource='withecho signfile'
signchanges='withecho signfile'
+diffignore=''
cleansource=false
binarytarget=binary
sourcestyle=''
@@ -57,6 +60,7 @@
-si) sourcestyle=-si ;;
-sa) sourcestyle=-sa ;;
-sd) sourcestyle=-sd ;;
+ -i*) diffignore=$1;;
-tc) cleansource=true ;;
-nc) noclean=true; binaryonly=-b ;;
-b) binaryonly=-b ;;
@@ -113,7 +117,7 @@
withecho $rootcommand debian/rules clean
fi
if [ x$binaryonly = x ]; then
- cd ..; withecho dpkg-source -b "$dirn"; cd "$dirn"
+ cd ..; withecho dpkg-source $diffignore -b "$dirn"; cd "$dirn"
fi
withecho debian/rules build
withecho $rootcommand debian/rules $binarytarget
Reply to: