Package: cvs-autoreleasedeb Version: 0.12-1 Attached patch number 3: Save previous build state, so we don't rebuild a bad version until it is fixed (the release number is bumped).
-- Oron Peled Voice: +972-4-8228492 o...@actcom.co.il http://users.actcom.co.il/~oron Do you really want to pay the Bill? ...you'd better run Linux instead!
Index: trunk/debian/changelog =================================================================== --- trunk/debian/changelog (revision 298) +++ trunk/debian/changelog (revision 299) @@ -1,3 +1,11 @@ +cvs-autoreleasedeb (0.12-1.3) unstable; urgency=low + + * Non-maintainer upload. + * Save previous build state, so we don't rebuild a bad + version until it is fixed. + + -- Oron Peled <o...@actcom.co.il> Tue, 15 Dec 2009 14:56:23 +0200 + cvs-autoreleasedeb (0.12-1.2) unstable; urgency=low * Non-maintainer upload. Index: trunk/svn-autoreleasedeb =================================================================== --- trunk/svn-autoreleasedeb (revision 298) +++ trunk/svn-autoreleasedeb (revision 299) @@ -176,8 +176,9 @@ mkdir $::SVNDIR; mkdir $::PACKDIR; my %failed_packages; +my %prev_build_state; foreach my $s (keys %{$newpacks_struct}) { - $failed_packages{$s} = []; + undef $failed_packages{$s}; next if ref($newpacks_struct->{$s}) ne "HASH"; print " ======= Starting to work with server $s ======== \n"; print " creating directory ".$::SVNDIR.$s."\n"; @@ -195,12 +196,12 @@ # prefix is optional unless ($conf_struct->{$s}{$p}{svnserver} =~ /\S+/) { print "Skipping, because no svnserver defined.\n"; - push @{$failed_packages{$s}}, $p; + $failed_packages{$s}{$p} = 'FAILED(no-svnserver)'; next; } unless ($conf_struct->{$s}{$p}{tag} =~ /\S+/) { print "Skipping, because no tag defined.\n"; - push @{$failed_packages{$s}}, $p; + $failed_packages{$s}{$p} = 'FAILED(no-tag)'; next; } @@ -210,7 +211,7 @@ print $cmd."\n"; unless (system($cmd) == 0) { print "SVN Checkout failed. going to try again in the next run!\n"; - push @{$failed_packages{$s}}, $p; + $failed_packages{$s}{$p} = 'FAILED(co)'; next; } @@ -223,7 +224,7 @@ unless (system($cmd) == 0) { print "svn-buildpackage failed. going to try again in the next run!\n"; - push @{$failed_packages{$s}}, $p; + $failed_packages{$s}{$p} = 'FAILED(buildpackage)'; next; } @@ -246,7 +247,7 @@ print $cmd."\n"; unless (system($cmd) == 0) { - push @{$failed_packages{$s}}, $p; + $failed_packages{$s}{$p} = 'FAILED(dupload)'; print "dupload failed. going to try again in the next run!\n"; next; } @@ -264,15 +265,15 @@ # revert to the old state the failed packages, so they # will be generated again in next run. -foreach my $s (keys %failed_packages) { - foreach my $p (@{$failed_packages{$s}}) { - if (exists $state_struct->{$s}{$p}) { - $newstate_struct->{$s}{$p} = $state_struct->{$s}{$p}; - } else { - delete $newstate_struct->{$s}{$p}; - } - } -} +#foreach my $s (keys %failed_packages) { +# foreach my $p (keys %{$failed_packages{$s}}) { +# if (exists $state_struct->{$s}{$p}) { +# $newstate_struct->{$s}{$p} = $state_struct->{$s}{$p}; +# } else { +# delete $newstate_struct->{$s}{$p}; +# } +# } +#} # Save the new state &write_state_file($newstate_struct); @@ -346,8 +347,9 @@ _exit 3; } while (<STATE>) { - my ($s,$p,$v) = split(/;/, $_); + my ($s,$p,$v,$buildstate) = split(/;/, $_); $state_struct->{$s}{$p} = $v; + $prev_build_state{$s}{$p} = (defined $buildstate) ? $buildstate : 'UNKONWN'; } close STATE; } @@ -368,7 +370,9 @@ foreach my $s (keys %{$state_struct}) { next if ref($state_struct->{$s}) ne "HASH"; foreach my $p (keys %{$state_struct->{$s}}) { - print STATE join(';',($s,$p,$state_struct->{$s}{$p})); + my $buildstate = $failed_packages{$s}{$p}; + $buildstate = (defined $buildstate) ? $buildstate : 'OK'; + print STATE join(';',($s,$p,$state_struct->{$s}{$p},$buildstate)); print STATE "\n"; } } @@ -405,7 +409,8 @@ my $changelog = `$cmd`; my $version; ($version = $changelog) =~ s/^$p \((.+?)\).+$/$1/s; - print "Package $p in version $version\n"; + my $prev_build_state = $prev_build_state{$s}{$p}; + print "Package $p in version $version (prev_build=$prev_build_state)\n"; $newstate_struct->{$s}{$p} = $version; } }