While working on the offline tool
(http://fedoraproject.org/wiki/DebarshiRay/rum) for GSoC, I needed
some minor modifications to the core Pirut modules (import pirut).
They seem really simple, and transparent to the existing Pirut
application.
Please find attached a patch for the above.
What do you think?
Happy hacking,
Debarshi
--
GPG key ID: 63D4A5A7
Key server: pgp.mit.edu
diff -urNp pirut-orig/__init__.py pirut/__init__.py
--- pirut-orig/__init__.py 2007-05-30 21:50:22.000000000 +0530
+++ pirut/__init__.py 2007-05-30 21:55:56.000000000 +0530
@@ -110,13 +110,14 @@ Remove %5.5s Package(s)
return out
- def __init__(self, run_long = True, configfn = "/etc/yum.conf"):
+ def __init__(self, run_long = True, configfn = "/etc/yum.conf",
+ rootdir="/", plugins=True):
"""run_long is whether or not to run 'long' steps."""
yum.YumBase.__init__(self)
try:
- self.doConfigSetup(fn=configfn,
+ self.doConfigSetup(fn=configfn, root=rootdir, init_plugins=plugins,
plugin_types=(yum.plugins.TYPE_CORE,))
except yum.Errors.ConfigError, e:
raise PirutError, e
@@ -712,7 +713,7 @@ Remove %5.5s Package(s)
pbar.destroy()
- def applyChanges(self, mainwin):
+ def applyChanges(self, mainwin, downloadonly=False):
"""Apply all of the packaging changes requested."""
# do depsolve. determine if we've added anything or not.
self.checkDeps(mainwin)
@@ -723,7 +724,8 @@ Remove %5.5s Package(s)
self.checkSignatures(dlpkgs, mainwin)
# run transaction
- self.runTransaction(mainwin)
+ if not downloadonly:
+ self.runTransaction(mainwin)
def quit(self, *args):
# FIXME: should make sure we close down access to lock files and dbs
_______________________________________________
Yum-devel mailing list
[email protected]
https://lists.dulug.duke.edu/mailman/listinfo/yum-devel