]> git.donarmstrong.com Git - wannabuild.git/blobdiff - bin/wanna-build
Use the unprivilged service in case it's read-only and not security related.
[wannabuild.git] / bin / wanna-build
index 4a528a3d9ac15c80bdb15027dda424c505bdd3f9..4ba644ebbdb4149adb1e30f1c8a496a79d389ab5 100755 (executable)
@@ -303,8 +303,7 @@ END {
 }
 
 my $schema_suffix = '';
-# TODO: Base this on something else, like an option that is passed.
-if ($real_user eq 'nobody') {
+if (isin( $op_mode, qw(list info)) && $distribution !~ /security/) {
        $dbh = DBI->connect("DBI:Pg:service=wanna-build") || 
                die "FATAL: Cannot open database: $DBI::errstr\n";
        $schema_suffix = '_public';
@@ -2350,6 +2349,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
@@ -2420,7 +2420,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;
 }