def arguments(self): return "" def description_short(self): return "Clean cache" def local_opt_table(self): return [] def execute(self, options_dict, non_option_args): pkcon = self.pkcon() pkcon.refresh_cache(True) rucktalk.message('--- Refresh Successful ---') ruckcommand.register(CleanCmd) class RefreshCmd(ruckcommand.RuckCommand): def name(self): return "refresh" def aliases(self): return ["ref"] def is_basic(self): return 1 def category(self): return "system"
yum = self.yum() for installed in yum.rpmdb.returnPackages(): matches = yum.pkgSack.searchNevra(name=installed.name) if len(matches) == 0: table_rows.append(ruckformat.package_to_row(yum, installed, no_abbrev, table_keys)) if len(table_rows) > 0: ruckformat.tabular(table_headers, table_rows) else: rucktalk.message('--- No orphans found ---') if not vars().has_key('registered'): # ruckcommand.register(PackageFileCmd) ruckcommand.register(PackagesCmd) ruckcommand.register(PackageSearchCmd) ruckcommand.register(PackageListUpdatesCmd) ruckcommand.register(PackageInfoCmd) # ruckcommand.register(WhatProvidesCmd) # ruckcommand.register(WhatRequiresCmd) # ruckcommand.register(WhatConflictsCmd) # ruckcommand.register(PackageInfoProvidesCmd) # ruckcommand.register(PackageInfoRequiresCmd) # ruckcommand.register(PackageInfoConflictsCmd) # ruckcommand.register(PackageInfoObsoletesCmd) # ruckcommand.register(PackageFileListCmd) # ruckcommand.register(LockListCmd) # ruckcommand.register(LockAddCmd) # ruckcommand.register(LockRemoveCmd) # ruckcommand.register(OrphansCmd)
row = ruckformat.package_to_row(new_pkg, False, table_keys) table_rows.append(row) table_rows.sort(lambda x,y:cmp(string.lower(x[1]), string.lower(y[1]))) ruckformat.tabular(["Repository", "Name","Version"], table_rows) # FIXME: this prompt is horrid resp = rucktalk.prompt("Continue? Y/[N]") if (resp == 'y'): # FIXME: needs to deal with progress better pkcon.update_packages(updates) else: rucktalk.message("Update aborted") ruckcommand.register(UpdateCmd) class InstallCmd(TransactCmd): def name(self): return "install" def aliases(self): return ["in"] def is_basic(self): return 1 def category(self): return "package"