Bug#433477: dpkg-gencontrol -v fails to set ${binary:Version}
Here's one scenario where I use -v and binary:Version. I have a library, libscarlet, that I build for both Sarge and Etch. To be able to tell the two versions apart, I append +dv3.1 or +dv4.0 to the version of the binary package. (dv stands for Debian Version.) I build the following regular, debug, and developer package files: libscarlet0_1.6.0+dv3.1_i386.deb libscarlet0-dbg_1.6.0+dv3.1_i386.deb libscarlet-dev_1.6.0+dv3.1_i386.deb libscarlet0_1.6.0+dv4.0_i386.deb libscarlet0-dbg_1.6.0+dv4.0_i386.deb libscarlet-dev_1.6.0+dv4.0_i386.deb I build both versions of the packages from the same source. The binary version is set with a pbuilder hook that edits the debian/rules file to pass a -v flag to dh_gencontrol (which passes it to dpkg-gencontrol). Here is my hook script: #! /bin/sh -e # A50add-debianversion, by Stephen Gildea. # pbuilder type A hook, runs before dpkg-buildpackage. # Purpose: add the version of this Debian release to the binary # package version. # (This addition lets us build binaries for # more than one Debian release from the same sources.) debian_release=$(cat etc/debian_version) cd tmp/buildd/*/ source_version=$(dpkg-parsechangelog | sed -n '/^Version: /s/Version: //p') total_vers=$source_version+dv$debian_release echo Will build binaries as version $total_vers sed -i~ /^ dh_gencontrol[^-]*\$/s/dh_gencontrol/ -- -v'$total_vers'/ \ debian/rules The dpkg support for different source and binary versions is great, and it accurately records that my binary packages come from the same source. In particular, my binary package control files correctly have the following lines: Version: 1.6.0+dv4.0 Source: libscarlet (1.6.0) I would like to specify the dependencies of the dbg and dev packages with the following simple declarations in the control file: Package: libscarlet0-dbg Depends: libscarlet0 (= ${binary:Version}) Package: libscarlet-dev Depends: libscarlet0 (= ${binary:Version}) ... and this is the only part of my whole setup that doesn't work. ${binary:Version} is 1.6.0, but it needs to be 1.6.0+dv4.0. Thank you for your attention to this issue. Stephen -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#433477: dpkg-gencontrol -v fails to set ${binary:Version}
On Tue, 17 Jul 2007, Stephen Gildea wrote: When using the -v flag of dpkg-gencontrol to set the version number of the binary package being built, the subst variable binary:Version fails to be set correctly. Instead of getting the value specified with the -v, it gets the version of the source. It is useful to have an accurate binary:Version when you want to have the -dev package depend on the library (= ${binary:Version}). It's not necessarily as evident as you make it look like. Usage of -v is only required when the version of the binary package doesn't match the version of the source package... and when you use ${binary:Version} you want to refer to the version of another binary package (ie not the one currently handled by dpkg-gencontrol) and why would you assume that the other binary package shares the same version than the package currently treated ? It might well be that the other binary package shares the same version as the source package. Though, given the use cases we have for those variables and given the official definition of that variable in deb-substvars(5), I think this change should probably be done. Other opinions are welcome of course... Can you tell us for which package you needed this change? Cheers, -- Raphaël Hertzog Le best-seller français mis à jour pour Debian Etch : http://www.ouaza.com/livre/admin-debian/
Bug#433477: dpkg-gencontrol -v fails to set ${binary:Version}
Package: dpkg-dev Version: 1.14.5 Tags: patch When using the -v flag of dpkg-gencontrol to set the version number of the binary package being built, the subst variable binary:Version fails to be set correctly. Instead of getting the value specified with the -v, it gets the version of the source. It is useful to have an accurate binary:Version when you want to have the -dev package depend on the library (= ${binary:Version}). The following patch fixes this little problem. Stephen *** dpkg-1.14.5/scripts/dpkg-gencontrol.pl Tue Jun 19 08:11:37 2007 --- scripts/dpkg-gencontrol.pl Mon Jul 16 16:30:57 2007 *** *** 215,220 --- 215,222 $f{'Version'} = $forceversion if defined($forceversion); init_substvars; + $substvar{'binary:Version'} = $forceversion if defined($forceversion); + init_substvar_arch(); for $_ (keys %fi) { *** dpkg-1.14.5/scripts/controllib.pl Tue Jun 19 08:11:37 2007 --- scripts/controllib.pl Mon Jul 16 16:31:49 2007 *** *** 545,550 --- 545,551 # XXX: Source-Version is now deprecated, remove in the future. $substvar{'Source-Version'}= $fi{L Version}; + # binary:Version is overridden by dpkg-gencontrol if passed -v flag. $substvar{'binary:Version'} = $fi{L Version}; $substvar{'source:Version'} = $fi{L Version}; $substvar{'source:Version'} =~ s/\+b[0-9]+$//; -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]