X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=bin%2Fwanna-build;h=6e09e8e11ab6865c54fee1d84739f2ad39c8845d;hb=60ef83024a2b290ab1a92f103e5de52aa909a7a3;hp=9ef78632054ead7ea732c9e12e7faa3e4bdcf61e;hpb=79c45afef947d384a4a777e8369ce8f27ef9aea9;p=wannabuild.git diff --git a/bin/wanna-build b/bin/wanna-build index 9ef7863..6e09e8e 100755 --- a/bin/wanna-build +++ b/bin/wanna-build @@ -64,7 +64,7 @@ use Dpkg::Deps; # TODO: same our ($verbose, $mail_logs, $list_order, $list_state, $curr_date, $op_mode, $user, $real_user, $distribution, - $fail_reason, $opt_override, $import_from, $export_to, $opt_create_db, + $fail_reason, $opt_override, $import_from, $export_to, %prioval, %sectval, $info_all_dists, $arch, $short_date, $list_min_age, $list_max_age, $dbbase, @curr_time, @@ -106,7 +106,6 @@ GetOptions( }, 'verbose|v' => \$verbose, 'override|o' => \$opt_override, - 'create-db' => \$opt_create_db, 'correct-compare' => \$WannaBuild::opt_correct_version_cmp, # TODO: remove after buildds no longer pass to wanna-build @@ -151,6 +150,7 @@ GetOptions( reupload-wait bd-uninstallable ) ]; }, 'dist|d=s' => sub { + $distribution = $_[1]; given ( $_[1] ) { when ( [qw< a all >] ) { $info_all_dists = 1; @@ -183,8 +183,8 @@ GetOptions( 'extra-conflicts=s' => \$extra_conflicts, # special actions - 'export' => sub { _set_mode(@_); $export_to = $_[1]; }, - 'import' => sub { _set_mode(@_); $import_from = $_[1]; }, + 'export=s' => sub { _set_mode(@_); $export_to = $_[1]; }, + 'import=s' => sub { _set_mode(@_); $import_from = $_[1]; }, 'manual-edit' => \&_set_mode, 'distribution-architectures' => \&_set_mode, 'distribution-aliases' => \&_set_mode, @@ -1280,7 +1280,7 @@ sub sort_list_func { sub calculate_prio { my $priomap = $yamlmap->{priority}; my $pkg = shift; - my @s=split("/", $pkg->{'section'}); + my @s=split("/", $pkg->{'section'}//""); $pkg->{'component'} = $s[0] if $s[1]; $pkg->{'component'} ||= 'main'; $pkg->{'calprio'} = 0; @@ -1459,6 +1459,7 @@ sub list_packages { undef $printformat if ($ownprintformat && $ownprintformat eq 'none'); foreach $pkg (sort sort_list_func @list) { + no warnings; if ($printformat) { print print_format($printformat, $pkg, {'cnt' => $cnt, 'scnt' => \%scnt})."\n"; ++$cnt; @@ -1564,6 +1565,7 @@ sub info_packages { } sub forget_packages { + no warnings; my( $name, $pkg, $key, $data ); foreach $name (@_) { @@ -2358,12 +2360,12 @@ sub parse_all_v3 { foreach my $name (keys %$srcs) { next if $name eq '_binary'; - # state = installed, out-of-date, uncompiled, not-for-us, auto-not-for-us + # state = installed, out-of-date, uncompiled, packages-arch-specific, overwritten-by-arch-all, arch-not-in-arch-list my $pkgs = $srcs->{$name}; my $pkg = $db->{$name}; unless ($pkg) { - next SRCS if $pkgs->{'status'} eq 'not-for-us'; + next SRCS if $pkgs->{'status'} eq 'packages-arch-specific'; my $logstr = sprintf("merge-v3 %s %s_%s (%s, %s):", $vars->{'time'}, $name, $pkgs->{'version'}, $vars->{'arch'}, $vars->{'suite'}); # does at least one binary exist in the database and is more recent - if so, we're probably just outdated, ignore the source package @@ -2375,18 +2377,20 @@ sub parse_all_v3 { } $pkg->{'package'} = $name; } + $pkg->{'version'} ||= ""; + $pkg->{'state'} ||= ""; my $logstr = sprintf("merge-v3 %s %s_%s", $vars->{'time'}, $name, $pkgs->{'version'}). ($pkgs->{'binnmu'} ? ";b".$pkgs->{'binnmu'} : ""). sprintf(" (%s, %s, previous: %s", $vars->{'arch'}, $vars->{'suite'}, $pkg->{'version'}//""). ($pkg->{'binary_nmu_version'} ? ";b".$pkg->{'binary_nmu_version'} : ""). - ", $pkg->{'state'}):"; + ", $pkg->{'state'}".($pkg->{'notes'} ? "/".$pkg->{'notes'} : "")."):"; if (isin($pkgs->{'status'}, qw (installed related)) && $pkgs->{'version'} eq $pkg->{'version'} && ($pkgs->{'binnmu'}//0) < int($pkg->{'binary_nmu_version'}//0)) { $pkgs->{'status'} = 'out-of-date'; } - if (isin($pkgs->{'status'}, qw (installed related auto-not-for-us))) { + if (isin($pkgs->{'status'}, qw )) { my $change = 0; - my $tstate = {'installed' => 'Installed', 'related' => 'Installed', 'auto-not-for-us' => 'Auto-Not-For-Us'}->{$pkgs->{'status'}}; + my $tstate = {'installed' => 'Installed', 'related' => 'Installed', 'arch-not-in-arch-list' => 'Auto-Not-For-Us', 'packages-arch-specific' => 'Auto-Not-For-Us', 'overwritten-by-arch-all' => 'Auto-Not-For-Us'}->{$pkgs->{'status'}}; next if isin( $pkg->{'state'}, qw) && isin( $tstate, qw); # if the package is currently current, the status is Installed, not not-for-us if ($pkg->{'state'} ne $tstate) { @@ -2406,9 +2410,12 @@ sub parse_all_v3 { $change++; } } - if (isin($pkgs->{'status'}, qw (related)) and $pkg->{'notes'} ne "related") { - $pkg->{'notes'} = "related"; - $change++; + if (isin($pkgs->{'status'}, qw )) { + my $tnotes = $pkgs->{'status'}; + if ($pkg->{'notes'} && $pkg->{'notes'} ne $tnotes) { + $pkg->{'notes'} = $tnotes; + $change++; + } } if ($change) { print "$logstr set to $tstate/".($pkg->{'notes'}//"")."\n" if $verbose || $simulate; @@ -2418,21 +2425,6 @@ sub parse_all_v3 { next; } - if ($pkgs->{'status'} eq 'not-for-us') { - next if isin( $pkg->{'state'}, qw(Not-For-Us Installed Failed-Removed)); - - if (isin( $pkg->{'state'}, qw(Failed Build-Attempted Built))) { - change_state( \$pkg, "Failed-Removed" ); - log_ta( $pkg, "--merge-v3: Failed-Removed" ) unless $simulate; - update_source_info($pkg) unless $simulate; - print "$logstr (virtually) deleted from database\n" if $verbose || $simulate; - next; - } - - print "$logstr should delete (not-for-us according to P-a-s)\n" if $verbose || $simulate || 1; # not implemented yet on purpose - next; - } - # only uncompiled / out-of-date are left, so check if anything new if (!(isin($pkgs->{'status'}, qw (uncompiled out-of-date)))) { print "$logstr package in unknown state: $pkgs->{'status'}\n";