Hello world, Background: every now and then, libraries get updated or bugs in gcc get fixed, and packages get reuploaded without any source changes, and with their debian revision bumped by 0.0.1. At the moment, there's no obvious way of automatically associating these things with their source. What would, IMO, be nice is having: Package: foo Version: 1.2-2.0.1 ... source: foo (1.2-2) appear in Packages files. I *believe* this can be obtained by having dpkg-gencontrol generate a DEBIAN/control file including: Package: foo Version: 1.2-2.0.1 ... Source: foo Source-Version: 1.2-2 . The real question is when dpkg-gencontrol should do this. One way, would be to change the various dpkg scripts to treat a changelog version of 1.2-2.0.1 as though it were 1.2-2 for the source, and 1.2-2.0.1 for any binaries. I think the easiest way of getting this to happen would be just making a change to dpkg-genchanges and dpkg-gencontrol like: diff -ur ../dpkg-1.4.1.11-real/scripts/dpkg-genchanges.pl scripts/dpkg-genchange s.pl --- ../dpkg-1.4.1.11-real/scripts/dpkg-genchanges.pl Wed May 26 23:38:15 1999 +++ scripts/dpkg-genchanges.pl Sat Dec 11 17:00:55 1999 @@ -214,6 +214,11 @@ " file but $f2pri{$f} in files list"); } +if ($f{'Version'} =~ m/^(.*-[0-9]+)\.([0-9]+)\.[0-9]+$/) { + $f{'Version'}= $1; + $f{'Version'}.= ".$2" if ($2 ne "0"); +} + if (!$binaryonly) { $version= $f{'Version'}; $origversion= $version; $origversion =~ s/-[^-]+$//; diff -ur ../dpkg-1.4.1.11-real/scripts/dpkg-gencontrol.pl scripts/dpkg-gencontro l.pl --- ../dpkg-1.4.1.11-real/scripts/dpkg-gencontrol.pl Tue Jul 6 04:18:22 1999 +++ scripts/dpkg-gencontrol.pl Sat Dec 11 16:43:51 1999 @@ -154,6 +154,10 @@ &setsourcepackage; } elsif (m/^Version$/) { $sourceversion= $v; + if ($sourceversion =~ m/^(.*-[0-9]+)\.([0-9]+)\.[0-9]+$/) { + $sourceversion= $1; + $sourceversion.= ".$2" if ($2 ne "0"); + } $f{$_}= $v unless length($forceversion); } elsif (m/^(Maintainer|Changes|Urgency|Distribution|Date|Closes)$/) { } elsif (s/^X[CS]*B[CS]*-//i) { Another way of doing would be to add a --recompile=n option to debuild, and have that be passed down to dpkg-gencontrol, so that dpkg-gencontrol behaves as though `-vXYX-A.B.n' option is added to all the binary packages. Having dpkg-buildpackage set an environment variable DEB_RECOMPILE=n and adding something like: if (defined $ENV{"DEB_RECOMPILE"}) { $n = $ENV{"DEB_RECOMPILE"}; if ($f{'Version'} =~ m/^.*-[0-9]$/) { $f{'Version'}.= ".0.$n"; } elsif ($f{'Version'} =~ m/^.*-[0-9]\.[0-9]$/ { $f{'Version'}.= ".$n"; } else { # Debian native package? $f{'Version'}.= ".recompile.$n"; } } after: $f{'Version'}= $forceversion if length($forceversion); in dpkg-gencontrol. This would change the way recompiles are done, in that instead of changing the changelog and recompiling, you'd add a different argument to debuild. Also, there doesn't seem to be any predictable way of discerning recompiles on Debian-native packages. So, could something to this effect be applied to dpkg soonish, please? Cheers, aj -- Anthony Towns <aj@humbug.org.au> <http://azure.humbug.org.au/~aj/> I don't speak for anyone save myself. GPG encrypted mail preferred. ``The thing is: trying to be too generic is EVIL. It's stupid, it results in slower code, and it results in more bugs.'' -- Linus Torvalds
Attachment:
pgp3M2UYMj3Q3.pgp
Description: PGP signature