]> git.donarmstrong.com Git - wannabuild.git/commitdiff
add_one_building: simplify
authorAndreas Barth <aba@not.so.argh.org>
Sun, 24 Apr 2011 19:31:22 +0000 (19:31 +0000)
committerAndreas Barth <aba@not.so.argh.org>
Sun, 24 Apr 2011 19:31:22 +0000 (19:31 +0000)
bin/wanna-build

index 77f4ac3b16998a0af0b351e23e06723a2da4dffc..5d3f4b7d6577c0ee9bd08874279b5121389ebc8e 100755 (executable)
@@ -605,17 +605,14 @@ sub add_one_building {
        $ok = 1;
        my $pkg = shift;
        if (defined($pkg)) {
-               if ($pkg->{'state'} eq "Not-For-Us") {
+            my $pkgnack = {
+                'Not-For-Us' => 'not suitable for this architecture',
+                'Dep-Wait' => 'not all source dependencies available yet',
+                'BD-Uninstallable' => 'source dependencies are not installable',
+            };
+               if ($pkgnack->{$pkg->{'state'}}) {
                        $ok = 0;
-                       $reason = "not suitable for this architecture";
-               }
-               elsif ($pkg->{'state'} =~ /^Dep-Wait/) {
-                       $ok = 0;
-                       $reason = "not all source dependencies available yet";
-               }
-               elsif ($pkg->{'state'} =~ /^BD-Uninstallable/) {
-                       $ok = 0;
-                       $reason = "source dependencies are not installable";
+                       $reason = $pkgnack->{$pkg->{'state'}};
                }
                elsif ($pkg->{'state'} eq "Uploaded" &&
                           (version_lesseq($version, $pkg->{'version'}))) {