]> git.donarmstrong.com Git - wannabuild.git/blobdiff - bin/wanna-build
set package name for new packages
[wannabuild.git] / bin / wanna-build
index 0818673f19800fc94219b48059d21523ed36df67..429a968c5cf078e8ed2a8654d6db11643ea14f46 100755 (executable)
@@ -60,6 +60,7 @@ our ($verbose, $mail_logs, $list_order, $list_state,
     $build_priority, %new_vers, $binNMUver, %merge_srcvers, %merge_binsrc,
     $printformat, $ownprintformat, $privmode
     );
+our $Pas = '/org/buildd.debian.org/etc/packages-arch-specific/Packages-arch-specific';
 our $simulate = 0;
 
 # global vars
@@ -106,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 },
@@ -196,6 +198,7 @@ my %options =
                                                 } },
          "format"       => { arg => \$printformat },
          "own-format"       => { arg => \$ownprintformat },
+         "Pas"          => { arg => \$Pas },
         # special actions
         export         => { arg => \$export_to, mode => "export" },
         import         => { arg => \$import_from, mode => "import" },
@@ -491,11 +494,13 @@ 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, '.');
                         use WB::QD;
-                        my $srcs = WB::QD::readsourcebins($arch, '/org/buildd.debian.org/etc/packages-arch-specific/Packages-arch-specific', \@isrcs, \@ipkgs);
+                        my $srcs = WB::QD::readsourcebins($arch, $Pas, \@isrcs, \@ipkgs);
                         parse_all_v3($$srcs);
                         @bpkgs = @ipkgs unless @bpkgs;
                         call_edos_depcheck( {'arch' => $arch, 'pkgs' => @bpkgs, 'srcs' => $$srcs, 'depwait' => 1 });
@@ -2889,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'}) {
@@ -2906,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;
         }
@@ -2956,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) {
@@ -2965,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};
     }