From 023de745012a90edd288a607a76ab6d020debc33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eray=20=C3=96zkural?= Date: Sun, 6 Nov 2005 04:07:20 +0000 Subject: [PATCH] * def args for upgrade --- pisi/cli/commands.py | 12 +++++++----- pisi/xmlfile.py | 19 ++++++++++++------- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/pisi/cli/commands.py b/pisi/cli/commands.py index 94f53572..d896654c 100644 --- a/pisi/cli/commands.py +++ b/pisi/cli/commands.py @@ -431,12 +431,14 @@ reinstall a package from a pisi file, use the install command.""" default=False, help=_("eager upgrades")) def run(self): - if not self.args: - self.help() - return - self.init() - pisi.api.upgrade(self.args) + + if not self.args: + packages = ctx.installdb.list_installed() + else: + packages = self.args + + pisi.api.upgrade(packages) self.finalize() diff --git a/pisi/xmlfile.py b/pisi/xmlfile.py index a1c8c109..3051ad9e 100644 --- a/pisi/xmlfile.py +++ b/pisi/xmlfile.py @@ -710,17 +710,22 @@ class autoxml(oo.autosuper, oo.autoprop): def errors(l, where): errs = [] - for ix in range(len(l)): - errs.extend(errors_item(l[ix], where + '[%s]' % ix)) + ix = 1 + for node in l: + errs.extend(errors_item(node, where + '[%s]' % ix)) + ix += 1 return errs def format(l, f, errs): - # indent here - for ix in range(len(l)): - f.add_flowing_data(str(ix+1) + ': ') - format_item(l[ix], f, errs) - if ix != len(l)-1: + # TODO: indent here + ix = 1 + length = len(l) + for node in l: + f.add_flowing_data(str(ix) + ': ') + format_item(node, f, errs) + if ix != length: f.add_flowing_data(', ') + ix += 1 return (init, decode, encode, errors, format)