]> git.donarmstrong.com Git - wannabuild.git/blobdiff - bin/wanna-build
Fix typo
[wannabuild.git] / bin / wanna-build
index ff08e8e5011d3582fae44f059b5004221feb5b97..3f11f6568636de4b843738a95aa8812f8a409921 100755 (executable)
@@ -118,7 +118,7 @@ my %options =
         "merge-sources" => { mode => "merge-sources" },
         "pretend-avail" => { short => "p", mode => "pretend-avail" },
         "merge-all"     => { mode => "merge-all" },
-        "merge-all-overlay" => { mode => "merge-all-overlay" },
+        "merge-all-secondary" => { mode => "merge-all-secondary" },
         info                   => { short => "i", mode => "info" },
         'binNMU' => { mode => 'set-binary-nmu', arg => \$binNMUver, 
                             code => sub { die "Invalid binNMU version: $binNMUver\n"
@@ -382,7 +382,7 @@ sub process {
                                if (defined @conf::admin_users and
                                    !isin( $real_user, @conf::admin_users));
                        lock_table();
-                       parse_packages();
+                       parse_packages(0);
                        last SWITCH;
                };
                /^merge-sources/ && do {
@@ -404,7 +404,7 @@ sub process {
                        lock_table();
                        my @ARGS = @ARGV;
                        @ARGV = ( $ARGS[0] );
-                       my $pkgs = parse_packages();
+                       my $pkgs = parse_packages(0);
                        @ARGV = ( $ARGS[1] );
                        parse_quinn_diff(0);
                        @ARGV = ( $ARGS[2] );
@@ -412,14 +412,22 @@ sub process {
                        call_edos_depcheck( $ARGS[0], $srcs );
                        last SWITCH;
                };
-               /^merge-all-overlay/ && do {
+               /^merge-all-secondary/ && do {
                        die "This operation is restricted to admin users\n"
                                if (defined @conf::admin_users and
                                    !isin( $real_user, @conf::admin_users));
+                       # This is in case the chroot has multiple unrelated
+                       # dist, for instance unstable and experimental.
+                       # This is not for stable and proposed-updates.
+                       # The second packages file contains a combination
+                       # of all Packages files known to the buildd, the
+                       # first only for the current dist.
                        lock_table();
                        my @ARGS = @ARGV;
                        @ARGV = ( $ARGS[0] );
-                       my $pkgs = parse_packages();
+                       my $pkgs = parse_packages(0);
+                       @ARGV = ( $ARGS[3] );
+                       my $pkgs = parse_packages(1);
                        @ARGV = ( $ARGS[1] );
                        parse_quinn_diff(0);
                        @ARGV = ( $ARGS[2] );
@@ -1278,6 +1286,7 @@ sub parse_sources {
 # This function looks through a Packages file and sets the state of
 # packages to 'Installed'
 sub parse_packages {
+       my $depwait_only = shift;
        my $installed;
 
        my $pkgs = get_all_source_info();
@@ -1296,6 +1305,7 @@ sub parse_packages {
                next if (defined ($installed->{$name}) and $installed->{$name}{'version'} ne "" and
                        version_lesseq( $version, $installed->{$name}{'version'} ));
                $installed->{$name}{'version'} = $version;
+               next if $depwait_only;
                $installed->{$name}{'depends'} = $depends;
                $installed->{$name}{'all'} = 1 if $architecture eq "all";
                undef $installed->{$name}{'Provider'};