Hi, On Thu, 30 Jun 2011, Joachim Breitner wrote: > and indeed, dpkg-source --help lists a lattern that should ignore the control > file. Is something broken here or am I mis-reading the docs?
It was supposed to be fixed with this commit: commit 3525f79792cff51757d99d45f51c96a15e6fa779 Author: Raphael Hertzog <[email protected]> Date: Sun Apr 19 20:08:44 2009 +0200 dpkg-source: don't complain on binary files that are ignored To avoid mistakes with "3.0 (quilt)" source packages, dpkg-source fails if it finds binary files that have not been whitelisted in the debian directory. Unfortunately it also fails on binary files that are ignored and that will not be included in the debian tarball. This commit fixes that although not completely. The exclude patterns passed to tar --exclude are used to match filenames and also full path names inside the tarball. This commit only adds support for simple filename match. It is enough for all realistic cases. which then got improved by this one: commit 1731ce5cc233cd01896298d7e4395bf0042959bf Author: Raphaël Hertzog <[email protected]> Date: Thu Nov 5 21:49:08 2009 +0100 Dpkg::Source::Package::V2::do_build(): improve matching of ignored files Modify logic to also match ignored files based on their relative path inside the source package (and not only on their filename). It looks like it's not entirely working because the glob() is not run from the correct directory. Probably because of this change: commit 6f6814491f0240a4de97f22e60661489bb36f914 Author: Raphaël Hertzog <[email protected]> Date: Thu Nov 5 21:12:15 2009 +0100 Dpkg::Source::Package::V2:do_build(): fix binary file check The find() call that is supposed to look for binary files in the debian sub-directory was missing the no_chdir option and due to this the File::Spec->abs2rel() call (inside the wanted function) was returning an invalid value when find() changed the current directory (since its second parameter is only valid while being in the current directory). The parameter got lost by mistake in 3525f79792cff51757d99d45f51c96a15e6fa779 and it was present in lenny's version. I have committed the attached patch in my git repo. It seems to work for me. Hopefully it doesn't introduce any other weirdness. Please confirm me if it works for you. Cheers, -- Raphaël Hertzog ◈ Debian Developer Follow my Debian News ▶ http://RaphaelHertzog.com (English) ▶ http://RaphaelHertzog.fr (Français)
commit 3e16ef1747666f7f2aaf3b01f96d93ee9129c98a Author: Raphaël Hertzog <[email protected]> Date: Thu Jun 30 14:08:44 2011 +0200 dpkg-source: improve the logic to identify ignored files The list of ignored files was only generated by expanding the patterns relative to the current directory (which usually is the directory above the source package). Instead what we want is to expand them at the top-level directory of the source package and at the directory being inspected. Reported-by: Joachim Breitner <[email protected]> diff --git a/scripts/Dpkg/Source/Package/V2.pm b/scripts/Dpkg/Source/Package/V2.pm index 534df27..437def7 100644 --- a/scripts/Dpkg/Source/Package/V2.pm +++ b/scripts/Dpkg/Source/Package/V2.pm @@ -417,9 +417,15 @@ sub do_build { # tarball due to ignores. my %exclude; my $reldir = File::Spec->abs2rel($File::Find::dir, $dir); - foreach my $fn (glob($tar_ignore_glob)) { - $exclude{$fn} = 1; - } + my $cwd = getcwd(); + # Apply the pattern both from the top dir and from the inspected dir + chdir($dir) || syserr(_g("unable to chdir to `%s'"), $dir); + $exclude{$_} = 1 foreach glob($tar_ignore_glob); + chdir($cwd) || syserr(_g("unable to chdir to `%s'"), $cwd); + chdir($File::Find::dir) || + syserr(_g("unable to chdir to `%s'"), $File::Find::dir); + $exclude{$_} = 1 foreach glob($tar_ignore_glob); + chdir($cwd) || syserr(_g("unable to chdir to `%s'"), $cwd); my @result; foreach my $fn (@_) { unless (exists $exclude{$fn} or exists $exclude{"$reldir/$fn"}) {

