Bug#127494: [checks/cruft] precompiled binaries in the source
Raphael Geissert <atomo64@gmail.com> writes:
> In order to implement this check it is necessary the output of file, but
> it is not generated by the collections/ scripts for source packages. The
> script that takes care of this is file-info, but depends on the
> availability of a files index. This last file is generated by the
> unpack-binpkg-l1 script by modifying a little bit the output of
> dpkg-deb's call to tar.
>
> Trying to generate an index file for source packages is a bit tricky, as
> it can't be done via dpkg as there's no method that prints the files in
> the orig tarball. I tried to simulate the output of tar, but either I'm
> too sleepy or there's no way to do it via the standard options of ls or
> find.
>
> The file index is necessary for #512265 and #472219 too.
>
> Any hints?
Symlinks to the source package files are created in the lab by
unpack-srcpkg-l1:
# Install symbolic links to source package files
my $dir = dirname($file);
my $name = basename($file);
symlink($file,"$base_dir/dsc") or fail("cannot symlink dsc file: $!");
for my $fs (split(/\n/,$data->{'files'})) {
next if $fs =~ /^\s*$/o;
my @t = split(/\s+/o,$fs);
symlink("$dir/$t[2]","$base_dir/$t[2]") or fail("cannot symlink file $t[2]: $!");
}
The only tricky part is figuring out the name of the *.orig.tar.gz or
*.tar.gz. I think in practice we enforce the file naming convention, but
Policy doesn't require that particular file name pattern be used so far as
I can tell.
It looks like dpkg-source scans the Files section of the *.dsc file for
any file matching:
/^(?:\Q$basename\E\.orig|\Q$basenamerev\E)\.tar\.gz$/
and treats that as the source tarball. $basename is the value of the
Source control field, "_", and the value of the Version control field
without the Debian revision. $basenamerev is the same with the Debian
revision. If we do the same thing, we should be able to locate the
upstream *.orig.tar.gz.
--
Russ Allbery (rra@debian.org) <http://www.eyrie.org/~eagle/>
Reply to: