]> git.donarmstrong.com Git - wannabuild.git/blobdiff - bin/wanna-build
better logging for edos-debbuildchange
[wannabuild.git] / bin / wanna-build
index 163e5a464e6cb0906855877c9135ede194c9aab9..517b3791efacc5da8516b2b2fa0c2116200cdf20 100755 (executable)
@@ -107,6 +107,7 @@ elsif ($progname =~ /^list-(.*)$/) {
 
 my %options =
        (# flags
+        simulate       => { flag => \$simulate }, # this is not supported by all operations (yet)!
         verbose        => { short => "v", flag => \$verbose },
         override               => { short => "o", flag => \$opt_override },
         "create-db"    => { flag => \$opt_create_db },
@@ -493,6 +494,8 @@ sub process {
                         # call with installed-packages+ . installed-sources+ [ . available-for-build-packages+ ]
                         # in case available-for-build-packages is not specified, installed-packages are used
                         lock_table() unless $simulate;
+                        my $replacemap = { '%ARCH%' => $arch, '%SUITE%' => $distribution };
+                        map { my $k = $_; grep { $k =~ s,$_,$replacemap->{$_}, } keys %{$replacemap}; $_ = $k; } @ARGV;
                         my @ipkgs = &parse_argv( \@ARGV, '.');
                         my @isrcs = &parse_argv( \@ARGV, '.');
                         my @bpkgs = &parse_argv( \@ARGV, '.');
@@ -2575,7 +2578,7 @@ sub call_edos_depcheck {
        }
        if ($change) {
            log_ta( $pkg, "--merge-all (edos)" ) unless $simulate;
-           print "edos-builddebchange changed state of ${key}_$pkg->{'version'} to $pkg->{'state'}\n" if $verbose || $simulate;
+           print "edos-builddebchange changed state of ${key}_$pkg->{'version'} ($args->{'arch'}) to $pkg->{'state'}\n" if $verbose || $simulate;
        }
        if ($change || $problemchange) {
            update_source_info($pkg) unless $simulate;
@@ -2596,7 +2599,7 @@ sub call_edos_depcheck {
            }
        log_ta( $pkg, "edos_depcheck: depwait" ) unless $simulate;
        update_source_info($pkg) unless $simulate;
-       print "edos-builddebchange changed state of ${key}_$pkg->{'version'} to $pkg->{'state'}\n" if $verbose || $simulate;
+       print "edos-builddebchange changed state of ${key}_$pkg->{'version'} ($args->{'arch'}) from dep-wait to $pkg->{'state'}\n" if $verbose || $simulate;
     }
 }
 
@@ -2891,10 +2894,11 @@ sub parse_all_v3() {
             # does at least one binary exist in the database and is more recent - if so, we're probably just outdated, ignore the source package
             for my $bin (@{$pkgs->{'binary'}}) {
                 if ($binary->{$bin} and vercmp($pkgs->{'version'}, $binary->{$bin}) < 0) {
-                    print "merge-v3: skiping $name\n" if $verbose;
+                    print "merge-v3: skiping $name ($arch)\n" if $verbose || $simulate;
                     next SRCS;
                 }
             }
+            $pkg->{'package'}  = $name;
         }
 
         if ($pkgs->{'status'} eq 'installed' && $pkg->{'binary_nmu_version'} && $pkgs->{'binnmu'} < $pkg->{'binary_nmu_version'}) {
@@ -2908,9 +2912,9 @@ sub parse_all_v3() {
                 $pkg->{'binary_nmu_version'} = $pkgs->{'binnmu'};
                 $pkg->{'section'} = $pkgs->{'section'};
                 $pkg->{'priority'} = $pkgs->{'priority'};
-                print "should set $name to installed\n" if $simulate;
+                print "merge-v3: set $name ($arch) to installed\n" if $verbose || $simulate;
                 log_ta( $pkg, "--merge-v3: installed" ) unless $simulate;
-                   update_source_info($pkg) unless $simulate;
+                update_source_info($pkg) unless $simulate;
             }
             next;
         }
@@ -2958,7 +2962,7 @@ sub parse_all_v3() {
         delete $pkg->{'binary_nmu_changelog'};
         log_ta( $pkg, "--merge-v3: needs-build" ) unless $simulate;
         update_source_info($pkg) unless $simulate;
-        print "$name ($pkgs->{'version'}) needs rebuilding now.\n" if $verbose || $simulate;
+        print "$name ($pkgs->{'version'} / $arch) needs rebuilding now.\n" if $verbose || $simulate;
     }
 
     foreach my $name (keys %$db) {
@@ -2967,7 +2971,7 @@ sub parse_all_v3() {
         # package disappeared - delete
         change_state( \$pkg, 'deleted' );
         log_ta( $pkg, "--merge-v3: deleted" ) unless $simulate;
-       print "$name ($pkg->{'version'}): deleted from database\n" if $verbose || $simulate;
+       print "$name ($pkg->{'version'} / $arch) deleted from database\n" if $verbose || $simulate;
         del_source_info($name) unless $simulate;
         delete $db->{$name};
     }