Ahmet's request:
Do not open database with write access for --fetch-only. This way when only fetching packages for install or upgrade, pisi can be used to install, build or emerge other packages.
This commit is contained in:
+10
-2
@@ -555,8 +555,8 @@ class PackageOp(Command):
|
|||||||
group.add_option("-n", "--dry-run", action="store_true", default=False,
|
group.add_option("-n", "--dry-run", action="store_true", default=False,
|
||||||
help = _("Do not perform any action, just show what would be done"))
|
help = _("Do not perform any action, just show what would be done"))
|
||||||
|
|
||||||
def init(self):
|
def init(self, database=True, write=True):
|
||||||
super(PackageOp, self).init(True)
|
super(PackageOp, self).init(database, write)
|
||||||
|
|
||||||
def finalize(self):
|
def finalize(self):
|
||||||
#self.finalize_db()
|
#self.finalize_db()
|
||||||
@@ -599,6 +599,10 @@ expanded to package names.
|
|||||||
self.parser.add_option_group(group)
|
self.parser.add_option_group(group)
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
|
|
||||||
|
if self.options.fetch_only:
|
||||||
|
self.init(database=True, write=False)
|
||||||
|
else:
|
||||||
self.init()
|
self.init()
|
||||||
|
|
||||||
components = ctx.get_option('component')
|
components = ctx.get_option('component')
|
||||||
@@ -700,6 +704,10 @@ expanded to package names.
|
|||||||
return list(packages)
|
return list(packages)
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
|
|
||||||
|
if self.options.fetch_only:
|
||||||
|
self.init(database=True, write=False)
|
||||||
|
else:
|
||||||
self.init()
|
self.init()
|
||||||
|
|
||||||
if not ctx.get_option('bypass_update_repo'):
|
if not ctx.get_option('bypass_update_repo'):
|
||||||
|
|||||||
Reference in New Issue
Block a user