On Fri, 11 Dec 2009 11:10:48 +0100 Raphael Hertzog <hert...@debian.org> wrote:
> On Fri, 11 Dec 2009, Neil Williams wrote: > > That makes some very large assumptions about directory layout for > > something as simple as querying/verifying a source format string. > > Well, it's the same code than -b except we stop right after > having selected the target format. So the docs should describe it as: When using --print-format, dpkg-source needs to be run in the same directory as any .orig.tar.gz|bz2 and also given the top level source directory (where it can find ./debian/changelog). e.g. after unpacking with 'dpkg-source -x foo_1.2.3-1.dsc', the command would be 'dpkg-source --print-format foo-1.2.3/', without changing the current working directory. This gets over the point that dpkg-source --print-format actually requires the user to think about two directories - the current one which dpkg-source uses to find the orig tarball and the one specified which dpkg-source uses to find debian/changelog. In most programs, specifying a directory leads the user to think that all operations would use that directory and that the current working directory shouldn't matter. e.g. $ ls /path/ doesn't care about `pwd` unless pwd doesn't exist, equally dpkg -x /path/foo /tmp/ doesn't care about pwd at all. IMHO it would be better if --print-format understood the existence of the foo-1.2.3/ directory that the -x option to dpkg-source may well have created and handled it transparently. That way, --print-format could be given a directory in which to find the source (as unpacked by apt-get source) and work out the rest itself. > > Why does --print-format need to locate the .orig.tar.gz|bz2 anyway? > > Because currently, if you don't have a .orig.tar file it will > fallback to creating a "native" package in "1.0" format. IMHO dpkg-source --print-format should explain this fallback by putting a message on STDERR that "the orig tarball has not been found, maybe dpkg-source was run from the wrong directory", especially if debian/source/format exists and contains something matching /3\.0.*/ (or anything other than 1.0). -- Neil Williams ============= http://www.data-freedom.org/ http://www.linux.codehelp.co.uk/ http://e-mail.is-not-s.ms/
pgpBKYIWJNMNp.pgp
Description: PGP signature