product.install = re.sub(r'^\s+', "", product.install)
product.install = re.sub(r'\s+$', "", product.install)
- if product.disable == "true" or product.install == "use native":
+ if product.disable == "true" or product.install == "use native" or product.install == "not install":
continue
spaces = string.split( product.installdiskspace,',')
prod_space = spaces[0]
return 1
-
+#===============================================================
+# Removes temporary directory
+#===============================================================
+def remove_dir( rem_path = "" ):
+ if len( rem_path ) and os.path.exists( rem_path ):
+ os.system( "rm -rf " + rem_path )
+ pass
+
#================================================================
# main
#================================================================
xml_file = cur_dir + xml_file_name
if xml_file is None or not os.path.exists(xml_file):
- error_exit("No xml file is found try to run with options -f <xmlfile>")
+ error_exit("No xml file is found, try to run with options -f <xmlfile>")
if not os.access(xml_file, os.R_OK):
- print "There is no acceess to read "+ xml_file
+ print "There is no read access for "+ xml_file
sys.exit(1)
#---- GUI ----------------
# definitions :
# map
- what_to_do = { "install sources":"install_source",
- "install binaries":"install_binary",
- "use native":"try_native"}
+ what_to_do = { "install sources" : "install_source",
+ "install binaries" : "install_binary",
+ "use native" : "try_native",
+ "not install" : "try_preinstalled"}
# define tmp dir -----------
if tmp_dir is None:
tmp_dir = parser.path.tmpdir
+ if tmp_dir is None or tmp_dir == "":
+ tmp_dir = "/tmp"
+ import random
+ tmp_dir = tmp_dir + "/INSTALLWORK" + str(random.randint(10000,100000))
root_path = ""
if not os.path.exists(tmp_dir):
- print "Creating " + tmp_dir; root_path = create_dir(tmp_dir) ;
- import random
- tmp_dir = tmp_dir + "/INSTALLWORK" + str(random.randint(10000,100000))
- create_dir(tmp_dir,0755)
- if not os.path.exists(tmp_dir):
- error_exit("There is no tmp directory " + tmp_dir + ". Use -tmp key to set directory or correct xml file\n\n")
+ print "Creating " + tmp_dir; root_path = create_dir(tmp_dir, 0755) ;
+ if not os.path.exists(tmp_dir):
+ error_exit("Invalid temporary directory " + tmp_dir + ". Use -tmp key to set directory or correct xml file\n\n")
if not os.access(tmp_dir, os.W_OK) :
- str = "We have no write permissions for directory " + tmp_dir + ". Use -tmp key to set directory or correct xml file"
+ str = "There is no write permissions for directory " + tmp_dir + ". Use -tmp key to set directory or correct xml file"
error_exit(str)
# define target dir --------
error_exit("There is no target directory " + target_dir + ". Use -t key to set directory or correct xml file\n\n")
if not os.access(target_dir, os.W_OK) :
- str = "We have no write permissions for directory " + target_dir + ". Use -t key to set directory or correct xml file"
+ str = "There is no write permissions for directory " + target_dir + ". Use -t key to set directory or correct xml file."
error_exit(str)
# define products dir ------------
source_dir = cur_dir + "Products" ;
if not check_dir(source_dir):
- if len(root_path) and os.path.exists(root_path):
- os.system("rm -r -f "+ root_path)
+ remove_dir(root_path)
sys.exit(1)
subdir = {"install sources" : "SOURCES",
"install binaries" : "BINARIES/"+parser.config.os,
- "use native": ""}
+ "use native" : "",
+ "not install" : ""}
# define scripts dir ------------
scripts_dir = cur_dir + "config_files/"
if not check_dir(scripts_dir):
- if len(root_path) and os.path.exists(root_path):
- os.system("rm -r -f "+ root_path)
+ remove_dir(root_path)
sys.exit(1)
os.chdir(scripts_dir)
product.name
res = os.system(cmd)
- if res : break;
+ #if res : break; # try_preinstalled can return 1
# pickup environment
for product in parser.products :
res = os.system(cmd)
- if len(root_path) and os.path.exists(root_path):
- os.system("rm -r -f "+ root_path)
+ remove_dir(root_path)