commit:     134fe0cd18971096ea99665a9e259bfb75960a04
Author:     Alex Legler <a3li <AT> gentoo <DOT> org>
AuthorDate: Fri May 27 19:11:42 2011 +0000
Commit:     Pavlos Ratis <dastergon <AT> gentoo <DOT> org>
CommitDate: Fri May 27 19:11:42 2011 +0000
URL:        
http://git.overlays.gentoo.org/gitweb/?p=proj/security.git;a=commit;h=134fe0cd

Add warning if target version was not found; misc other fixes.

svn path=/; revision=2230

---
 bin/target | 18 +++++++++++++-----
 1 file 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
 

Reply via email to