Package: dpkg-dev
Version: dpkg_1.17.10
Severity: wishlist
Tags: patch
User: helm...@debian.org
Usertags: rebootstrap

Dear dpkg maintainers,

Let us revisit a less intrusive variant of #677474. My request is to
enable interpolation of ${source:Version} in Build-Depends and friends.
Of course this arises from a practical need:

Quite a few packages use the binaries created in the process of building
the package. A primary example affecting 200 packages is help2man.
Unfortunately those binaries are not always executable. Most notably
they are not executable when cross compiling. Rather than resorting to
ugly hacks it would be nice to just use the build version of those tools
to generate manual pages or facilitate other tasks. In most cases that
would amount to:

Source: foo
Build-Depends: foo <profile.cross>

In many cases this would be correct, but ideally we want to ensure that
the manual pages created match the source. So the dependency needs to be
rather stricter:

Build-Depends: foo (= ${source:Version}) <profile.cross>

This use of substvars would not pose any problems for regular
build-ability of the package, because the dependency is not evaluated in
the absence of the cross profile.

Thanks for considering

Helmut
diff -Nru dpkg-1.17.10/debian/changelog dpkg-1.17.10+nmu1/debian/changelog
--- dpkg-1.17.10/debian/changelog       2014-06-05 21:05:39.000000000 +0200
+++ dpkg-1.17.10+nmu1/debian/changelog  2014-06-12 22:26:03.000000000 +0200
@@ -1,3 +1,10 @@
+dpkg (1.17.10+nmu1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Support interpolating ${source:Version} in Build-Depends. Closes: #-1
+
+ -- Helmut Grohne <hel...@subdivi.de>  Thu, 12 Jun 2014 22:25:43 +0200
+
 dpkg (1.17.10) unstable; urgency=medium
 
   [ Guillem Jover ]
diff -Nru dpkg-1.17.10/scripts/dpkg-source.pl 
dpkg-1.17.10+nmu1/scripts/dpkg-source.pl
--- dpkg-1.17.10/scripts/dpkg-source.pl 2014-05-30 18:30:50.000000000 +0200
+++ dpkg-1.17.10+nmu1/scripts/dpkg-source.pl    2014-06-12 22:25:39.000000000 
+0200
@@ -341,6 +341,7 @@
            my ($ok, $error) = version_check($v);
             error($error) unless $ok;
            $fields->{$_} = $v;
+           $substvars->set_version_substvars($v);
        } elsif (m/^Binary-Only$/) {
            error(_g('building source for a binary-only release'))
                if $v eq 'yes' and $options{opmode} eq '-b';

Reply via email to