From d663a834bd6840d712f702dd14a9f65523d929f3 Mon Sep 17 00:00:00 2001 From: Andreas Barth Date: Sun, 24 Apr 2011 19:31:22 +0000 Subject: [PATCH] add_one_building: simplify --- bin/wanna-build | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) 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'}))) { -- 2.39.2