From c3f444880b86afd4eb7af63b61f0447fcf88a568 Mon Sep 17 00:00:00 2001 From: Faik Uygur Date: Mon, 26 Mar 2007 08:59:57 +0000 Subject: [PATCH] * Do not init database in write mode if fetch-only used. (merge from trunk) --- pisi/cli/commands.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/pisi/cli/commands.py b/pisi/cli/commands.py index 1e5fd2d1..dcc34f20 100644 --- a/pisi/cli/commands.py +++ b/pisi/cli/commands.py @@ -605,8 +605,8 @@ class PackageOp(Command): group.add_option("-n", "--dry-run", action="store_true", default=False, help = _("Do not perform any action, just show what would be done")) - def init(self): - super(PackageOp, self).init(True) + def init(self, database=True, write=True): + super(PackageOp, self).init(database, write) def finalize(self): #self.finalize_db() @@ -649,7 +649,11 @@ expanded to package names. self.parser.add_option_group(group) def run(self): - self.init() + + if self.options.fetch_only: + self.init(database=True, write=False) + else: + self.init() components = ctx.get_option('component') if not components and not self.args: @@ -750,7 +754,11 @@ expanded to package names. return list(packages) def run(self): - self.init() + + if self.options.fetch_only: + self.init(database=True, write=False) + else: + self.init() if not ctx.get_option('bypass_update_repo'): ctx.ui.info(_('Updating repositories'))