4 Installation Wizard launching script.
6 This script is the part of the SALOME installation procedure.
7 Author : Vadim SANDLER, Open CASCADE SAS (vadim.sandler@opencascade.com)
8 Created : Thu Dec 18 12:01:00 2002
9 Copyright : 2002-2006 CEA
15 # --- avoid "deprecation" warnings --- #
17 warnings.filterwarnings("ignore", "", DeprecationWarning)
21 import sys, os, string, re
25 # --- global variables --- #
29 # --- XML tags definition --- #
30 __TAG__SOURCES__ = "install sources"
31 __TAG__BINARIES__ = "install binaries"
32 __TAG__NATIVE__ = "use native"
33 __TAG__PREINSTALL__ = "not install"
35 #------------------------------------------------------------------#
37 # COMMAND LINE ARGUMENTS PARSER #
39 #------------------------------------------------------------------#
41 #===================================================================
42 # class OptBaseError : base parse error
43 #===================================================================
44 class OptBaseError(Exception):
46 Base option parsing exception class
48 def __init__(self, msg):
53 #===================================================================
54 # class OptError : bad option error
55 #===================================================================
56 class OptError(OptBaseError):
58 Bad option exception class
60 def __init__ (self, msg, option):
66 if self.option.short_opt and self.option.long_opt:
67 opt_prs = "%s/%s"%(self.option.short_opt,self.option.long_opt)
68 elif self.option.short_opt:
69 opt_prs = "%s"%(self.option.short_opt)
70 elif self.option.long_opt:
71 opt_prs = "%s"%(self.option.long_opt)
72 return "option %s: %s"%(opt_prs, self.msg)
75 #===================================================================
76 # class ArgError : bad option argument error
77 #===================================================================
78 class ArgError(OptBaseError):
80 Bad argument exception class
84 #===================================================================
85 # class ValError : bad command line parameter error
86 #===================================================================
87 class ValError(OptBaseError):
89 Bad parameter exception class
93 #===================================================================
94 # class ArgOption : command line option
95 #===================================================================
100 attrs = ["short_opt", "long_opt", "dest", "action", "type", "default", "metavar", "help"]
101 actions = ["store", "store_true", "store_false"]
102 types = ["string", "int", "float", "bool"]
103 def __init__(self, *args, **kwargs):
105 for attr in self.attrs: setattr(self, attr, None)
107 for i in range(len(args)):
108 if i > len(self.attrs)-1:
109 msg = "Wrong number of parameters is given (maximum is %d)" % len(self.attrs)
110 raise OptBaseError(msg)
111 setattr(self, self.attrs[i], args[i])
113 if arg not in self.attrs:
114 msg = "Invalid argument: %s" % arg
115 raise OptBaseError(msg)
116 setattr(self, arg, kwargs[arg])
117 # check short option key
118 if self.short_opt and \
119 not re.match("^-[a-zA-Z]$",self.short_opt):
120 msg = "invalid short option key; "
121 msg += "should be of the form -x (x is letter)"
122 raise OptError(msg, self)
123 # check long option key
124 if self.long_opt and \
125 not re.match("^--[a-zA-Z][a-zA-Z0-9]*(-[a-zA-Z0-9]+)*$",self.long_opt):
126 msg = "invalid long option key; "
127 msg += "should be of the form --word[[-word]...] "
128 msg += "(word is letters and digits sequence)"
129 raise OptError(msg, self)
130 # check that at least one option key is defined
131 if not self.short_opt and not self.long_opt:
132 msg = "invalid option; neither short nor long option key is defined"
133 raise OptError(msg, self)
135 if not self.dest and self.long_opt:
136 self.dest = self.long_opt[2:].replace('-','_')
137 if not self.dest and self.short_opt:
138 self.dest = self.short_opt[1:]
141 self.action = "store"
142 if self.action not in self.actions:
143 msg = "invalid action: %s" % self.action
144 raise OptError(msg, self)
147 if self.action in ["store_true","store_false"]: self.type = "bool"
148 else: self.type = "string"
149 if self.type not in self.types:
150 msg = "invalid type: %s" % self.type
151 raise OptError(msg, self)
152 if self.action in ["store_true","store_false"] and self.type != "bool":
153 msg = "invalid type: %s : should be 'bool' or None" % self.type
154 raise OptError(msg, self)
158 if self.type == "string": self.default = str(self.default)
159 if self.type == "int": self.default = int(self.default)
160 if self.type == "float": self.default = float(self.default)
161 if self.type == "bool": self.default = boolean(self.default)
163 msg = "invalid default value type: should be %s" % self.type
164 raise OptError(msg, self)
168 self.metavar = self.dest.upper()
176 Returns string representation of the option
180 if opt and self.action == "store" and self.metavar: opt += " %s" % self.metavar
181 if opt: opts.append(opt)
183 if opt and self.action == "store" and self.metavar: opt += "=%s" % self.metavar
184 if opt: opts.append(opt)
185 return (", ").join(opts)
187 #===================================================================
188 # class Values : resulting option values
189 #===================================================================
197 #===================================================================
198 # class ArgParser : command line arguments parser
199 #===================================================================
202 Arguments parser class
208 def add_option(self, *args, **kwargs):
209 """Register an option"""
210 o = ArgOption(*args, **kwargs)
211 self._check_option(o)
212 self.options.append(o)
215 def parse_args(self, args = None):
216 """Parse an arguments"""
217 if not args: args = sys.argv[1:]
219 for o in self.options:
221 setattr(values, o.dest, o.default)
222 elif not hasattr(values,o.dest):
223 setattr(values, o.dest, None)
225 (values, args) = self._process_args(values, args)
226 except (ArgError, ValError), e:
229 return (values, args)
231 def print_usage(self):
233 print "usage: %s [options]" % os.path.basename(sys.argv[0])
236 def print_help(self):
241 _maxwidth, _indent = 79, 2
242 if len(self.options):
243 for option in self.options:
244 if olen < len(option.to_string()): olen = len(option.to_string())
246 for option in self.options:
248 for hs in option.help.split("\n"):
251 if len("%s %s" % (s,w)) > _maxwidth:
252 strings.append(s.strip()); s = ""
254 if s.strip(): strings.append(s.strip())
255 if not strings: strings[:0] = [""]
256 print "%s%s%s" % (option.to_string(), " "*(_indent+olen-len(option.to_string())), strings[0])
257 for i in range(1, len(strings)):
258 print "%s%s" % (" "*(olen+_indent), strings[i])
261 def _check_option(self, option):
262 o = self._get_option(option.short_opt)
263 if not o: o = self._get_option(option.long_opt)
265 msg = "option conflicts with previously defined option(s)"
266 raise OptError(msg, option)
269 def _get_option(self, opt_key):
271 for o in self.options:
272 if opt_key in [o.short_opt, o.long_opt]: return o
275 def _error(self, msg):
277 sys.exit("\n%s: error: %s\n" % (os.path.basename(sys.argv[0]), msg))
280 def _check_value(self, option, value):
281 o = self._get_option(option)
283 if o.type == "string": return str(value)
284 if o.type == "int": return int(value)
285 if o.type == "float": return float(value)
286 if o.type == "bool": return boolean(value)
288 msg = "invalid value type for option %s: %s; " % (option, value)
289 msg += "should be %s" % o.type
291 raise OptBaseError("unknown error")
293 def _process_args(self, values, args):
297 for index in range(len(args)):
299 if cur_opt and cur_opt[1].action == "store":
300 setattr(values, cur_opt[1].dest, self._check_value(cur_opt[0], a))
304 rargs = args[index+1:]
306 elif re.match("^-[a-zA-Z].*", a):
307 for i in range(1,len(a)):
308 if cur_opt and cur_opt[1].action == "store":
309 setattr(values, cur_opt[1].dest, self._check_value(cur_opt[0], a[i:]))
312 o = self._get_option("-%s"%a[i])
314 raise ArgError("no such option: -%s"%a[i])
315 if o.action == "store_true":
316 setattr(values, o.dest, True)
317 elif o.action == "store_false":
318 setattr(values, o.dest, False)
320 cur_opt = ("-%s"%a[i], o)
322 elif re.match("^--[a-zA-Z][a-zA-Z0-9]*(-[a-zA-Z0-9]+)*", a):
323 oname = ("%s="%a).split("=")[0]
324 ovalue = ("%s="%a).split("=")[1]
325 o = self._get_option(oname)
327 raise ArgError("no such option: %s" % oname)
328 if o.action == "store_true":
330 raise ValError("option %s does not take a value" % oname)
331 setattr(values, o.dest, True)
332 elif o.action == "store_false":
334 raise ValError("option %s does not take a value" % oname)
335 setattr(values, o.dest, False)
338 setattr(values, o.dest, self._check_value(oname, ovalue))
342 elif a.startswith("-"):
343 raise ArgError("bad formatted option: %s" % a)
347 if cur_opt and cur_opt[1].action == "store":
348 raise ValError("option %s requires value" % cur_opt[0])
349 return (values, rargs)
351 #------------------------------------------------------------------#
353 # XML CONFIGURATION FILES PARSER #
355 #------------------------------------------------------------------#
357 #===================================================================
358 # class Config : general configuration options : version, OS, etc...
359 #===================================================================
362 General configuration file options:
363 - Install Wizard window caption
364 - SALOME platform version
365 - Copyright and libcense info
366 - Target Linux OS version
374 self.version = strip(theVersion)
375 self.caption = strip(theCaption)
376 self.copyright = strip(theCopyright)
377 self.license = strip(theLicense)
378 self.os = strip(theOS)
380 #===================================================================
381 # class Path : default target, temporary directories options
382 #===================================================================
386 - default target directory
387 - default temporary directory
392 self.targetdir = strip(theTargetdir)
393 self.tmpdir = strip(theTmpdir)
395 #==============================================================
396 # class Product : pre-requisite product options
397 #==============================================================
402 - supported installation modes and the default one
404 - required disk space
405 - installation script
412 theSupportred = None,
413 theDependencies = None,
414 theInstalldiskspace = None,
415 theTemporarydiskspace = None,
417 thePickUpEnvironment = None):
418 self.name = strip(theName)
419 self.version = strip(theVersion)
420 self.install = strip(theInstall)
421 self.supported = strip(theSupportred)
422 self.dependencies = strip(theDependencies)
423 self.installdiskspace = strip(theInstalldiskspace)
424 self.temporarydiskspace = strip(theTemporarydiskspace)
425 self.script = strip(theScript)
426 self.pickupEnv = strip(thePickUpEnvironment)
428 #===================================================================
429 # class ConfigParser : XML files parser implementation
430 #===================================================================
431 class ConfigParser(xmllib.XMLParser):
433 XML configuration files parser
436 xmllib.XMLParser.__init__(self)
438 self.currentdata = []
442 def handle_data(self, data):
443 self.currentdata.append(data)
445 def start_product(self, attrs):
446 if not attrs.get('name', '').strip(): return
447 if check_bool(attrs.get('disable', 'false')): return
448 aProduct = Product(attrs.get('name'),
449 attrs.get('version', None),
450 attrs.get('install', None),
451 attrs.get('supported', None),
452 attrs.get('dependancies', None),
453 attrs.get('installdiskspace', None),
454 attrs.get('temporarydiskspace', None),
455 attrs.get('script', None),
456 attrs.get('pickupenv', None))
457 self.products.append(aProduct)
460 def end_product(self):
463 def start_config(self, attrs):
464 self.config = Config(attrs.get('version', None),
465 attrs.get('caption', None),
466 attrs.get('copyright', None),
467 attrs.get('license', None),
468 attrs.get('os', None))
471 def end_config(self):
474 def start_path (self, attrs):
475 self.path = Path(attrs.get('targetdir', None),
476 attrs.get('tempdir', None))
482 def getProduct(self, prod):
483 for product in self.products:
484 if product.name == prod:
488 #------------------------------------------------------------------#
490 # SERVICE FUNCTIONS #
492 #------------------------------------------------------------------#
494 #==============================================================
495 # message: prints diagnostic information
496 #==============================================================
499 Prints diagnostic information.
505 #==============================================================
506 # warning: prints warning
507 #==============================================================
518 #==============================================================
519 # error_exit : prints (optionally) error string, then prints
520 # help information and quits
521 #==============================================================
522 def error_exit(msg = "", print_help = True):
524 Prints (optionally) error string,
525 then prints help information and quits.
527 # print error message
532 # print help information
536 opt_parser.print_help()
544 #==============================================================
545 # boolean : Converts string to boolean value.
546 #==============================================================
549 Converts string to boolean value if possible.
550 Raises exception if wrong string is used.
552 if isinstance(val, types.StringType):
553 if val.strip().lower() in ["true", "yes", "ok"] : return True
554 elif val.strip().lower() in ["false", "no", "cancel"] : return False
555 else: raise TypeError("invalid boolean value")
558 #=================================================================
559 # check_bool : checks boolean value: yes/no, true/false, 1/0
560 #=================================================================
563 Checks boolean value.
571 #==============================================================
572 # clean_all : performs system cleaning before exiting
573 #==============================================================
576 Performs system cleaning before exiting.
579 remove_dir(root_path)
582 #==============================================================
583 # parse_parameters : parses command line arguments
584 #==============================================================
585 def parse_parameters():
587 Parses command line arguments.
590 opt_parser = ArgParser()
592 help_str = "Runs the Installation Wizard in the GUI mode [default].\n"
593 opt_parser.add_option("-g",
599 help_str = "Runs the Installation Wizard in the TUI mode."
600 opt_parser.add_option("-b",
602 action="store_false",
605 help_str = "The configuration xml file.\n"
606 help_str += "If this parameter is missing, then the program tries to define the "
607 help_str += "Linux platform and use the corresponding xml file. For example, "
608 help_str += "for Red Hat 8.0 config_RedHat_8.0.xml file is used in this case. "
609 help_str += "If program fails to define target Linux platform or the corresponding "
610 help_str += "xml file is not provided with the Installation Wizard, then default "
611 help_str += "config.xml file is used."
612 opt_parser.add_option("-f",
618 help_str = "The target directory the products to be installed to.\n"
619 help_str += "When used this parameter overrides the default target directory "
620 help_str += "defined in the configuration xml file."
621 opt_parser.add_option("-d",
627 help_str = "The directory to be used for temporary files.\n"
628 help_str += "When used this parameter overrides the default temporary directory "
629 help_str += "defined in the configuration xml file."
630 opt_parser.add_option("-t",
636 help_str = "Prints version information and quits."
637 opt_parser.add_option("-v",
641 help_str = "Prints this help and quits."
642 opt_parser.add_option("-h",
646 (options, args) = opt_parser.parse_args()
648 # print help info and quit
649 print "\nSALOME Installation Wizard\n"
650 opt_parser.print_help()
654 # print version info and quit
656 cmd = "./bin/SALOME_InstallWizard --version"
660 return [options.xmlfile, options.target_dir, options.tmp_dir, options.gui]
662 #=================================================================
663 # strip : removes spaces at the beginning and at the end of the
664 # <param> if it is of string type
665 #=================================================================
668 Removes spaces at the beginning and at the end
669 of the given parameter.
671 if type(param) == types.StringType:
675 #=================================================================
676 # get_dependencies : extract products dependencies
677 #=================================================================
678 def get_dependencies(prods):
680 Gets full list of pre-requisite products.
683 for product in prods:
684 deps = product.dependencies.split(",")
686 if dep and not dep in list:
689 if product and not product in list:
690 list.append( product.name )
692 return " ".join( list )
694 #==============================================================
695 # create_dir : creates a directory with (optional) permissions,
696 # returns the part of path that existed before
697 # directory creation; exits with error if access
699 #==============================================================
700 def create_dir(directory, access = 0777):
702 Creates a directory with (optional) permissions,
703 returns the part of path that existed before
704 directory creation; exits with error if access
707 dirs = string.split(directory, "/")
712 if len(subdir) == 0: continue
713 dir = "%s/%s"%(dir, subdir)
714 if os.path.exists(dir):
718 os.mkdir(dir, access)
720 error_exit("Can't create directory: %s.\nAccess is denied."%directory)
721 if dir == "%s/%s"%(existing, subdir):
725 #==============================================================
726 # substituteVars : performes environment variables substistution
727 # the given string; if varibale is not defined
728 # it is substituted by the empty string
729 #==============================================================
730 def substituteVars(str):
732 Performes environment variables substistution.
734 str = os.path.expanduser(str)
735 str = os.path.expandvars(str)
738 #================================================================
739 # get_program_path : gets program's directory path
740 # (and performs 'cd' command there)
741 #================================================================
742 def get_program_path():
744 Returns the program directory path
745 (and make this directory current).
747 path = os.path.dirname(sys.argv[0])
752 #================================================================
753 # check_dir : checks directory existence
754 #================================================================
757 Checks directory existence.
759 if (os.path.islink(dir)):
760 realpath = os.path.realpath(dir)
761 if not os.path.exists(realpath):
762 msg = "Invalid link %s.\nThe directory %s a link points to does not exist. Stopped..."%(dir,realpath)
763 error_exit(msg, False)
765 if not os.path.exists(dir):
766 msg = "Directory %s does not exist. Stopped..."%dir
767 error_exit(msg, False)
770 #===============================================================
771 # check_disk_space : checks the disk space;
772 # quits if there is no enough disk space
773 #===============================================================
774 def check_disk_space(products, scripts_dir, target_dir, tmp_dir):
776 Checks if there is enough disk space to install products.
777 Quits with error if there is no enough disk space.
781 for product in products:
782 if product.install in [__TAG__NATIVE__, __TAG__PREINSTALL__]:
784 spaces = string.split(product.installdiskspace, ',')
785 prod_space = spaces[0]
786 if (len(spaces) > 1 ) and (product.install == __TAG__SOURCES__):
787 prod_space = spaces[1]
788 install_space = install_space + string.atoi(prod_space)
789 if product.install == __TAG__SOURCES__:
790 temporary_space = max(temporary_space, string.atoi(product.temporarydiskspace))
792 res = os.system("%s/%s %s %d"%(scripts_dir, "checkSize.sh", target_dir, install_space))
794 msg = "There is no enough space to install the products. Stopped..."
795 error_exit(msg, False)
797 res = os.system("%s/%s %s %d"%(scripts_dir, "checkSize.sh", tmp_dir, temporary_space))
799 msg = "There is no enough space for temporary directory. Stopped..."
800 error_exit(msg, False)
803 #===============================================================
804 # remove_dir : removes temporary directory
805 #===============================================================
806 def remove_dir(path):
808 Removes temporary directory.
810 if path and os.path.exists(path):
811 os.system("rm -rf " + path)
814 #==============================================================
815 # has_binaries : returns True if some product is installed from
817 #===============================================================
818 def has_binaries(products):
820 Returns True if some product is installed in 'binaries' mode.
822 for product in products:
823 if product.install == __TAG__BINARIES__:
827 #==============================================================
828 # has_sources : returns True if some product is installed from
830 #===============================================================
831 def has_sources(products):
833 Returns True if some product is installed in 'sources' mode.
835 for product in products:
836 if product.install == __TAG__SOURCES__:
840 #==============================================================
841 # get_tmp_dir : gets temporary directory name
842 #===============================================================
843 def get_tmp_dir(dir):
845 Gets temporary directory path.
848 dir_prefix="INSTALLWORK"
849 range_bottom = 0; range_top = 999999
850 for i in xrange(max_attempts):
851 tmp_dir = "%s/%s%d"%(dir, dir_prefix, random.randint(range_bottom,range_top))
852 if not os.path.exists( tmp_dir ):
854 return "%s/%s%d"%(dir, dir_prefix, random.randint(range_bottom,range_top))
856 #------------------------------------------------------------------#
858 # EXECUTION STARTS HERE #
860 #------------------------------------------------------------------#
862 if __name__ == "__main__":
864 [xml_file, target_dir, tmp_dir, is_gui] = parse_parameters()
865 if xml_file: xml_file = os.path.abspath(xml_file)
866 if target_dir: target_dir = os.path.abspath(target_dir)
867 if tmp_dir: tmp_dir = os.path.abspath(tmp_dir)
869 cur_dir = get_program_path()
871 # define xml file to be used
872 if (xml_file is None):
876 xml_file_name = "config.xml"
877 if os.path.exists("/etc/redhat-release"):
878 # - Red Hat Linux 8.0
880 # - Mandrake Linux 10.1
881 # - Scientific Linux 3.0.5
882 # - Mandriva 2006.0 32bit/64bit
883 data = open("/etc/redhat-release").readline()
884 res = re.search(r'(.*)[L|l]inux.*release\s+([\d.]*)', data)
886 plt_name = "".join(res.group(1).split())
887 plt_ver = res.group(2)
888 if re.search(r'x86_64', data):
890 elif os.path.exists("/etc/debian_version"):
893 plt_ver = open("/etc/debian_version").readline().strip()
894 elif os.path.exists("/etc/mandriva-release"):
895 # - Mandriva 2006 (an additional check if above check fails)
896 data = open("/etc/mandriva-release").readline()
897 res = re.search(r'(.*)[L|l]inux.*release\s+([\d.]*)', data)
899 plt_name = "".join(res.group(1).split())
900 plt_ver = res.group(2)
901 if re.search(r'x86_64', data):
904 _xml_file_name = "config_%s_%s%s.xml"%(plt_name, plt_ver, plt_bit)
905 if plt_name and plt_ver and os.path.exists("%s/%s"%(cur_dir, _xml_file_name)):
906 xml_file_name = _xml_file_name
908 msg = "Not supported Linux platform!\n"
909 msg += "Trying to use default configuration file!"
912 xml_file = "%s/%s"%(cur_dir, xml_file_name)
914 if not xml_file or not os.path.exists(xml_file):
915 msg = "Configuration file %s is not found!"%xml_file
918 if not os.access(xml_file, os.R_OK):
919 msg = "There is no read access for %s file!"%xml_file
922 #---- GUI ----------------
926 if not env.has_key("PATH") :
928 if not env.has_key("LD_LIBRARY_PATH") :
929 env["LD_LIBRARY_PATH"] = ""
931 env["LD_LIBRARY_PATH"] = ".:" + env["LD_LIBRARY_PATH"]
932 env["PATH"] = ".:" + env["PATH"]
934 cmd = "./bin/SALOME_InstallWizard --file %s"%xml_file
935 if target_dir is not None:
936 cmd += " --target %s"%target_dir
937 if tmp_dir is not None:
938 cmd += " --tmp %s"%tmp_dir
940 sys.exit(os.system(cmd))
942 #----- TUI ---------------------
944 # parse XML file -----------
945 message("Parsing XML configuration file: %s"%xml_file)
946 filehandle = open(xml_file)
947 data = filehandle.read()
949 parser = ConfigParser()
954 what_to_do = { __TAG__SOURCES__ : "install_source",
955 __TAG__BINARIES__ : "install_binary",
956 __TAG__NATIVE__ : "try_native",
957 __TAG__PREINSTALL__ : "try_preinstalled"}
958 # source directory map
961 bin_dir += "/%s"%parser.config.os
962 subdir = { __TAG__SOURCES__ : "SOURCES",
963 __TAG__BINARIES__ : "BINARIES" + bin_dir,
964 __TAG__NATIVE__ : "",
965 __TAG__PREINSTALL__ : ""}
967 # check scripts directory -----------
968 scripts_dir = "%s/%s"%(cur_dir, "config_files")
969 check_dir(scripts_dir)
971 # check products archives directories -----------
972 has_bin = has_binaries(parser.products)
973 has_src = has_sources(parser.products)
974 source_dir = "%s/%s"%(cur_dir, "Products")
976 if has_src or has_bin:
977 check_dir(source_dir)
980 check_dir("%s/%s"%(source_dir,subdir[__TAG__SOURCES__]))
983 check_dir("%s/%s"%(source_dir,subdir[__TAG__BINARIES__]))
985 # check/create target dir -----------
986 if target_dir is None:
987 target_dir = parser.path.targetdir
988 target_dir = substituteVars(target_dir)
990 message("Creating target directory: " + target_dir)
991 create_dir(target_dir, 0755)
993 if not os.path.exists(target_dir):
994 error_exit("Invalid target directory: " + target_dir)
996 if not os.access(target_dir, os.W_OK) :
997 error_exit("There is no write permissions for the directory: " + target_dir)
999 # check/create temporary dir -----------
1001 tmp_dir = parser.path.tmpdir
1004 tmp_dir = substituteVars(tmp_dir)
1005 tmp_dir = get_tmp_dir(tmp_dir)
1007 message("Creating temporary directory: " + tmp_dir)
1008 root_path = create_dir(tmp_dir, 0755)
1010 if not os.path.exists(tmp_dir):
1011 error_exit("Invalid temporary directory: " + tmp_dir)
1013 if not os.access(tmp_dir, os.W_OK) :
1014 error_exit("There is no write permissions for the directory: " + tmp_dir)
1016 # check available disk space -----------
1017 message("Checking available disk space")
1018 check_disk_space(parser.products, scripts_dir, target_dir, tmp_dir)
1020 # change current directory -----------
1021 os.chdir(scripts_dir)
1023 # get dependencies list -----------
1024 list_of_dep = get_dependencies(parser.products)
1026 # starting -----------
1027 message("Starting ...")
1029 # install products -----------
1030 for product in parser.products:
1031 message("... processing %s ..."%product.name)
1032 cmd = '%s/%s %s %s %s/%s %s "%s" %s'%(scripts_dir,
1034 what_to_do[product.install],
1037 subdir[product.install],
1041 res = os.system(cmd)
1043 # pickup environment -----------
1044 message("Creating environment files")
1045 for product in parser.products :
1046 if check_bool(product.pickupEnv):
1047 cmd = '%s/%s pickup_env %s %s/%s %s "%s" %s'%(scripts_dir,
1051 subdir[product.install],
1055 res = os.system(cmd)
1057 # clean temporary directory -----------
1058 message("Cleaning temporary directory")
1061 # finishing -----------
1062 message("Finished!")