* Do not init database in write mode if fetch-only used. (merge from trunk)

This commit is contained in:
Faik Uygur
2007-03-26 08:59:57 +00:00
parent 48b1426579
commit c3f444880b
+12 -4
View File
@@ -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'))