appli_tag = "application"
prereq_tag = "prerequisites"
context_tag = "context"
+sha1_collect_tag = "sha1_collections"
system_conf_tag = "system_conf"
modules_tag = "modules"
module_tag = "module"
if self.space == [appli_tag, context_tag] and path_att in attrs.getNames():
self.config["context_path"] = attrs.getValue( path_att )
pass
+ # --- if we are analyzing "sha1_collection" element then store its "path" attribute
+ if self.space == [appli_tag, sha1_collect_tag] and path_att in attrs.getNames():
+ self.config["sha1_collect_path"] = attrs.getValue( path_att )
+ pass
# --- if we are analyzing "system_conf" element then store its "path" attribute
if self.space == [appli_tag, system_conf_tag] and path_att in attrs.getNames():
self.config["system_conf_path"] = attrs.getValue( path_att )
print "WARNING: context file does not exist"
pass
+ if _config.has_key("sha1_collect_path") and os.path.isfile(_config["sha1_collect_path"]):
+ shutil.copyfile(_config["sha1_collect_path"],
+ os.path.join(home_dir, 'sha1_collections.txt'))
+ pass
+ else:
+ print "WARNING: context file does not exist"
+ pass
+
if _config.has_key("system_conf_path") and os.path.isfile(_config["system_conf_path"]):
shutil.copyfile(_config["system_conf_path"],
os.path.join(home_dir, 'env.d', 'envConfSystem.sh'))
return runTests.runTests(args, exe="salome test")
#
- def _showSoftwareVersions(self):
+ def _showSoftwareVersions(self, softwares=None):
config = ConfigParser.SafeConfigParser()
absoluteAppliPath = os.getenv('ABSOLUTE_APPLI_PATH')
- filename = os.path.join(absoluteAppliPath, ".softwares_versions")
- try:
- config.read(filename)
- sections = config.sections()
- for section in sections:
- entries = config.items(section, raw=True) # do not use interpolation
- for key,val in entries:
- version,text = [ x.strip() for x in val.split(',') ]
- print "%s: %s"%(text, version)
- except:
- import traceback
- traceback.print_exc()
- return
+ filename = os.path.join(absoluteAppliPath, "sha1_collections.txt")
+ versions = {}
+ max_len = 0
+ with open(filename) as f:
+ for line in f:
+ try:
+ software, version, sha1 = line.split()
+ versions[software.upper()] = version
+ if len(software) > max_len:
+ max_len = len(software)
+ except:
+ pass
+ pass
+ pass
+ if softwares:
+ for soft in softwares:
+ if versions.has_key(soft.upper()):
+ print soft.upper().rjust(max_len), versions[soft.upper()]
+ else:
+ for name, version in versions.items():
+ print name.rjust(max_len), versions[name]
pass
def _showInfo(self, args=None):