[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#26024: dpkg-dev: [patch] files to ignore diffs of...



Package: dpkg-dev
Version: 1.4.0.27

 patch to `dpkg-source' and `dpkg-buildpackage' will eliminate some of
 it.  It causes it to ignore diffs between the files in CVS/, RCS/
 directories, or any other files the maintainer sees fit.

 I'm putting together a guile1.3 package, and am using anon CVS to
 track the upstream sources.  In order to create an .orig.tar.gz, I
 use this rule:

orig-tar:
	dh_testdir
	set -e;	cd ..;				\
	 snap_dir=guile-core-`date +%Y.%m.%d`;	\
	 snap_orig=guile-core_`date +%Y.%m.%d`.orig.tar.gz; \
	 export snap_dir snap_orig;		\
	 cvs -z9 checkout -d $$snap_dir guile-core; \
	 tar czf $$snap_orig $$snap_dir

 ... but when I run `dpkg-buildpackage', it puts the CVS/* files into
 the diff, as well as my debian/RCS/*,v files.  It also includes all
 of the libguile/.deps files, which are not required either, since
 they are automaticly generated.

 cd guile-core; \
 dpkg-buildpackage -rsudo \
   -i '(?:/CVS$|/RCS$|/CVS/.*$|/RCS/.*$|/\.deps$|/.deps/.*$)'


--- dpkg-source	1998/08/21 12:00:13	1.1
+++ dpkg-source	1998/08/21 12:34:31
@@ -8,6 +8,8 @@
 my %notfileobject;
 my $fn;
 
+$diff_ignore_regexp = '(?:/CVS$|/RCS$|/CVS/.*$|/RCS/.*$)';
+
 $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>         files to ignore diffs of.
+                    Defaults to: '$diff_ignore_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 = shift(@ARGV);
     } 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-buildpackage.orig	Mon Jul 27 12:21:28 1998
+++ dpkg-buildpackage	Fri Aug 21 05:42:56 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>    regex matching files to ignore diffs of,
+                         passed to dpkg-source
          -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="-i $2"; shift ;;
 	-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


-- System Information
Debian Release: 2.0
Kernel Version: Linux bittersweet 2.0.35 #12 Fri Aug 14 01:57:33 PDT 1998 i586 unknown

Versions of the packages dpkg-dev depends on:


Reply to: