]> git.ipfire.org Git - people/pmueller/ipfire-3.x.git/blobdiff - pakfire/patches/0002-builder-Remove-pids-from-list-of-running-jobs-when-j.patch
pakfire: Import latest patches from upstream.
[people/pmueller/ipfire-3.x.git] / pakfire / patches / 0002-builder-Remove-pids-from-list-of-running-jobs-when-j.patch
diff --git a/pakfire/patches/0002-builder-Remove-pids-from-list-of-running-jobs-when-j.patch b/pakfire/patches/0002-builder-Remove-pids-from-list-of-running-jobs-when-j.patch
new file mode 100644 (file)
index 0000000..53ca008
--- /dev/null
@@ -0,0 +1,43 @@
+From c3319c905d03176308e01175f344cf33bd926113 Mon Sep 17 00:00:00 2001
+From: Michael Tremer <michael.tremer@ipfire.org>
+Date: Sun, 3 Feb 2013 21:36:00 +0100
+Subject: [PATCH 2/4] builder: Remove pids from list of running jobs when job
+ has finished.
+
+---
+ python/pakfire/client/builder.py | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/python/pakfire/client/builder.py b/python/pakfire/client/builder.py
+index 9798cc4..2d6280c 100644
+--- a/python/pakfire/client/builder.py
++++ b/python/pakfire/client/builder.py
+@@ -251,6 +251,8 @@ class PakfireDaemon(object):
+                                       # Finally, remove the process from the process list.
+                                       self.processes.remove(process)
++                                      if self.pid2jobid.has_key(process.id):
++                                              del self.pid2jobid[process.id]
+                       return ret
+@@ -274,7 +276,6 @@ class PakfireDaemon(object):
+                       for process in self.processes[:]:
+                               job_id = self.pid2jobid.get(process.pid, None)
+                               if job_id and job_id in aborted_jobs:
+-
+                                       # Kill the process.
+                                       log.info("Killing process %s which was aborted by the user." \
+                                               % process.pid)
+@@ -283,6 +284,8 @@ class PakfireDaemon(object):
+                                       # Remove the process from the process list to avoid
+                                       # that is will be cleaned up in the normal way.
+                                       self.processes.remove(process)
++                                      if self.pid2jobid.has_key(process.id):
++                                              del self.pid2jobid[process.id]
+                       return True
+-- 
+1.7.11.7
+