]> git.ipfire.org Git - people/ms/ipfire-3.x.git/blobdiff - pakfire/patches/0002-Remove-some-test-code.patch
pakfire: Import latest patches from upstream.
[people/ms/ipfire-3.x.git] / pakfire / patches / 0002-Remove-some-test-code.patch
diff --git a/pakfire/patches/0002-Remove-some-test-code.patch b/pakfire/patches/0002-Remove-some-test-code.patch
new file mode 100644 (file)
index 0000000..50e5c9f
--- /dev/null
@@ -0,0 +1,73 @@
+From 2ee28ea5d213ce4726dd1527b6465059c9b0fa4b Mon Sep 17 00:00:00 2001
+From: Michael Tremer <michael.tremer@ipfire.org>
+Date: Thu, 24 Jan 2013 02:35:11 +0100
+Subject: [PATCH 02/17] Remove some test code.
+
+---
+ python/pakfire/client/test.py | 54 -------------------------------------------
+ 1 file changed, 54 deletions(-)
+ delete mode 100644 python/pakfire/client/test.py
+
+diff --git a/python/pakfire/client/test.py b/python/pakfire/client/test.py
+deleted file mode 100644
+index 8bf5fd4..0000000
+--- a/python/pakfire/client/test.py
++++ /dev/null
+@@ -1,54 +0,0 @@
+-#!/usr/bin/python
+-
+-import random
+-import sys
+-import time
+-
+-def fork_builder(*args, **kwargs):
+-      cb = ClientBuilder(*args, **kwargs)
+-
+-      try:
+-              cb()
+-      except Exception, e:
+-              print e
+-              sys.exit(1)
+-
+-class ClientBuilder(object):
+-      def __init__(self, id):
+-              self.id = id
+-
+-      def __call__(self, *args):
+-              print "Running", self.id, args
+-
+-              time.sleep(2)
+-
+-              if random.choice((False, False, False, True)):
+-                      raise Exception, "Process died"
+-
+-
+-import multiprocessing
+-
+-
+-processes = []
+-
+-while True:
+-      # Check if there are at least 2 processes running.
+-      if len(processes) < 2:
+-              process = multiprocessing.Process(target=fork_builder, args=(len(processes),))
+-
+-              process.daemon = True
+-              process.start()
+-
+-              processes.append(process)
+-
+-      print len(processes), "in process list:", processes
+-
+-      for process in processes:
+-              time.sleep(0.5)
+-
+-              print process.name, "is alive?", process.is_alive()
+-
+-              if not process.is_alive():
+-                      print "Removing process", process
+-                      print "  Exitcode:", process.exitcode
+-                      processes.remove(process)
+-- 
+1.8.1.2
+