From: Adam Heath Date: Sat, 25 May 2002 02:57:14 +0000 (+0000) Subject: Add -I to dpkg-buildpackage and dpkg-source, to excludes files X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9bf87e246a67f522403f26454ce5ed028b967be8;p=dpkg Add -I to dpkg-buildpackage and dpkg-source, to excludes files from tar, when building a native package. --- diff --git a/ChangeLog b/ChangeLog index b8e08825..ab954cad 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Fri May 24 22:00:01 CDT 2002 Adam Heath + + * scripts/dpkg-buildpackage.sh, scripts/dpkg-source.pl, + scripts/dpkg-source.1: Add -I 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 * scripts/controllib.pl: Properly count recursive expansion of variables, diff --git a/debian/changelog b/debian/changelog index 465fa371..bfc8657a 100644 --- a/debian/changelog +++ b/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 to dpkg-buildpackage and dpkg-source, to excludes + files from tar, when building a native package. Closes: Bug#75947. -- Wichert Akkerman Mon, 20 Aug 2001 14:54:38 +0200 diff --git a/scripts/dpkg-buildpackage.sh b/scripts/dpkg-buildpackage.sh index 5cd2da32..a85dffa3 100755 --- a/scripts/dpkg-buildpackage.sh +++ b/scripts/dpkg-buildpackage.sh @@ -41,8 +41,8 @@ Options: -r -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[] ignore diffs of files matching regex } only passed - to dpkg-source + -i[] ignore diffs of files matching regex } only passed + -I 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 diff --git a/scripts/dpkg-source.1 b/scripts/dpkg-source.1 index 69f878b9..c0abc125 100644 --- a/scripts/dpkg-source.1 +++ b/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 +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 +Passed unchanged to +.BR dpkg-source . May be repeated multiple times. +.TP .B -D Check build dependencies and conflicts; abort if unsatisfied. .TP diff --git a/scripts/dpkg-source.pl b/scripts/dpkg-source.pl index 967c2bc8..57f15be8 100755 --- a/scripts/dpkg-source.pl +++ b/scripts/dpkg-source.pl @@ -54,6 +54,7 @@ Build options: -c get control info from this file -sa auto select orig source (-sA is default) -i[] filter out files to ignore diffs of. Defaults to: '$diff_ignore_default_regexp' + -I 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;