summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornecoro <>2006-10-28 09:11:59 +0000
committernecoro <>2006-10-28 09:11:59 +0000
commit0e5d5476cf83af44597d20da1889f429e622c0ca (patch)
treee13f93b87bcbaf8cb2559d4c48206fc2b78dbd21
parent58c9683aa2e9daf7e6d214b6c70564446a76cd49 (diff)
downloadportato-0e5d5476cf83af44597d20da1889f429e622c0ca.tar.gz
portato-0e5d5476cf83af44597d20da1889f429e622c0ca.tar.bz2
portato-0e5d5476cf83af44597d20da1889f429e622c0ca.zip
Made newuse working
-rw-r--r--geneticone/backend/portage_helper.py29
-rw-r--r--geneticone/gui/gtk/windows.py4
-rw-r--r--geneticone/gui/gtk/wrapper.py2
-rw-r--r--geneticone/gui/gui_helper.py10
4 files changed, 30 insertions, 15 deletions
diff --git a/geneticone/backend/portage_helper.py b/geneticone/backend/portage_helper.py
index 572d954..27f5a41 100644
--- a/geneticone/backend/portage_helper.py
+++ b/geneticone/backend/portage_helper.py
@@ -1,3 +1,4 @@
+# -*- coding: utf-8 -*-
#
# File: geneticone/backend/portage_helper.py
# This file is part of the Genetic/One-Project, a graphical portage-frontend.
@@ -278,22 +279,36 @@ def update_world (newuse = False, deep = False):
checked = []
updating = []
raw_checked = []
- def check (p, deep = False):
+ def check (p):
"""Checks whether a package is updated or not."""
if p.get_cp() in checked: return
else: checked.append(p.get_cp())
+ appended = False
+ tempDeep = False
+
if not p.is_installed():
- old = find_installed_packages(p.get_cp())
- if old:
- old = old[0] # assume we have only one there; FIXME: slotted packages
+ oldList = find_installed_packages(p.get_cp())
+ if oldList:
+ old = oldList[0] # assume we have only one there; FIXME: slotted packages
else:
debug("Bug? Not found installed one:",p.get_cp())
return
updating.append((p, old))
+ appended = True
p = old
- if deep:
+ if newuse:
+ old = p.get_installed_use_flags()
+ new = p.get_settings("USE").split()
+
+ for u in p.get_all_use_flags():
+ if (u in new) != (u in old):
+ if not appended:
+ updating.append((p,p))
+ tempDeep = True
+
+ if deep or tempDeep:
for i in p.get_matched_dep_packages():
if i not in raw_checked:
raw_checked.append(i)
@@ -301,11 +316,11 @@ def update_world (newuse = False, deep = False):
if not bm:
debug("Bug? No best match could be found:",i)
else:
- check(bm, deep)
+ check(bm)
for p in packages:
if not p: continue # if a masked package is installed we have "None" here
- check(p, deep)
+ check(p)
return updating
diff --git a/geneticone/gui/gtk/windows.py b/geneticone/gui/gtk/windows.py
index 7b9dd94..efc4cce 100644
--- a/geneticone/gui/gtk/windows.py
+++ b/geneticone/gui/gtk/windows.py
@@ -195,7 +195,7 @@ class PreferenceWindow (AbstractDialog):
self.deepCb = self.draw_cb(box, "--deep", "deep_opt")
# --newuse
- #self.newuseCb = self.draw_cb(box, "--newuse", "newuse_opt")
+ self.newuseCb = self.draw_cb(box, "--newuse", "newuse_opt")
pHolderLabel = gtk.Label("""<u>For the following options, you might use these placeholders:</u>
<b>$(cat)</b> = category
@@ -282,7 +282,7 @@ class PreferenceWindow (AbstractDialog):
self.cfg.set(self.cfg.const["testingFile_opt"], self.testFileEdit.get_text())
self.cfg.set(self.cfg.const["debug_opt"], str(self.debugCb.get_active()))
self.cfg.set(self.cfg.const["deep_opt"], str(self.deepCb.get_active()))
- #self.cfg.set(self.cfg.const["newuse_opt"], str(self.newuseCb.get_active()))
+ self.cfg.set(self.cfg.const["newuse_opt"], str(self.newuseCb.get_active()))
def cb_ok_clicked(self, button):
"""Saves, writes to config-file and closes the window."""
diff --git a/geneticone/gui/gtk/wrapper.py b/geneticone/gui/gtk/wrapper.py
index 4407816..6f3cdd8 100644
--- a/geneticone/gui/gtk/wrapper.py
+++ b/geneticone/gui/gtk/wrapper.py
@@ -36,7 +36,7 @@ class GtkTree (Tree):
return self.tree.iter_children(it)
def iter_has_children (self, it):
- return self.tree.iter_has_children(it)
+ return self.tree.iter_has_child(it)
def next_iter (self, it):
return self.tree.iter_next(it)
diff --git a/geneticone/gui/gui_helper.py b/geneticone/gui/gui_helper.py
index 8afc137..81e26ef 100644
--- a/geneticone/gui/gui_helper.py
+++ b/geneticone/gui/gui_helper.py
@@ -291,7 +291,7 @@ class EmergeQueue:
"""This updates the tree recursivly, or? Isn't it? Bjorn!
@param it: iterator where to append
- @type it: gtk.TreeIter
+ @type it: Iterator
@param cpv: The package to append.
@type cpv: string (cat/pkg-ver)
@param unmask: True if we are allowed to look for masked packages
@@ -434,7 +434,7 @@ class EmergeQueue:
@param packages: packages to emerge
@type packages: list
@param it: Iterators which point to these entries whose children will be removed after completion.
- @type it: list of gtk.TreeIter"""
+ @type it: Iterator[]"""
# open tty
(master, slave) = pty.openpty()
@@ -524,7 +524,7 @@ class EmergeQueue:
"""Convenience function which removes all children of an iterator and than the iterator itself.
@param it: The iter which to remove.
- @type it: gtk.TreeIter
+ @type it: Iterator
@param removeNewFlags: True if new flags should be removed; False otherwise. Default: True.
@type removeNewFlags: boolean"""
@@ -535,7 +535,7 @@ class EmergeQueue:
"""Removes all children of a given parent TreeIter recursivly.
@param parentIt: The iter from which to remove all children.
- @type parentIt: gtk.TreeIter
+ @type parentIt: Iterator
@param removeNewFlags: True if new flags should be removed; False otherwise. Default: True.
@type removeNewFlags: boolean"""
@@ -552,7 +552,7 @@ class EmergeQueue:
"""Removes a specific item in the tree. This does not remove the top-entries.
@param it: Iterator which points to the entry we are going to remove.
- @type it: gtk.TreeIter
+ @type it: Iterator
@param removeNewFlags: True if new flags should be removed; False otherwise. Default: True.
@type removeNewFlags: boolean"""