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

Add -I<filename> to dpkg-buildpackage and dpkg-source, to excludes files
from tar, when building a native package.

Adam Heath лет назад: 24
Родитель
Сommit
9bf87e246a
5 измененных файлов с 28 добавлено и 4 удалено
  1. 7 0
      ChangeLog
  2. 2 0
      debian/changelog
  3. 4 3
      scripts/dpkg-buildpackage.sh
  4. 11 0
      scripts/dpkg-source.1
  5. 4 1
      scripts/dpkg-source.pl

+ 7 - 0
ChangeLog

@@ -1,3 +1,10 @@
+Fri May 24 22:00:01 CDT 2002 Adam Heath <doogie@debian.org>
+
+  * scripts/dpkg-buildpackage.sh, scripts/dpkg-source.pl,
+    scripts/dpkg-source.1: Add -I<filename> to dpkg-buildpackage and
+    dpkg-source, to excludes files from tar, when building a native
+    package.
+
 Fri May 24 21:49:52 CDT 2002 Adam Heath <doogie@debian.org>
 
   * scripts/controllib.pl: Properly count recursive expansion of variables,

+ 2 - 0
debian/changelog

@@ -105,6 +105,8 @@ dpkg (1.10) unstable; urgency=low
     Closes: Bug#138013.
   * Properly count recursive expansion of variables, instead of just
     counting all variable expansions.  Closes: #144121.
+  * Add -I<filename> to dpkg-buildpackage and dpkg-source, to excludes
+    files from tar, when building a native package.  Closes: Bug#75947.
 
  -- Wichert Akkerman <wakkerma@debian.org>  Mon, 20 Aug 2001 14:54:38 +0200
 

+ 4 - 3
scripts/dpkg-buildpackage.sh

@@ -41,8 +41,8 @@ Options: -r<gain-root-command>
          -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 @@ do
 	-sa)	sourcestyle=-sa ;;
 	-sd)	sourcestyle=-sd ;;
         -i*)    diffignore=$1;;
+	-I*)	tarignore="$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 @@ if [ x$noclean != xtrue ]; then
 	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 

+ 11 - 0
scripts/dpkg-source.1

@@ -309,6 +309,13 @@ 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
+.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. The option may be repeated multiple times to list multiple
+filenames to exclude.
+.TP
 .BR -sa , -sp , -su , -sk , -sA , -sP , -sU , -sK , -ss " with " -b
 If
 .BR -sk " or " -sp
@@ -614,6 +621,10 @@ for the host machine.
 Passed unchanged to
 .BR dpkg-source .
 .TP
+.B -I<filename>
+Passed unchanged to
+.BR dpkg-source . May be repeated multiple times.
+.TP
 .B -D
 Check build dependencies and conflicts; abort if unsatisfied.
 .TP

+ 4 - 1
scripts/dpkg-source.pl

@@ -54,6 +54,7 @@ Build options:   -c<controlfile>     get control info from this file
                  -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)
@@ -105,6 +106,8 @@ while (@ARGV && $ARGV[0] =~ m/^-/) {
         $remove{$1}= 1;
     } elsif (m/^-i(.*)$/) {
         $diff_ignore_regexp = $1 ? $1 : $diff_ignore_default_regexp;
+    } elsif (m/^-I(.+)$/) {
+        push @tar_ignore, "--exclude=$1";
     } elsif (m/^-V(\w[-:0-9A-Za-z]*)[=:]/) {
         $substvar{$1}= $';
     } elsif (m/^-T/) {
@@ -312,7 +315,7 @@ if ($opmode eq 'build') {
             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,'-cf','-',$tardirname); &syserr("exec tar");
         }
         close(GZIP);
         &reapgzip;