* pisi lu -c component. Ones again this is not recursive.
pisi api is the next big thing to work on :) pisi api is next thing to work on.
This commit is contained in:
+15
-5
@@ -1306,20 +1306,30 @@ Lists the packages that will be upgraded.
|
||||
buildno_opts(self, group)
|
||||
group.add_option("-l", "--long", action="store_true",
|
||||
default=False, help=_("show in long format"))
|
||||
group.add_option("-c", "--component", action="store",
|
||||
default=None, help=_("list upgradable packages under given component"))
|
||||
group.add_option("-i", "--install-info", action="store_true",
|
||||
default=False, help=_("show detailed install info"))
|
||||
self.parser.add_option_group(group)
|
||||
|
||||
def run(self):
|
||||
self.init(database = True, write = False)
|
||||
list = pisi.api.list_upgradable()
|
||||
if not list:
|
||||
upgradable_pkgs = pisi.api.list_upgradable()
|
||||
|
||||
component = ctx.get_option('component')
|
||||
if component:
|
||||
#FIXME: pisi api is insufficient to do this
|
||||
from sets import Set as set
|
||||
component_pkgs = ctx.componentdb.get_component(component, None).packages
|
||||
upgradable_pkgs = list(set(upgradable_pkgs) & set(component_pkgs))
|
||||
|
||||
if not upgradable_pkgs:
|
||||
ctx.ui.info(_('No packages to upgrade.'))
|
||||
list.sort()
|
||||
|
||||
upgradable_pkgs.sort()
|
||||
if self.options.install_info:
|
||||
ctx.ui.info(_('Package Name |St| Version| Rel.| Build| Distro| Date'))
|
||||
print '========================================================================'
|
||||
for pkg in list:
|
||||
for pkg in upgradable_pkgs:
|
||||
package = ctx.packagedb.get_package(pkg, pisi.itembyrepodb.installed)
|
||||
inst_info = ctx.installdb.get_info(pkg)
|
||||
if self.options.long:
|
||||
|
||||
Reference in New Issue
Block a user