From: Andreas Barth Date: Sun, 24 Apr 2011 19:31:22 +0000 (+0000) Subject: add_one_building: simplify X-Git-Url: https://git.donarmstrong.com/?p=wannabuild.git;a=commitdiff_plain;h=d663a834bd6840d712f702dd14a9f65523d929f3 add_one_building: simplify --- diff --git a/bin/wanna-build b/bin/wanna-build index 77f4ac3..5d3f4b7 100755 --- a/bin/wanna-build +++ b/bin/wanna-build @@ -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'}))) {