]> git.donarmstrong.com Git - wannabuild.git/commitdiff
add state auto-not-for-us:
authorAndreas Barth <aba@not.so.argh.org>
Wed, 30 Mar 2011 19:07:18 +0000 (19:07 +0000)
committerAndreas Barth <aba@not.so.argh.org>
Wed, 30 Mar 2011 19:09:51 +0000 (19:09 +0000)
  if a package shouldn't be built according to the sources file, and the
  package isn't marked in P-a-s, and isn't in the Failed or Dep-Wait-State
  (in which case the current state isn't touched)

bin/wanna-build
lib/WB/QD.pm
tests/qd.pl

index e7befe37a28014ab91de762fcb6913473c034b86..8780000876d6b60da09f3fed56ae2d67cc43d593 100755 (executable)
@@ -160,7 +160,7 @@ my %options =
                   die "Unknown state to list: $list_state\n"
                           if !isin( $list_state, qw(needs-build building uploaded
                                                 built build-attempted failed installed dep-wait
-                                                not-for-us all failed-removed
+                                                not-for-us auto-not-for-us all failed-removed
                                                 install-wait reupload-wait bd-uninstallable));} },
         # options with args
         dist           =>
@@ -2319,7 +2319,7 @@ sub check_entry {
        die "Bad state $pkg->{'state'} of package $pkg->{Package}\n"
                if !isin( $pkg->{'state'},
                                  qw(Needs-Build Building Built Build-Attempted Uploaded Installed Dep-Wait Dep-Wait-Removed
-                                        Failed Failed-Removed Not-For-Us BD-Uninstallable
+                                        Failed Failed-Removed Not-For-Us BD-Uninstallable Auto-Not-For-Us
                                         ) );
 }
 
@@ -3025,7 +3025,7 @@ sub parse_all_v3() {
     foreach my $name (keys %$srcs) {
         next if $name eq '_binary';
 
-        # state = installed, out-of-date, uncompiled, not-for-us
+        # state = installed, out-of-date, uncompiled, not-for-us, auto-not-for-us
         my $pkgs = $srcs->{$name};
         my $pkg = $db->{$name};
 
@@ -3094,6 +3094,17 @@ sub parse_all_v3() {
             next;
         }
 
+        if ($pkgs->{'status'} eq 'auto-not-for-us') {
+            next if isin( $pkg->{'state'}, qw(Not-For-Us Failed Failed-Removed Dep-Wait Dep-Wait-Removed));
+            # if the package is currently current, the status is Installed, not not-for-us
+
+            change_state( \$pkg, "Auto-Not-For-Us" );
+           log_ta( $pkg, "--merge-v3: Auto-Not-For-Us" ) unless $simulate;
+           update_source_info($pkg) unless $simulate;
+            print "$logstr set to auto-not-for-us\n" if $verbose || $simulate;
+            next SRCS;
+        }
+
         # 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";
index d5cefb328ea9388ec4c774ac0249a67e5c8e36e7..25d2fb0234e3f7e0db684ed6dee4b8e81619614c 100644 (file)
@@ -3,6 +3,7 @@ package WB::QD;
 use strict;
 use IO::Uncompress::AnyInflate qw(anyinflate);
 use Dpkg::Version qw(vercmp);
+use Dpkg::Arch qw(debarch_is);
 use Data::Dumper;
 
 sub readsourcebins {
@@ -42,7 +43,9 @@ sub readsourcebins {
 
             next unless $p->{'name'} and $p->{'version'};
             next if $p->{'arch'} eq 'all';
-            # TODO: respect the architecture - or not / we already respect it via P-a-s
+            foreach my $tarch (split(/\s+/, $p->{'arch'})) {
+                $p->{'for-us'} = 1 if debarch_is($arch, $tarch);
+            }
             delete $p->{'arch'};
 
             # ignore if package already exists with higher version
@@ -96,6 +99,11 @@ sub readsourcebins {
         }
         delete $srcs->{$k}->{'compiled'};
         $srcs->{$k}->{'status'} = 'installed' if $srcs->{$k}->{'arch'} && $srcs->{$k}->{'arch'} eq 'all';
+        
+        if (!$srcs->{$k}->{'for-us'} && $srcs->{$k}->{'status'} ne 'installed') {
+            $srcs->{$k}->{'status'} = 'auto-not-for-us';
+        }
+        delete $srcs->{$k}->{'for-us'};
 
         #my $p = $pas->{$k};
         #$p ||= $pas->{'%'.$k};
index 9a4ceabc5fb26ecc9102260afa0daf50f3bb2b6e..6ae5100014a258cf6db0df07c9ce29f193c0ea9f 100755 (executable)
@@ -69,6 +69,20 @@ Build-Depends: debhelper (>= 7), docbook-xsl, ldp-docbook-xsl (>= 0.0.20040321-0
 Build-Conflicts: dash
 Architecture: all i386 amd64
 
+Package: autonfu
+Binary: autonfu
+Version: 1.41.11-1
+Priority: required
+Section: admin
+Architecture: amd64
+
+Package: autonfu1
+Binary: autonfu1
+Version: 1.41.11-1
+Priority: required
+Section: admin
+Architecture: linux-any
+
 EOF
 ;
 
@@ -168,6 +182,22 @@ is_deeply ($$srcs, {
                         'section' => 'shell',
                              'binary' => ['nfu'],
                       },
+            'autonfu' => {
+                        'priority' => 'required',
+                        'status' => 'auto-not-for-us',
+                        'version' => '1.41.11-1',
+                        'name' => 'autonfu',
+                        'section' => 'admin',
+                             'binary' => ['autonfu'],
+                      },
+            'autonfu1' => {
+                        'priority' => 'required',
+                        'status' => 'uncompiled',
+                        'version' => '1.41.11-1',
+                        'name' => 'autonfu1',
+                        'section' => 'admin',
+                             'binary' => ['autonfu1'],
+                      },
             'pbuilder' => {
                             'priority' => 'extra',
                             'status' => 'not-for-us',