def createFiles(self): """ Creates the absolute filename for the module. """ module_path = installPath('mod') # general module class general_class = 'all' # Fake mode: set installpath to temporary dir if self.fake: self.tmpdir = tempfile.mkdtemp() log.debug("Fake mode: using %s (instead of %s)" % (self.tmpdir, module_path)) module_path = self.tmpdir # Real file goes in 'all' category self.filename = os.path.join(module_path, general_class, self.app.name(), self.app.installversion()) # Make symlink in moduleclass category classPath = os.path.join(module_path, self.app.getcfg('moduleclass'), self.app.name()) classPathFile = os.path.join(classPath, self.app.installversion()) # Create directories and links for directory in [os.path.dirname(x) for x in [self.filename, classPathFile]]: if not os.path.isdir(directory): try: os.makedirs(directory) except OSError, err: log.exception("Couldn't make directory %s: %s" % (directory, err))
packages.extend(processEasyconfig(eb_file, log, blocks)) except IOError, err: log.error("Processing easyconfigs in path %s failed: %s" % (path, err)) ## Before building starts, take snapshot of environment (watch out -t option!) origEnviron = copy.deepcopy(os.environ) os.chdir(os.environ["PWD"]) ## Skip modules that are already installed unless forced if not options.force: m = Modules() packages, checkPackages = [], packages for package in checkPackages: module = package["module"] mod = "%s (version %s)" % (module[0], module[1]) modspath = os.path.join(config.installPath("mod"), "all") if m.exists(module[0], module[1], modspath): msg = "%s is already installed (module found in %s), skipping " % (mod, modspath) print_msg(msg, log) log.info(msg) else: packages.append(package) ## Determine an order that will allow all specs in the set to build if len(packages) > 0: print_msg("resolving dependencies ...", log) orderedSpecs = resolveDependencies(packages, options.robot, log) else: print_msg("No packages left to be built.", log) orderedSpecs = []