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

Bug#227169: dpkg-dev: dpkg-source(1) man page is outdated/uprecise about default for -i



Package: dpkg-dev
Version: 1.10.18
Severity: minor
Tags: patch

I now localy manage debian packages using subversion. dpkg-source failed
because of a binary file in an .svn package. I then looked up the 
dpkg-source(1) manpage and discovered the -i option. But Subversion (.svn)
wasn't mentioned. But this is just an uderstatement.

I then downloaded the the source package and looked into dpkg-source.pl to
determine what it supports. Well, the regexp was butt ugly, and I had to
split it to understand what it did. If I understand it correctly, it wasn't
perfect, but grew on demand. So I did a little bit of hacking, and here's
what resulted:

  * Better ignore filter for dpkg-source:
    - Updated manpage
    - Cleaner code in dpkg-source.pl
    - Better description of default ignores in --help

I've attached the patch to dpkg-source.pl and dpkg-source.1.

Simon


-- System Information:
Debian Release: testing/unstable
Architecture: i386
Kernel: Linux fried 2.4.23-1-386 #1 Sun Nov 30 16:49:14 EST 2003 i586
Locale: LANG=C, LC_CTYPE=C

Versions of packages dpkg-dev depends on:
ii  binutils                   2.14.90.0.7-3 The GNU assembler, linker and bina
ii  cpio                       2.5-1.1       GNU cpio -- a program to manage ar
ii  make                       3.80-4        The GNU version of the "make" util
ii  patch                      2.5.9-1       Apply a diff file to an original
ii  perl [perl5]               5.8.2-2       Larry Wall's Practical Extraction 
ii  perl-modules               5.8.2-2       Core Perl modules.

-- no debconf information

Index: dpkg-source.1
===================================================================
--- dpkg-source.1	(revision 2)
+++ dpkg-source.1	(working copy)
@@ -293,9 +293,9 @@
 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 DEADJOEs.
+with a default that will filter out ".#*", "*~", ".*.swp", "DEADJOE"
+and ".cvsignore" files and "CVS", "RCS", ".deps", "{arch}", ".arch-ids",
+and ".svn" directories with all the files in them.
 
 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
Index: dpkg-source.pl
===================================================================
--- dpkg-source.pl	(revision 2)
+++ dpkg-source.pl	(working copy)
@@ -8,8 +8,13 @@
 my %notfileobject;
 my $fn;
 
-$diff_ignore_default_regexp = '(?:^|/)\.#.*$|(?:^|/).*~$|(?:^|/)\..*\.swp|DEADJOE|\.cvsignore|(?:/(?:CVS|RCS|\.deps|\{arch\}|\.arch-ids|\.svn))(?:$|/.*$)';
+my @ignore_files = ( '\.#.*', '.*~', '\..*\.swp', 'DEADJOE', '\.cvsignore' );
+my $ignore_files = join("', '", @ignore_files);
+my @ignore_dirs = ( 'CVS', 'RCS', '\.deps', '\{arch\}', '\.arch-ids', '\.svn' );
+my $ignore_dirs = join("', '", @ignore_dirs);
 
+$diff_ignore_default_regexp = '(?:^|/)(?:' . join('|', @ignore_files) . ')$|(?:^|/)(?:' . join('|', @ignore_dirs) . ')(?:$|/)';
+
 $sourcestyle = 'X';
 $dscformat = "1.0";
 
@@ -53,7 +58,9 @@
                  -E                  When -W is enabled, -E disables it.
                  -sa                 auto select orig source (-sA is default)
                  -i[<regexp>]        filter out files to ignore diffs of.
-                                     Defaults to: '$diff_ignore_default_regexp'
+                                     '$ignore_files' files and
+                                     '$ignore_dirs' dirs
+                                     are filtered by default
                  -I<filename>        filter out files when building tarballs.
                  -sk                 use packed orig source (unpack & keep)
                  -sp                 use packed orig source (unpack & remove)

Reply to: