@list = grep { my $i = $_->{'component'}; grep { $i eq $_ } split /[, ]+/, $yamlmap->{"restrict"}{'component'} } @list;
# extra depends / conflicts only from api 1 on
@list = grep { !$_->{'extra_depends'} and !$_->{'extra_conflicts'} } @list if $api < 1 ;
+ # filter out packages for needs-build in noautobuild state - same could exist for weaknoautobuild if buildds would tell us what they do
+ if (($state eq 'needs-build') && ($yamlmap->{"restrict"}) && ($yamlmap->{"restrict"}{"noautobuild"})) {
+ foreach my $key (map {keys %$_} @{$yamlmap->{"restrict"}{"noautobuild"}}) {
+ @list = grep { $_->{'package'} ne $key } @list;
+ }
+ }
# first adjust ownprintformat, then set printformat accordingly
$printformat ||= $yamlmap->{"format"}{$ownprintformat} if $ownprintformat;
--simulate: Do not actually execute the action.
(Not yet implemented for all operations. Check the source.)
-A arch: Architecture this operation is for. (REQUIRED)
- -d dist: Distribution/suite this operation is for. (REQUIRED)
+ -d dist: Distribution/suite this operation is for. Defaults to unstable.
--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
automatically choosen
--import FILE: Import database from a ASCII file FILE
--export FILE: Export database to a ASCII file FILE
+ --format string, --own-format name: specify how the listing of packages
+ should look like. Please check the source for details. Own-Format
+ definitions are in ~/.wanna-build.yaml within the format section.
+
+There are more options not relevant for normal usage - please check source
+if you need them.
The remaining arguments (depending on operation) usually start with
"name_version", the trailer is ignored. This allows to pass the names
of .dsc files, for which file name completion can be used.
---merge-packages and --merge-quinn take Package/quin--diff file names
-on the command line or read stdin. --list needs nothing more on the
-command line. --info takes source package names (without version).
EOF
exit 1;
}
sub get_source_info {
my $name = shift;
return get_readonly_source_info($name) if $simulate;
+ lock_table();
my $pkg = $dbh->selectrow_hashref('SELECT *, extract(days from date_trunc(\'days\', now() - state_change)) as state_days, floor(extract(epoch from now()) - extract(epoch from state_change)) as state_time FROM ' .
- table_name() . ' WHERE package = ? AND distribution = ?' .
- ' FOR UPDATE',
+ table_name() . ' WHERE package = ? AND distribution = ?',
undef, $name, $distribution);
return $pkg;
}
sub lock_table {
return if $simulate;
- $dbh->do('SELECT 1 FROM ' . table_name() .
- ' WHERE distribution = ? FOR UPDATE', undef, $distribution) or die $dbh->errstr;
+ $q = 'SELECT 1 AS result FROM public.locks' .
+ ' WHERE architecture = ? AND distribution = ? FOR UPDATE';
+ my $result = $dbh->selectrow_hashref($q, undef, $arch, $distribution) or die $dbh->errstr;
+ die unless $result->{'result'} == 1;
}
sub parse_argv {