def get_expected(f): exp_lines = ["set name=pkg.fmri value={0}".format(f)] for dc in self.dcs.values(): repo = dc.get_repo() mpath = repo.manifest(f) if not os.path.exists(mpath): # Not in this repository, check next. continue m = open(mpath, "r") for l in m: if l.find("name=pkg.fmri") > -1: continue if l.find("name=variant") > -1: continue if not l.strip(): continue exp_lines.append(l.strip()) m.close() if f.pkg_name in ("tree", "scheme"): # These packages are only published for sparc. exp_lines.append("set name=variant.arch value=sparc") else: # Everything else is published for all variants. exp_lines.append( "set name=variant.arch value=sparc value=i386") return "\n".join(sorted(exp_lines))
def get_expected(f): exp_lines = ["set name=pkg.fmri value=%s" % f] for dc in self.dcs.values(): repo = dc.get_repo() mpath = repo.manifest(f) if not os.path.exists(mpath): # Not in this repository, check next. continue m = open(mpath, "rb") for l in m: if l.find("name=pkg.fmri") > -1: continue if l.find("name=variant") > -1: continue if not l.strip(): continue exp_lines.append(l.strip()) m.close() if f.pkg_name in ("tree", "scheme"): # These packages are only published for sparc. exp_lines.append("set name=variant.arch value=sparc") else: # Everything else is published for all variants. exp_lines.append("set name=variant.arch value=sparc value=i386") return "\n".join(sorted(exp_lines))