def lock_to_table_row(server, lock, no_abbrev): name = "(any)" channel = "(any)" importance = "(any)" # A match should have a glob or a dep, never both. if lock.has_key("glob"): name = lock["glob"] if lock.has_key("dep"): name = rcformat.dep_to_str(lock["dep"]) if lock.has_key("channel"): channel = rcchannelutils.channel_id_to_name(server, lock["channel"]) if not channel: return None if not no_abbrev: channel = rcformat.abbrev_channel_name(channel) if lock.has_key("importance_num"): imp = rcformat.importance_num_to_str(lock["importance_num"]) op = (lock["importance_gteq"] and "<=") or ">=" importance = op + " " + imp return [name, channel, importance]
def execute(self, server, options_dict, non_option_args): if len(non_option_args) < 1: self.usage() sys.exit(1) plist = [] for a in non_option_args: plist = plist + rcpackageutils.find_package(server, a, 1) if not plist: rctalk.message("--- No packages found ---") sys.exit(1) for pkg in plist: dep_info = server.rcd.packsys.package_dependency_info(pkg) if not dep_info.has_key("provides"): continue rctalk.message("--- %s %s ---" % (pkg["name"], rcformat.evr_to_str(pkg))) for dep in dep_info["provides"]: rctalk.message(rcformat.dep_to_str(dep)) rctalk.message("")
def execute(self, server, options_dict, non_option_args): danglers = server.rcd.packsys.find_dangling_requires() if not danglers: rctalk.message("No dangling requires found.") sys.exit(0) table = [] for d in danglers: pkg = d[0]["name"] cid = d[0].get("channel", d[0].get("channel_guess", 0)) channel = rcchannelutils.channel_id_to_name(server, cid) if not channel: channel = "(none)" for r in d[1:]: table.append([pkg, channel, rcformat.dep_to_str(r)]) pkg = "" channel = "" rcformat.tabular(["Package", "Channel", "Requirement"], table)
def execute(self, server, options_dict, non_option_args): if len(non_option_args) < 1: self.usage() sys.exit(1) no_abbrev = options_dict.has_key("no-abbrev") plist = [] for a in non_option_args: plist = plist + rcpackageutils.find_package(server, a, 1) if not plist: rctalk.message("--- No packages found ---") sys.exit(1) for pkg in plist: dep_info = server.rcd.packsys.package_dependency_info(pkg) if not dep_info.has_key("children"): continue table = [] row_spec = ["name", "channel"] row_headers = ["Provided By", "Channel"] pad = [] if options_dict.has_key("show-versions"): row_spec.insert(1, "version") row_headers.insert(1, "Version") pad = pad + [""] if options_dict.has_key("all-providers"): row_spec.insert(2, "installed") row_headers.insert(2, "S") pad = pad + [""] for dep in dep_info["children"]: providers = map(lambda x:x[0], server.rcd.packsys.what_provides(dep)) prov_dict = {} name = rcformat.dep_to_str(dep) status = "*" for prov in providers: if prov["installed"]: status = "" if status == "" \ and not options_dict.has_key("all-providers"): providers = filter(lambda x:x["installed"], providers) count = 0 for prov in providers: row = rcformat.package_to_row(server, prov, no_abbrev, row_spec) key = string.join(row) if not prov_dict.has_key(key): table.append([status, name] + row) prov_dict[key] = 1 status = "" name = "" count = count + 1 if count == 0: table.append(["*", name, "(none)", "(none)"] + pad) elif count > 1 and not rctalk.be_terse: table.append(["", "", "", ""] + pad) if len(plist) > 1: rctalk.message("--- %s %s ---" % (pkg["name"], rcformat.evr_to_str(pkg))) if not table: rctalk.message("--- No Children ---") else: rcformat.tabular(["!", "Requirement"] + row_headers, table) if len(plist) > 1: rctalk.message("")
def execute(self, server, options_dict, non_option_args): if len(non_option_args) < 1: self.usage() sys.exit(1) plist = [] for a in non_option_args: plist = plist + rcpackageutils.find_package(server, a, 1) if not plist: rctalk.message("--- No packages found ---") sys.exit(1) for pkg in plist: dep_info = server.rcd.packsys.package_dependency_info(pkg) if not dep_info.has_key("obsoletes"): continue table = [] for dep in dep_info["obsoletes"]: provided_by = map(lambda x:x[0], server.rcd.packsys.what_provides(dep)) ob_dict = {} name = rcformat.dep_to_str(dep) status = "" for provider in provided_by: if provider["installed"]: status = "*" count = 0 for provider in provided_by: # skip self-obsoletes if evr_eq(provider, pkg): continue if provider["installed"]: status = "*" else: status = "" row = rcformat.package_to_row(server, provider, 0, ["name", "installed", "channel"]) key = string.join(row) if not ob_dict.has_key(key): table.append([status, name] + row) ob_dict[key] = 1 status = "" name = "" count = count + 1 if count == 0: table.append(["", name, "", "", ""]) elif count > 1: table.append(["", "", "", "", ""]) if len(plist) > 1: rctalk.message("--- %s %s ---" % (pkg["name"], rcformat.evr_to_str(pkg))) if not table: rctalk.message("--- No obsoletes ---") else: rcformat.tabular(["!", "Obsoletes", "Provided by", "S", "Channel"], table) if len(plist) > 1: rctalk.message("")
def execute(self, server, options_dict, non_option_args): if len(non_option_args) < 1: self.usage() sys.exit(1) no_abbrev = options_dict.has_key("no-abbrev") plist = [] for a in non_option_args: plist = plist + rcpackageutils.find_package(server, a, 1) if not plist: rctalk.message("--- No packages found ---") sys.exit(1) for pkg in plist: dep_info = server.rcd.packsys.package_dependency_info(pkg) if not dep_info.has_key("children"): continue table = [] row_spec = ["name", "channel"] row_headers = ["Provided By", "Channel"] pad = [] if options_dict.has_key("show-versions"): row_spec.insert(1, "version") row_headers.insert(1, "Version") pad = pad + [""] if options_dict.has_key("all-providers"): row_spec.insert(2, "installed") row_headers.insert(2, "S") pad = pad + [""] for dep in dep_info["children"]: providers = map(lambda x: x[0], server.rcd.packsys.what_provides(dep)) prov_dict = {} name = rcformat.dep_to_str(dep) status = "*" for prov in providers: if prov["installed"]: status = "" if status == "" \ and not options_dict.has_key("all-providers"): providers = filter(lambda x: x["installed"], providers) count = 0 for prov in providers: row = rcformat.package_to_row(server, prov, no_abbrev, row_spec) key = string.join(row) if not prov_dict.has_key(key): table.append([status, name] + row) prov_dict[key] = 1 status = "" name = "" count = count + 1 if count == 0: table.append(["*", name, "(none)", "(none)"] + pad) elif count > 1 and not rctalk.be_terse: table.append(["", "", "", ""] + pad) if len(plist) > 1: rctalk.message("--- %s %s ---" % (pkg["name"], rcformat.evr_to_str(pkg))) if not table: rctalk.message("--- No Children ---") else: rcformat.tabular(["!", "Requirement"] + row_headers, table) if len(plist) > 1: rctalk.message("")
def execute(self, server, options_dict, non_option_args): if len(non_option_args) < 1: self.usage() sys.exit(1) plist = [] for a in non_option_args: plist = plist + rcpackageutils.find_package(server, a, 1) if not plist: rctalk.message("--- No packages found ---") sys.exit(1) for pkg in plist: dep_info = server.rcd.packsys.package_dependency_info(pkg) if not dep_info.has_key("obsoletes"): continue table = [] for dep in dep_info["obsoletes"]: provided_by = map(lambda x: x[0], server.rcd.packsys.what_provides(dep)) ob_dict = {} name = rcformat.dep_to_str(dep) status = "" for provider in provided_by: if provider["installed"]: status = "*" count = 0 for provider in provided_by: # skip self-obsoletes if evr_eq(provider, pkg): continue if provider["installed"]: status = "*" else: status = "" row = rcformat.package_to_row( server, provider, 0, ["name", "installed", "channel"]) key = string.join(row) if not ob_dict.has_key(key): table.append([status, name] + row) ob_dict[key] = 1 status = "" name = "" count = count + 1 if count == 0: table.append(["", name, "", "", ""]) elif count > 1: table.append(["", "", "", "", ""]) if len(plist) > 1: rctalk.message("--- %s %s ---" % (pkg["name"], rcformat.evr_to_str(pkg))) if not table: rctalk.message("--- No obsoletes ---") else: rcformat.tabular( ["!", "Obsoletes", "Provided by", "S", "Channel"], table) if len(plist) > 1: rctalk.message("")