aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Legler <a3li@gentoo.org>2011-05-27 19:11:42 +0000
committerAlex Legler <a3li@gentoo.org>2011-05-27 19:11:42 +0000
commit134fe0cd18971096ea99665a9e259bfb75960a04 (patch)
treee2fa9431d83d566ea98a6e76ee7b108d3859c480
parentfilter -* keywords (diff)
downloadsecurity-134fe0cd18971096ea99665a9e259bfb75960a04.tar.gz
security-134fe0cd18971096ea99665a9e259bfb75960a04.tar.bz2
security-134fe0cd18971096ea99665a9e259bfb75960a04.zip
Add warning if target version was not found; misc other fixes.
svn path=/; revision=2230
-rwxr-xr-xbin/target18
1 files changed, 13 insertions, 5 deletions
diff --git a/bin/target b/bin/target
index 701886c..3142c9b 100755
--- a/bin/target
+++ b/bin/target
@@ -25,7 +25,7 @@ module GenSec
def main(argv)
$opts = {
- :auth_cache => true,
+ :debug => false,
:force => false,
:liaisons => false,
:username => nil,
@@ -64,6 +64,10 @@ module GenSec
$opts[:username] = username
end
+ opts.on_tail('--debug', 'Print debug output.') do
+ $opts[:debug] = true
+ end
+
opts.on_tail('-f', '--force', 'Force the operation. Disables asking for confirmation and version checks.') do
$opts[:force] = true
end
@@ -97,16 +101,20 @@ module GenSec
e("No package found.")
end
- i("Using #{metadata[:package]}") unless $opts[:quiet]
- #puts metadata.inspect
+ i("Package: #{$ui.color(metadata[:package], :green)}") unless $opts[:quiet]
+ if $opts[:debug]
+ require 'pp'
+ pp metadata
+ end
best_version = find_best_version(metadata, slot, version)
- i("Target version: #{best_version}") unless $opts[:quiet]
+ i("Target version: #{$ui.color(best_version, :green)}") unless $opts[:quiet]
# Cover a custom version string that is not there in the local tree
- if metadata[:keywords].include? best_version
+ if metadata[:versions].include? best_version
already_stable = filter_unstable(metadata[:keywords][best_version]) - NOSTABLE_ARCHES
else
+ w($ui.color("Warning: Target version not found. Proceed with care.", :yellow))
already_stable = []
end