Salome HOME
Merge branch 'nct/jan21' of https://codev-tuleap.cea.fr/plugins/git/salome/sat into...
[tools/sat.git] / commands / patch.py
index 23ed3d5021773f547913705f414d075ec7879fd4..ec438655fd61df9be55ada8452628d251ee8fc97 100644 (file)
@@ -18,6 +18,7 @@
 
 import os
 import subprocess
+import re
 
 import src
 import prepare
@@ -25,8 +26,7 @@ import prepare
 # Define all possible option for patch command :  sat patch <options>
 parser = src.options.Options()
 parser.add_option('p', 'products', 'list2', 'products',
-    _('Optional: products to get the sources. This option can be'
-    ' passed several time to get the sources of several products.'))
+    _('Optional: products to get the sources. This option accepts a comma separated list.'))
 
 def apply_patch(config, product_info, max_product_name_len, logger):
     '''The method called to apply patches on a product
@@ -80,10 +80,8 @@ def apply_patch(config, product_info, max_product_name_len, logger):
         
         # Check the existence and apply the patch
         if os.path.isfile(patch):
-            patch_exe = "patch" # old patch command (now replace by patching.py)
-            #patch_exe = os.path.join(config.VARS.srcDir, "patching.py")
-            patch_cmd = "%s -p1 < %s" % (patch_exe, patch)
-
+            patch_cmd = "patch -p1 < %s" % patch
+            
             # Write the command in the terminal if verbose level is at 5
             logger.write(("    >%s\n" % patch_cmd),5)
             
@@ -151,7 +149,7 @@ def run(args, runner, logger):
     logger.write("\n", 2, False)
 
     # Get the products list with products informations regarding the options
-    products_infos = prepare.get_products_list(options, runner.cfg, logger)
+    products_infos = src.product.get_products_list(options, runner.cfg, logger)
     
     # Get the maximum name length in order to format the terminal display
     max_product_name_len = 1
@@ -185,4 +183,4 @@ def run(args, runner, logger):
     logger.write(" " + src.printcolors.printc(status), 1, False)
     logger.write(" (%s)\n" % res_count, 1, False)
     
-    return len(products_infos) - good_result
\ No newline at end of file
+    return len(products_infos) - good_result