[Pbuilder-maint] pbuilder CVS update: pbuildd/hooks A50pb_ver
pbuilder CVS Commit
pbuilder-maint at lists.alioth.debian.org
Mon Apr 3 09:01:30 UTC 2006
User: schepler
Date: 06/04/03 09:01:30
Added: hooks A50pb_ver
Log:
Initial check in of pbuildd scripts.
Revision Changes Path
1.1 pbuildd/hooks/A50pb_ver
CVSWEB Options: -------------------
CVSWeb: Annotate this file: http://cvs.alioth.debian.org/cgi-bin/cvsweb.cgi/pbuilder/pbuildd/hooks/A50pb_ver?annotate=1.1&cvsroot=
CVSWeb: View this file: http://cvs.alioth.debian.org/cgi-bin/cvsweb.cgi/pbuilder/pbuildd/hooks/A50pb_ver?rev=1.1&content-type=text/x-cvsweb-markup&cvsroot=
-----------------------------------
Index: A50pb_ver
===================================================================
#!/usr/bin/perl
# Build everything with a version of eg 2.0-1+pb1 to help
# distinguishing from the official packages (this is most useful if
# you're including /var/cache/pbuildd/pool in apt's sources.list)
chdir("/tmp/buildd");
@dscs = glob("*.dsc");
if ($#dscs != 0) { die("Need exactly one dsc file in /tmp/buildd"); }
$dscbase = $dscs[0]; $dscbase =~ s/\.dsc$//;
$dscbase =~ /^((lib)?.)/; $dir = $1;
$dscbase =~ /^([^_]*)_([^_]*)$/; $pkgname = $1; $pkgver = $2;
# Search for previously built versions with this exact Debian version.
$prevPbVer = 0;
foreach $sect ('pool', 'old-pool', 'partial') {
foreach $prevdsc (glob "/var/cache/pbuildd/$sect/$dir/$pkgname/$dscbase+pb*_*.changes") {
$prevdsc =~ /\+pb([0-9]*)_[a-z0-9]*\.changes$/ || next;
if ($1 > $prevPbVer) { $prevPbVer = $1; }
}
}
# Now put the next available pb<n> version into debian/changelog.
chdir(glob "*/");
$pbVer = $prevPbVer + 1;
open(CHANGELOG, ">debian/changelog.new");
open(OLDCHANGELOG, "<debian/changelog");
# Get the correct version from the first line of debian/changelog
# (in case it includes an epoch).
$_ = <OLDCHANGELOG>; /^\Q$pkgname\E \(([^()]*)\)/; $pkgver = $1;
print CHANGELOG "$pkgname (${pkgver}+pb${pbVer}) pbuildd; urgency=low\n\n";
print CHANGELOG " * Local build using pbuildd.\n\n";
$hostname = `hostname -f`; chomp $hostname;
print CHANGELOG " -- Pbuildd daemon <pbuildd\@${hostname}> ",
`822-date`, "\n", $_;
while ($_ = <OLDCHANGELOG>) { print CHANGELOG; }
close(OLDCHANGELOG); close(CHANGELOG);
# Copy owner and permissions of old changelog to new
system 'chown', '--reference=debian/changelog', 'debian/changelog.new';
system 'chmod', '--reference=debian/changelog', 'debian/changelog.new';
system 'mv', '-f', 'debian/changelog.new', 'debian/changelog';
# (use mv -f instead of rename in case debian/changelog has
# strange permissions)
exit 0;
More information about the Pbuilder-maint
mailing list