diff options
author | Jonas Smedegaard <dr@jones.dk> | 2008-03-23 11:40:51 (GMT) |
---|---|---|
committer | Jonas Smedegaard <dr@jones.dk> | 2008-03-23 13:31:36 (GMT) |
commit | 5dc18bcd7a54e70a77321ed14f29190f015a84df (patch) | |
tree | cf85562019236b0f8bf7252d3e1f30384e3c2289 | |
parent | b5bcaf97ff33dacef828afd84bccc00cf0842394 (diff) |
Add patches 1004 and 1005 to avoid queue.join and queue.task_done, and check_call, all of them unavailable in Python < 2.5.
-rw-r--r-- | debian/changelog | 4 | ||||
-rw-r--r-- | debian/patches/1004_avoid_queue_hints.patch | 41 | ||||
-rw-r--r-- | debian/patches/1005_avoid_check_call.patch | 23 | ||||
-rw-r--r-- | debian/patches/series | 2 |
4 files changed, 69 insertions, 1 deletions
diff --git a/debian/changelog b/debian/changelog index c64f92a..bb9aaae 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,10 @@ sugar-datastore (0.8.0~git.13d354b-8) UNRELEASED; urgency=low * Fix typo in long description. + * Add patches 1004 and 1005 to avoid queue.join and queue.task_done, + and check_call, all of them unavailable in Python < 2.5. - -- Jonas Smedegaard <dr@jones.dk> Sun, 16 Mar 2008 21:39:09 +0100 + -- Jonas Smedegaard <dr@jones.dk> Sun, 23 Mar 2008 12:38:51 +0100 sugar-datastore (0.8.0~git.13d354b-7) unstable; urgency=low diff --git a/debian/patches/1004_avoid_queue_hints.patch b/debian/patches/1004_avoid_queue_hints.patch new file mode 100644 index 0000000..a74d648 --- /dev/null +++ b/debian/patches/1004_avoid_queue_hints.patch @@ -0,0 +1,41 @@ +diff --git a/src/olpc/datastore/xapianindex.py b/src/olpc/datastore/xapianindex.py +index b3da0cc..8cf6a5a 100644 +--- a/src/olpc/datastore/xapianindex.py ++++ b/src/olpc/datastore/xapianindex.py +@@ -151,8 +151,7 @@ class IndexManager(object): + + def stopIndexer(self, force=False): + if not self.indexer_running: return +- if not force: self.queue.join() +- self.indexer_running = False ++ if force: self.indexer_running = False + # should terminate after the current task + self.indexer.join() + +@@ -250,6 +249,7 @@ class IndexManager(object): + uid, vid, doc, operation, filestuff = data + except Empty: + #time.sleep(1.0) ++ self.indexer_running = False + continue + + try: +@@ -281,9 +281,6 @@ class IndexManager(object): + logger.warning("""Conversion process failed for document %s %s""" % (uid, filename)) + else: + logger.warning("Unknown indexer operation ( %s: %s)" % (uid, operation)) +- +- # tell the queue its complete +- self.queue.task_done() + finally: + self._write_lock.release() + +@@ -297,7 +294,7 @@ class IndexManager(object): + """Intentionally block until the indexing is complete. Used + primarily in testing. + """ +- self.queue.join() ++ self.indexer.join() + self.flush() + + # diff --git a/debian/patches/1005_avoid_check_call.patch b/debian/patches/1005_avoid_check_call.patch new file mode 100644 index 0000000..a4d107a --- /dev/null +++ b/debian/patches/1005_avoid_check_call.patch @@ -0,0 +1,23 @@ +diff --git a/src/olpc/datastore/bin_copy.py b/src/olpc/datastore/bin_copy.py +index 6cf7036..a38b395 100644 +--- a/src/olpc/datastore/bin_copy.py ++++ b/src/olpc/datastore/bin_copy.py +@@ -3,14 +3,12 @@ import os, subprocess + + def bin_copy(src, dest): +- try: +- subprocess.check_call(['/bin/cp', src, dest]) +- except subprocess.CalledProcessError: ++ retcode = subprocess.call(['/bin/cp', src, dest]) ++ if retcode: + raise OSError("Copy failed %s %s" % (src, dest)) + + def bin_mv(src, dest): +- try: +- subprocess.check_call(['/bin/mv', src, dest]) +- except subprocess.CalledProcessError: ++ retcode = subprocess.call(['/bin/mv', src, dest]) ++ if retcode: + raise OSError("Move failed %s %s" % (src, dest)) + + if __name__ == "__main__": diff --git a/debian/patches/series b/debian/patches/series index b12f3a6..3025962 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,3 +1,5 @@ 1001_unversioned_hashbang_in_scripts.patch 1002_avoid_try-except-finally.patch 1003_avoid_with_statement.patch +1004_avoid_queue_hints.patch +1005_avoid_check_call.patch |