Sophie

Sophie

distrib > Mandriva > 2009.0 > x86_64 > media > main-testing-src > by-pkgid > 7dfdfa0b22edb12f9c039c085fd8697d > files > 7

codeina-0.10.2-16mdv2009.0.src.rpm

diff -p -up codeina-0.10.2/codeina/__init__.py.multiplecodec codeina-0.10.2/codeina/__init__.py
--- codeina-0.10.2/codeina/__init__.py.multiplecodec	2008-04-03 19:37:46.000000000 +0200
+++ codeina-0.10.2/codeina/__init__.py	2008-04-03 19:37:53.000000000 +0200
@@ -89,10 +89,19 @@ def run(options, patterns=None):
     log.info('codeina', "done with updating")
 
     if patterns:
-        # we have a pattern, show matches 
         ret = 0
+        # we have a pattern, show matches 
         for pattern in patterns:
-            # for now, show one window for each pattern
+            # check if one of the matching product is already installed
+            from codeina.providers import CodeinaProvider
+            providers_rank, matching_products = CodeinaProvider().get_products_for_pattern(pattern)
+            already_installed = False 
+            for p in matching_products:
+                p.flush_cache()
+                if p.is_fully_installed():
+                    already_installed = True
+            if already_installed: continue
+            # the product is really missing, try installing it
             l = ui.ShowMatches(pattern)
             ret += l.install ()
         return ret
diff -p -up codeina-0.10.2/bin/codeina.bin.multiplecodec codeina-0.10.2/bin/codeina.bin
--- codeina-0.10.2/bin/codeina.bin.multiplecodec	2008-04-03 19:37:29.000000000 +0200
+++ codeina-0.10.2/bin/codeina.bin	2008-04-03 19:37:37.000000000 +0200
@@ -101,8 +101,6 @@ def parse_arguments():
                 dest="transient_for", 
                 help="obsolete option, kept for backward compatibility")
         (options, args) = parser.parse_args()
-        if len(args) > 1:
-            print "Warning: more than one argument given"
         if len(args) > 0:
             # force no_update to False if a caps string is given
             if options.no_update == True: