This is a patch to add a -I option to dpkg-source that makes it pass
--exclude to tar when creating a tarball. This is useful for excluding
CVS directories when building a native package from a cvs source tree.
dpkg-buildpackage is also modified to pass the -I on to dpkg-source.
I've included doc updates.

diff -ur orig/dpkg-1.9.20/scripts/dpkg-buildpackage.sh 
dpkg-1.9.20/scripts/dpkg-buildpackage.sh
--- orig/dpkg-1.9.20/scripts/dpkg-buildpackage.sh       Thu Jun 21 21:00:36 2001
+++ dpkg-1.9.20/scripts/dpkg-buildpackage.sh    Sat May 18 22:37:56 2002
@@ -41,8 +41,8 @@
          -h            print this message
          -W            Turn certain errors into warnings.      } passed to
          -E            When -W is turned on, -E turned it off. } dpkg-source
-         -i[<regex>]   ignore diffs of files matching regex } only passed
-                                                             to dpkg-source
+         -i[<regex>]   ignore diffs of files matching regex    } only passed
+         -I<filename>  filter out files when building tarballs } to dpkg-source
 END
 }
 
@@ -91,6 +91,7 @@
        -sa)    sourcestyle=-sa ;;
        -sd)    sourcestyle=-sd ;;
         -i*)    diffignore=$1;;
+       -I*)    tarignore=$1;;
        -tc)    cleansource=true ;;
        -t*)    targetgnusystem="$value" ;;          # Order DOES matter!
        -nc)    noclean=true; if [ -z "$binaryonly" ]; then binaryonly=-b; fi ;;
@@ -192,7 +193,7 @@
        withecho $rootcommand debian/rules clean
 fi
 if [ x$binaryonly = x ]; then
-       cd ..; withecho dpkg-source $passopts $diffignore -b "$dirn"; cd "$dirn"
+       cd ..; withecho dpkg-source $passopts $diffignore $tarignore -b 
"$dirn"; cd "$dirn"
 fi
 if [ x$sourceonly = x ]; then
        withecho debian/rules build 
diff -ur orig/dpkg-1.9.20/scripts/dpkg-source.1 
dpkg-1.9.20/scripts/dpkg-source.1
--- orig/dpkg-1.9.20/scripts/dpkg-source.1      Thu Jun 21 21:00:36 2001
+++ dpkg-1.9.20/scripts/dpkg-source.1   Sat May 18 22:38:45 2002
@@ -310,6 +310,12 @@
 unnecessarily included in every .diff.gz, unless you use the \fB-i\fR
 switch.
 .TP
+.B -I<filename>
+If this option is specified, the filename 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.
+.TP
 .BR -sa , -sp , -su , -sk , -sA , -sP , -sU , -sK , -ss " with " -b
 If
 .BR -sk " or " -sp
@@ -612,6 +618,10 @@
 for the host machine.
 .TP
 .B -i[<regexp>]
+Passed unchanged to
+.BR dpkg-source .
+.TP
+.B -I<filename>
 Passed unchanged to
 .BR dpkg-source .
 .TP
diff -ur orig/dpkg-1.9.20/scripts/dpkg-source.pl 
dpkg-1.9.20/scripts/dpkg-source.pl
--- orig/dpkg-1.9.20/scripts/dpkg-source.pl     Thu Jul  5 16:48:52 2001
+++ dpkg-1.9.20/scripts/dpkg-source.pl  Sat May 18 22:28:21 2002
@@ -45,6 +45,7 @@
                  -sa                 auto select orig source (-sA is default)
                  -i[<regexp>]        filter out files to ignore diffs of.
                                      Defaults to: '$diff_ignore_default_regexp'
+                 -I<filename>        filter out files when building tarballs.
                  -sk                 use packed orig source (unpack & keep)
                  -sp                 use packed orig source (unpack & remove)
                  -su                 use unpacked orig source (pack & keep)
@@ -96,6 +97,8 @@
         $remove{$1}= 1;
     } elsif (m/^-i(.*)$/) {
         $diff_ignore_regexp = $1 ? $1 : $diff_ignore_default_regexp;
+    } elsif (m/^-I(.+)$/) {
+        $tar_ignore_file = "--exclude=$1";
     } elsif (m/^-V(\w[-:0-9A-Za-z]*)[=:]/) {
         $substvar{$1}= $';
     } elsif (m/^-T/) {
@@ -303,7 +306,7 @@
             chdir($tardirbase) || &syserr("chdir to above (orig) source 
$tardirbase");
             open(STDOUT,">&GZIP") || &syserr("reopen gzip for tar");
             # FIXME: put `--' argument back when tar is fixed
-            exec('tar','-cf','-',$tardirname); &syserr("exec tar");
+            exec('tar',$tar_ignore_file,'-cf','-',$tardirname); &syserr("exec 
tar");
         }
         close(GZIP);
         &reapgzip;


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]


Reply via email to