]> git.donarmstrong.com Git - wannabuild.git/blobdiff - bin/wanna-build
wanna-build: lock_table: limit row lock to same distribution
[wannabuild.git] / bin / wanna-build
index 7c6e9b26ab864e9dccc138278cbf93ba5c93bbb7..288d3f7722139f93fce1802f0e7c4ce69a74bcbf 100755 (executable)
@@ -23,6 +23,8 @@ use strict;
 use warnings;
 use 5.010;
 
+die "wanna-build disabled" if -f "/org/wanna-build/NO-WANNA-BUILD";
+
 package conf;
 
 use vars qw< $basedir $dbbase $transactlog $mailprog $buildd_domain >;
@@ -273,7 +275,7 @@ if (!isin ( $op_mode, qw(list) ) && ( ($distribution//"") =~ /[ ,]/)) {
 if ($verbose) {
        my $version = '$Revision: db181a534e9d $ $Date: 2008/03/26 06:20:22 $ $Author: rmurray $';
        $version =~ s/(^\$| \$ .*$)//g;
-       print "wanna-build $version for $distribution on $arch\n";
+       print "wanna-build $version for ".($distribution//"sid")." on $arch\n";
 }
 
 if (!@ARGV && !isin( $op_mode, qw(list merge-quinn merge-partial-quinn import export
@@ -1559,7 +1561,7 @@ sub build_deplist {
 
 sub filterarch {
     return "" unless $_[0];
-    return Dpkg::Deps::parse($_[0], ("reduce_arch" => 1, "host_arch" => $_[1]))->dump();
+    return Dpkg::Deps::deps_parse($_[0], ("reduce_arch" => 1, "host_arch" => $_[1]))->output();
 }
 
 sub wb_edos_builddebcheck {
@@ -1606,9 +1608,9 @@ sub wb_edos_builddebcheck {
         }   
     }
 
-    print "calling: edos-debcheck $edosoptions < $sourcesfile ".join('', map {" '-base FILE' ".$_ } @$packagefiles)."\n";
+    print "calling: edos-debcheck $edosoptions < $sourcesfile ".join('', map {" -I ".$_ } @$packagefiles)."\n";
     open(my $result_cmd, '-|',
-        "edos-debcheck $edosoptions < $sourcesfile ".join('', map {" '-base FILE' ".$_ } @$packagefiles));
+        "edos-debcheck $edosoptions < $sourcesfile ".join('', map {" -I ".$_ } @$packagefiles));
 
     my $explanation="";
     my $result={};
@@ -2080,8 +2082,8 @@ sub add_user_info {
 
 sub lock_table {
         return if $simulate;
-       $dbh->do('LOCK TABLE ' . table_name() .
-               ' IN EXCLUSIVE MODE', undef) or die $dbh->errstr;
+       $dbh->do('SELECT 1 FROM ' . table_name() .
+               ' WHERE distribution = ? FOR UPDATE', undef, $distribution) or die $dbh->errstr;
 }
 
 sub parse_argv {