Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=pacman-tools.git;a=commitdiff;h=c323419c761a797d68771c1b2f6b857d2823c670
commit c323419c761a797d68771c1b2f6b857d2823c670 Author: Miklos Vajna <[EMAIL PROTECTED]> Date: Sun Jan 27 13:14:07 2008 +0100 syncpkgcd: use /proc/loadavg instead of uptime diff --git a/syncpkgd/syncpkgcd.py b/syncpkgd/syncpkgcd.py index 6da5392..365bb1a 100644 --- a/syncpkgd/syncpkgcd.py +++ b/syncpkgd/syncpkgcd.py @@ -77,10 +77,10 @@ class Syncpkgcd: if not hasattr(config, "throttle"): # no limit defined return True - sock = os.popen("uptime") + sock = open("/proc/loadavg") buf = sock.read().strip() sock.close() - load = re.sub(r".*: [0-9.]+, .*", r"\1", buf) + load = buf.split(' ')[0] if float(load) > config.throttle: return False else: _______________________________________________ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git