Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=pacman-tools.git;a=commitdiff;h=a9dbf39eddbf4ef89eb7d6b74ec918f48c4d992c

commit a9dbf39eddbf4ef89eb7d6b74ec918f48c4d992c
Author: Miklos Vajna <[email protected]>
Date:   Mon Sep 24 15:33:46 2012 +0200

syncpkgcd: make timeout configurable

diff --git a/syncpkgd/cconfig.py b/syncpkgd/cconfig.py
index e542de0..0afa93b 100644
--- a/syncpkgd/cconfig.py
+++ b/syncpkgd/cconfig.py
@@ -12,4 +12,7 @@ class config:
# never try to build these packages, just fail
#blacklist = ['foo', 'bar']

+       # if the build takes more than 1 day, kill it
+       timeout = 24*60*60
+
# vim: ft=python
diff --git a/syncpkgd/syncpkgcd.py b/syncpkgd/syncpkgcd.py
index ba7d559..c5e69bb 100644
--- a/syncpkgd/syncpkgcd.py
+++ b/syncpkgd/syncpkgcd.py
@@ -267,7 +267,12 @@ class Syncpkgcd:
self.logsock.flush()

def system(self, cmd):
-               return os.system("export HOME=%s; timeout -s KILL 86400 %s >> 
%s 2>&1" % (self.home, cmd, self.logfile))
+               if not hasattr(config, "timeout"):
+                       # no timeout defined, default to 1 day
+                       timeout = 24*60*60
+               else:
+                       timeout = config.timeout
+               return os.system("export HOME=%s; timeout -s KILL %s %s >> %s 
2>&1" % (self.home, timeout, cmd, self.logfile))

def go(self, pkgname):
for root, dirs, files in os.walk("source"):
_______________________________________________
Frugalware-git mailing list
[email protected]
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to