r3008 - people/goneri/SvnBuildStat-WWW/script
Gonéri Le Bouder
goneri-guest at alioth.debian.org
Wed Jun 20 11:46:51 UTC 2007
Author: goneri-guest
Date: 2007-06-20 11:46:51 +0000 (Wed, 20 Jun 2007)
New Revision: 3008
Modified:
people/goneri/SvnBuildStat-WWW/script/svnbuildstat_agent.pl
Log:
native package support
Modified: people/goneri/SvnBuildStat-WWW/script/svnbuildstat_agent.pl
===================================================================
--- people/goneri/SvnBuildStat-WWW/script/svnbuildstat_agent.pl 2007-06-20 11:43:34 UTC (rev 3007)
+++ people/goneri/SvnBuildStat-WWW/script/svnbuildstat_agent.pl 2007-06-20 11:46:51 UTC (rev 3008)
@@ -18,6 +18,7 @@
my $RELEASE = "0.0.1";
my $hostname = hostname();
my $distro = "sid";
+my $isnative;
if ($config->agent_vardir !~ /\/.+/) {
die "vardir not correclty set in the [agent] section";
@@ -75,14 +76,13 @@
my $tarballuri = $tobuild[1];
my $tarball = $tobuild[2];
my $svnbase = $tobuild[3];
-
-if (!$package||!$svnbase||!$tarballuri) {
+$isnative = 1 unless ($tarballuri || $tarball);
+if (!$package||!$svnbase) {
print "Failed to parse the package information from ".
$config->agent_source."/".$report{'arch'}."\n";
exit 1
}
my $t = $config->agent_debmirror;
-$tarballuri =~ s/\@DEBMIRROR\@/$t/;
my $pdebuildparam = "--mirror ".$config->agent_debmirror." --buildplace $pbuilderplace --distribution $distro --basetgz $pbuilderplace/$distro.tar.gz";
`/usr/sbin/pbuilder update $pdebuildparam >$reportarea/pbuilder-update.log 2>&1`;
if (($? >> 8)!=0){
@@ -93,11 +93,21 @@
}
}
+foreach (`LC_ALL=C svn info $svnbase`) {
+ $report{'svn_rev'} = $1 if /Last Changed Rev:\ (\d+)/;
+}
`svn co $svnbase $workplace >$reportarea/svn.log 2>&1`;
my @tmp = `cd $workplace ; svn log -q --limit 1`;
-chomp($report{'svn_rev'} = $tmp[1]);
-$report{'svn_rev'} =~ s/^r(\d+)\ .*/$1/;
+foreach (`LC_ALL=C svn info $svnbase`) {
+ if (/Last Changed Rev:\ (\d+)/) {
+ if( $report{'svn_rev'} ne $1 ) {
+ print "HACK: svn info> rev changed during checkout\n";
+ exit;
+ }
+ }
+}
+
my $ftp = Net::FTP->new($config->agent_ftphost, Debug => 0) or die "Cannot connect
to ".$config->agent_ftphost.": $@";
@@ -124,14 +134,25 @@
}
}
+
+ if ($isnative) {
+ $report{'download'} = "native";
+ } else {
+ $tarballuri =~ s/\@DEBMIRROR\@/$t/;
`cd $tarballsplace ; wget -O $tarball -c \"$tarballuri\" >$reportarea/wget.log 2>&1`;
- if (! -f $tarballsplace."/".$tarball) {
- print "download nok\n";
+ `tar tf $tarballsplace/$tarball`;
+ if (($? >> 8)!=0) {
+ print "download nok\n";
$report{'download'} = "nok";
+ unlink $tarballsplace."/".$tarball;
} else {
print "download ok\n";
$report{'download'} = "ok";
+ }
+ }
+
+ if ($report{'download'} ne "nok") {
$report{'stamp_build-start'} = time;
`cd $workplace ; svn-buildpackage --svn-builder "pdebuild --use-pdebuild-internal -- --buildplace $pbuilderplace --distribution $distro --basetgz $pbuilderplace/$distro.tar.gz" --svn-override=origDir=$tarballsplace --svn-override=buildArea=$buildarea --svn-noninteractive >$reportarea/build.log 2>&1`;
$report{'stamp_build-end'} = time;
More information about the Pkg-games-commits
mailing list