summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.net>2008-07-27 23:16:10 +0200
committerRené 'Necoro' Neumann <necoro@necoro.net>2008-07-27 23:16:10 +0200
commitad83fdec85e289974d591586383155aa71b10566 (patch)
treed0604a4a323d4cabedbe96931d77d8767daae204
parent889f9c6a92e2744a67d056ef4f0a7ccd93673670 (diff)
downloadportato-ad83fdec85e289974d591586383155aa71b10566.tar.gz
portato-ad83fdec85e289974d591586383155aa71b10566.tar.bz2
portato-ad83fdec85e289974d591586383155aa71b10566.zip
Make the updater parallel merge aware
Diffstat (limited to '')
-rw-r--r--portato/gui/updater.py23
1 files changed, 16 insertions, 7 deletions
diff --git a/portato/gui/updater.py b/portato/gui/updater.py
index ba46ffd..c4c81e7 100644
--- a/portato/gui/updater.py
+++ b/portato/gui/updater.py
@@ -27,8 +27,9 @@ class Updater (object):
SED_EXP = r"""
/\*/{
s/ \* //
-q
-}"""
+n
+}
+d"""
def __init__ (self, queue, iterators, threadClass = threading.Thread):
"""
@@ -48,6 +49,7 @@ q
self.iterators = iterators
self.threadClass = threadClass
self.stopEvent = threading.Event()
+ self.removed = set()
t = threadClass(name = "Queue Updater Thread", target = self.run)
t.setDaemon(True)
@@ -59,19 +61,21 @@ q
Checks the packages until being stopped.
"""
- curr = None
+ curr = set()
while not self.stopEvent.isSet():
# this = $(qlop -cCq | sed $SED_EXP)
p1 = subprocess.Popen(["qlop", "--current", "--nocolor", "--quiet"], stdout = subprocess.PIPE)
this = subprocess.Popen(["sed", self.SED_EXP], stdout = subprocess.PIPE, stdin = p1.stdout).communicate()[0]
- if this: this = this.strip()
- if this != curr: # changed package
- curr and self.remove(self.find(curr)) # remove the previous
- curr = this
+ this = set(this.split()) if this else set()
+ for removed in curr - this:
+ self.remove(self.find(removed)) # remove the previous
+ curr = this
time.sleep(2.0)
+
+ self.removed = set()
def stop (self):
"""
@@ -111,6 +115,11 @@ q
debug("Nothing to remove.")
return
+ if cpv in self.removed:
+ return
+
+ self.removed.add(cpv)
+
try:
self.queue.remove_with_children(self.iterators[cpv])
except KeyError:
logsubject'>Removed feed2imap againRené 'Necoro' Neumann4-63/+0 2010-12-01Add feed2imapRené 'Necoro' Neumann4-0/+63 2010-09-04Delete old stuffRené 'Necoro' Neumann27-635/+0 2010-09-04freecadRené 'Necoro' Neumann5-8/+67 2010-08-27copy gititRené 'Necoro' Neumann2-0/+45 2010-08-12Added ikiwikiRené 'Necoro' Neumann4-9/+47 2010-08-12Bumped radicaleRené 'Necoro' Neumann4-72/+7 2010-08-04Add default configRené 'Necoro' Neumann3-1/+50 2010-08-03Removed revisionRené 'Necoro' Neumann1-0/+0 2010-08-03Added init script for radicaleRené 'Necoro' Neumann4-2/+56 2010-07-30Added radicaleRené 'Necoro' Neumann2-0/+29 2010-07-29New packagesRené 'Necoro' Neumann1-0/+0 2010-07-29New packagesRené 'Necoro' Neumann5-0/+75 2010-06-30Fix manifestRené 'Necoro' Neumann1-1/+1 2010-06-30moderncv 0.6 --> 0.10René 'Necoro' Neumann2-1/+1 2010-04-08Bumped lighttpdRené 'Necoro' Neumann5-252/+6 2010-04-01Added gpg and server useflag for fwknopRené 'Necoro' Neumann2-27/+47 2010-04-01Add fwknopRené 'Necoro' Neumann8-0/+133 2010-03-27Fix OpenSSL issue in lighttpdRené 'Necoro' Neumann3-1/+15 2010-03-26add patched lighttpdRené 'Necoro' Neumann17-0/+1208 2010-03-19Bumped app-text/highlightRené 'Necoro' Neumann2-0/+53 2010-03-02Added newer PolyML version for IsabelleRené 'Necoro' Neumann2-0/+31 2010-01-05Removed bpythonRené 'Necoro' Neumann2-33/+0 2009-11-11stgit-0.15 in portage nowRené 'Necoro' Neumann2-59/+0 2009-11-10Add stgit-0.15René 'Necoro' Neumann2-0/+59 2009-11-09Emacs stuff now in PortageRené 'Necoro' Neumann8-2222/+0 2009-11-07Emacs with fixed gtk menusRené 'Necoro' Neumann8-0/+2222 2009-10-27Remove old hibernate-script version.René 'Necoro' Neumann2-72/+0 2009-10-25Rename .bzrignore to .gitignoreRené 'Necoro' Neumann1-0/+0 2009-10-25Rename repo from 'necoro_private' to 'necoro'René 'Necoro' Neumann1-1/+1 2009-10-25Remove own hplip versionRené 'Necoro' Neumann4-210/+0 2009-10-25Remove own ctags versionRené 'Necoro' Neumann7-402/+0 2009-10-02Do not create isabelle desktop entryRené 'Necoro' Neumann2-2/+1 2009-09-28Add isabelle ebuildRené 'Necoro' Neumann3-0/+115 2009-09-05Removed glade ebuild. Newer versions included in treeRené 'Necoro' Neumann2-47/+0