[Collab-qa-commits] r660 - svnbuildstat/trunk/script
goneri-guest at alioth.debian.org
goneri-guest at alioth.debian.org
Sat Jan 19 17:48:46 UTC 2008
Author: goneri-guest
Date: 2008-01-19 17:48:46 +0000 (Sat, 19 Jan 2008)
New Revision: 660
Modified:
svnbuildstat/trunk/script/svnbuildstat_update-repository.pl
Log:
doesn't prepare a package a second time if the process already failed
Modified: svnbuildstat/trunk/script/svnbuildstat_update-repository.pl
===================================================================
--- svnbuildstat/trunk/script/svnbuildstat_update-repository.pl 2008-01-19 16:26:15 UTC (rev 659)
+++ svnbuildstat/trunk/script/svnbuildstat_update-repository.pl 2008-01-19 17:48:46 UTC (rev 660)
@@ -68,7 +68,7 @@
$$repositoryentry->changelogentry_id->tarball_id(undef);
}
- my $cmd = "cp -v $tarballdir/$tarball $workdir/$tarball";
+ my $cmd = "cp -lv $tarballdir/$tarball $workdir/$tarball";
`$cmd`;
if (!-f "$workdir/$tarball") {
debug ("Failed to copy $tarballdir/$tarball to $workdir/$tarball");
@@ -129,9 +129,10 @@
my $pkgrootdirectory;
if (!$$repositoryentry->changelogentry_id->isnative) {
$pkgrootdirectory = fetchAndPrepareDirectoryForMergeWithUpstream($repositoryentry, $workdir);
- print "rootdirectoy: `".$pkgrootdirectory."'\n";
- return unless $pkgrootdirectory;
- print "rootdirectoy is ok\n";
+ if (!$pkgrootdirectory) {
+ debug ("Can't prepare ".$$repositoryentry->changelogentry_id->tarball_id->name);
+ return;
+ }
} else {
$pkgrootdirectory = $$repositoryentry->sourcepackage_id->name.'-'.$$repositoryentry->changelogentry_id->version;
`mkdir -p $workdir."/".$pkgrootdirectory`;
@@ -142,13 +143,16 @@
$vcs->exportIn($workdir."/".$pkgrootdirectory);
print "exportIn end".$workdir."/".$pkgrootdirectory."\n";
- return unless addSubRevInChangelog($workdir."/".$pkgrootdirectory, $vcsname.$vcsrev);
+ if (!addSubRevInChangelog($workdir."/".$pkgrootdirectory, $vcsname.$vcsrev)) {
+ debug ("Can't add vcs revision in changelog entry for ".$$repositoryentry->sourcepackage_id->name);
+ return;
+ }
my $cwd = getcwd;
chdir $workdir or die;
print `dpkg-source -b -W $pkgrootdirectory 2>&1`;
if (($? >> 8)!=0) {
- info ("failed to create .dsc");
+ debug ("failed to create .dsc for ".$$repositoryentry->sourcepackage_id->name);
return;
}
chdir $cwd;
@@ -164,8 +168,10 @@
$dscfile = basename($file) if $file =~ /\.dsc/;
move ($file, $destdir);
}
- print "dscfile: ".$dscfile."\n";
- return unless $dscfile;
+ if (!$dscfile) {
+ debug ("dpkg-source failed, can't find the .dsc for ".$$repositoryentry->sourcepackage_id->name);
+ return;
+ }
my $dscuri = '@REPOSITORY_URL@/'.$$repositoryentry->repository_id->team_id->shortname.'/'.$$repositoryentry->sourcepackage_id->name.'/'.$$repositoryentry->changelogentry_id->id.'/'.$dscfile;
$$repositoryentry->changelogentry_id->dscuri($dscuri);
@@ -211,9 +217,15 @@
my $repositoryentry_rs = $schema->resultset('Repositoryentry');
while (my $repositoryentry = $repositoryentry_rs->next) {
- if ($repositoryentry->changelogentry_id && !$repositoryentry->changelogentry_id->dscuri && $repositoryentry->changelogentry_id->tarball_id) {
+ if ($repositoryentry->changelogentry_id && !$repositoryentry->changelogentry_id->dscuri && $repositoryentry->changelogentry_id->tarball_id && !$repositoryentry->changelogentry_id->dpkgsrcfaileddate) {
print "prepare ".$repositoryentry->sourcepackage_id->name."\n";
- prepare(\$repositoryentry);
+ if (!prepare(\$repositoryentry)) {
+ print "“”dpkgsrcfailed for ".$repositoryentry->sourcepackage_id->name."\n";
+
+ $repositoryentry->changelogentry_id->tarball_id(undef);
+ $repositoryentry->changelogentry_id->dpkgsrcfaileddate('now');
+ $repositoryentry->changelogentry_id->update;
+ }
}
}
More information about the Collab-qa-commits
mailing list