Index: yum-updatesd.py
===================================================================
RCS file: /home/groups/yum/cvs/yum/yum-updatesd.py,v
retrieving revision 1.22.2.2
retrieving revision 1.22.2.4
diff -u -r1.22.2.2 -r1.22.2.4
--- yum-updatesd.py 17 Oct 2006 03:54:19 -0000 1.22.2.2
+++ yum-updatesd.py 8 Nov 2006 15:31:48 -0000 1.22.2.4
@@ -23,6 +23,11 @@
# - what to do if we're asked to exit while updates are being applied?
# - what to do with the lock around downloads/updates
+# since it takes me time everytime to figure this out again, here's how to
+# queue a check with dbus-send. adjust appropriately for other methods
+# $ dbus-send --system --print-reply --type=method_call \
+# --dest=edu.duke.linux.yum /Updatesd edu.duke.linux.yum.CheckNow
+
import os
import sys
import time
@@ -109,7 +114,7 @@
"NOTICE": syslog.LOG_NOTICE,
"INFO": syslog.LOG_INFO,
"DEBUG": syslog.LOG_DEBUG }
- if type(lvl) == type(int):
+ if type(lvl) == int:
return lvl
if level_map.has_key(lvl.upper()):
return level_map[lvl.upper()]
@@ -133,7 +138,7 @@
"LOCAL5": syslog.LOG_LOCAL5,
"LOCAL6": syslog.LOG_LOCAL6,
"LOCAL7": syslog.LOG_LOCAL7,}
- if type(facility) == type(int):
+ if type(facility) == int:
return facility
elif facility_map.has_key(facility.upper()):
return facility_map[facility.upper()]
@@ -267,9 +272,9 @@
self.updd.updateInfoTime = None
def run(self):
- self.updd.downloadPkgs(dlpkgs)
- for po in dlpkgs:
- rc, err = self.updd.sigCheckPkg(po)
+ self.updd.downloadPkgs(self.dlpkgs)
+ for po in self.dlpkgs:
+ result, err = self.updd.sigCheckPkg(po)
if result == 0:
continue
elif result == 1:
@@ -321,8 +326,7 @@
os.makedirs(self.opts.nonroot_workdir)
self.repos.setCacheDir(self.opts.nonroot_workdir)
- self.doConfigSetup(fn=self.opts.yum_config,
- init_plugins = False)
+ self.doConfigSetup(fn=self.opts.yum_config)
def refreshUpdates(self):
self.doLock(YUM_PID_FILE)
@@ -578,7 +582,7 @@
if not options.nofork:
if os.fork():
sys.exit()
- fd = os.open("/dev/null", os.O_RDONLY)
+ fd = os.open("/dev/null", os.O_RDWR)
os.dup2(fd, 0)
os.dup2(fd, 1)
os.dup2(fd, 2)