]> git.donarmstrong.com Git - wannabuild.git/blobdiff - bin/wanna-build
Don't change state on give-back if we're already in needs-build.
[wannabuild.git] / bin / wanna-build
index c04c25827294218824191aaca922a5e428424bcf..cdfd60c86b03c80684ad730a2c8b476fdfd3c139 100755 (executable)
@@ -897,6 +897,12 @@ sub add_one_needsbuild {
        }
        $state = $pkg->{'state'};
 
+       if ($state eq "Needs-Build")
+       {
+               print "$name: Already in Needs-Build.\n";
+               return;
+       }
+
        if ($state eq "BD-Uninstallable") {
                if ($opt_override) {
                        print "$name: Forcing uninstallability mark to be removed. This is not permanent and might be reset with the next trigger run\n";
@@ -938,7 +944,8 @@ sub add_one_needsbuild {
                }
        }
        if (defined ($pkg->{'builder'}) && $user ne $pkg->{'builder'} &&
-                   !($pkg->{'builder'} =~ /^(\w+)-\w+/ && $1 eq $user)) {
+               !($pkg->{'builder'} =~ /^(\w+)-\w+/ && $1 eq $user) &&
+               !$opt_override) {
                print "$name: not taken by you, but by ".
                          "$pkg->{'builder'}. Skipping.\n";
                return;
@@ -2349,6 +2356,7 @@ sub usage {
 Usage: $prgname <options...> <package_version...>
 Options:
     -v, --verbose: Verbose execution.
+    -A arch: Architecture this operation is for.
     --take: Take package for building [default operation]
     -f, --failed: Record in database that a build failed due to
         deficiencies in the package (that aren't fixable without a new
@@ -2419,7 +2427,8 @@ sub user_table_name {
 sub get_source_info {
        my $name = shift;
        my $pkg = $dbh->selectrow_hashref('SELECT * FROM ' . 
-               table_name() . ' WHERE package = ? AND distribution = ?',
+               table_name() . ' WHERE package = ? AND distribution = ?' .
+               'FOR UPDATE',
                undef, $name, $distribution);
        return $pkg;
 }