def get_versions_in_directory(self, path, warnings=True): """ For a given directory, return a list of (Version,epoch), which match version directories found in the given directory. """ vers = self.versions.get(path) if vers is not None: return vers if not os.path.isdir(path): return [] k = ("VERSIONS", path) path_modtime = os.path.getmtime(path) if self.mc: t = self.mc.get(k) if t is not None: mtime, tvers = t if path_modtime == mtime: vers = [x for x in tvers if x[1] <= self.epoch] self.versions[path] = vers return vers tvers = rez_filesys.get_versions_in_directory(path, warnings) if self.mc: self.mc.set(k, (path_modtime, tvers)) vers = [x for x in tvers if x[1] <= self.epoch] self.versions[path] = vers return vers
def get_versions_in_directory(self, path, warnings=True, ignore_archived=False, ignore_blacklisted=False): """ For a given directory, return a list of (Version,epoch), which match version directories found in the given directory. """ qualifiedPath = path + str(int(ignore_archived)) + str(int(ignore_blacklisted)) vers = self.versions.get(qualifiedPath) if vers is not None: return vers if not os.path.isdir(path): return [] k = ("VERSIONS", qualifiedPath) path_modtime = os.path.getmtime(path) if self.mc: t = self.mc.get(k) if t is not None: mtime,tvers = t if path_modtime == mtime: vers = [x for x in tvers if x[1] <= self.epoch] self.versions[qualifiedPath] = vers return vers tvers = rez_filesys.get_versions_in_directory(path, warnings, ignore_archived, ignore_blacklisted, ) if self.mc: self.mc.set(k, (path_modtime, tvers)) vers = [x for x in tvers if x[1] <= self.epoch] self.versions[qualifiedPath] = vers return vers
def get_versions_in_directory(self, path, warnings=True): """ For a given directory, return a list of (Version,epoch), which match version directories found in the given directory. """ vers = self.versions.get(path) if vers is not None: return vers if not os.path.isdir(path): return [] k = ("VERSIONS", path) path_modtime = os.path.getmtime(path) if self.mc: t = self.mc.get(k) if t is not None: mtime,tvers = t if path_modtime == mtime: vers = [x for x in tvers if x[1] <= self.epoch] self.versions[path] = vers return vers tvers = rez_filesys.get_versions_in_directory(path, warnings) if self.mc: self.mc.set(k, (path_modtime, tvers)) vers = [x for x in tvers if x[1] <= self.epoch] self.versions[path] = vers return vers
if not opts.quiet: prog1 = ndir / progstep ndir = ndir + 1 prog2 = ndir / progstep if int(prog1) < int(prog2): sys.stdout.write('.') sys.stdout.flush() # tmp until rez is bootstrapped with itself if (f == "rez"): continue all_packages.add(f) vers = [x[0] for x in fs.get_versions_in_directory(fullpath, False)] if vers: filename = fullpath + '/' + str(vers[-1][0]) + "/package.yaml" metadict = yaml.load(open(filename).read()) reqs = metadict["requires"] if ("requires" in metadict) else [] vars = metadict["variants"] if ("variants" in metadict) else [] if len(reqs) + len(vars) > 0: fn_unver = lambda pkg: pkg.split('-')[0] deps = set(map(fn_unver, reqs)) for var in vars: deps = deps | set(map(fn_unver, var)) for dep in deps: if dep not in dependsMap:
if not os.path.isdir(fullpath): sys.stderr.write("'" + fullpath + "' is not a directory.\n") sys.exit(1) pkg_paths = [fullpath] else: for f in os.listdir(opts.path): if (f == "rez"): continue fullpath = os.path.join(opts.path, f) if os.path.isdir(fullpath): pkg_paths.append(fullpath) for fullpath in pkg_paths: vers = [x for x in fs.get_versions_in_directory(fullpath, False)] if vers: filename = fullpath + '/' + str(vers[-1][0]) + "/package.yaml" metadict = yaml.load(open(filename).read()) ln = fullpath.split('/')[-1] if opts.auth: ln = ln + " | " if "authors" in metadict: ln = ln + str(" ").join(metadict["authors"]) else: continue if opts.desc: ln = ln + " | "
def get_versions_in_directory(self, path, warnings=True): """ For a given directory, return a list of (Version,epoch), which match version directories found in the given directory. """ return rez_filesys.get_versions_in_directory(path, warnings)