summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornecoro <>2007-04-04 17:35:05 +0000
committernecoro <>2007-04-04 17:35:05 +0000
commita54998f99c9bc5830eba7de9a76fac10f99721f0 (patch)
tree1b6478c0b32368c3a78e3f0eaf556dc576af067b
parent4896a255f7064cd669edb9b42dce32a57541ea62 (diff)
downloadportato-a54998f99c9bc5830eba7de9a76fac10f99721f0.tar.gz
portato-a54998f99c9bc5830eba7de9a76fac10f99721f0.tar.bz2
portato-a54998f99c9bc5830eba7de9a76fac10f99721f0.zip
showed masked packages unmasked by the user similar to stable marked testing packages
Diffstat (limited to '')
-rw-r--r--doc/Changelog3
-rw-r--r--portato/backend/package.py4
-rw-r--r--portato/backend/portage/package.py33
-rw-r--r--portato/backend/portage/system.py2
-rw-r--r--portato/gui/gtk/windows.py11
5 files changed, 40 insertions, 13 deletions
diff --git a/doc/Changelog b/doc/Changelog
index be0a544..1dbfb98 100644
--- a/doc/Changelog
+++ b/doc/Changelog
@@ -1,3 +1,6 @@
+next:
+- showed difference between unmasked and masked but unmasked by yourself
+
0.6.1:
- first plugin support
- collapsed USE_EXPAND-variables
diff --git a/portato/backend/package.py b/portato/backend/package.py
index 0039fc0..70773cc 100644
--- a/portato/backend/package.py
+++ b/portato/backend/package.py
@@ -260,9 +260,11 @@ class Package:
raise NotImplementedError
- def is_masked (self):
+ def is_masked (self, use_changed = True):
"""Returns True if either masked by package.mask or by profile.
+ @param use_changed: Controls, whether changes applied to masking keywords are taken into account.
+ @type use_changed: boolean
@returns: True if masked / False otherwise
@rtype: boolean"""
diff --git a/portato/backend/portage/package.py b/portato/backend/portage/package.py
index ed90db0..b455530 100644
--- a/portato/backend/portage/package.py
+++ b/portato/backend/portage/package.py
@@ -74,16 +74,29 @@ class PortagePackage (Package):
else:
return status
- def is_masked (self):
- status = flags.new_masking_status(self.get_cpv())
- if status != None: # we have locally changed it
- if status == "masked": return True
- elif status == "unmasked": return False
- else:
- debug("BUG in flags.new_masking_status. It returns",status)
- else: # we have not touched the status
- if self._status and ("profile" in self._status or "package.mask" in self._status):
- return True
+ def is_masked (self, use_changed = True):
+
+ if use_changed:
+ status = flags.new_masking_status(self.get_cpv())
+ if status != None: # we have locally changed it
+ if status == "masked": return True
+ elif status == "unmasked": return False
+ else:
+ debug("BUG in flags.new_masking_status. It returns",status)
+ else: # we have not touched the status
+ if self._status and ("profile" in self._status or "package.mask" in self._status):
+ return True
+ return False
+ else:
+ try:
+ masked = self._settings.settings.pmaskdict[self.get_cp()]
+ except KeyError: # key error: not masked
+ return False
+
+ for cpv in masked:
+ if self.matches(cpv):
+ return True
+
return False
def get_all_use_flags (self, installed = False):
diff --git a/portato/backend/portage/system.py b/portato/backend/portage/system.py
index 9cda5ab..3e0c539 100644
--- a/portato/backend/portage/system.py
+++ b/portato/backend/portage/system.py
@@ -207,7 +207,7 @@ class PortageSystem (SystemInterface):
t2 = unique_array(t2)
return self.geneticize_list(t2)
else:
- return t;
+ return t
def find_all_world_packages (self, name = None):
world = filter(self.find_lambda(name), [x.get_cpv() for x in self.find_world_packages()[0]])
diff --git a/portato/gui/gtk/windows.py b/portato/gui/gtk/windows.py
index 2de772f..5b89aba 100644
--- a/portato/gui/gtk/windows.py
+++ b/portato/gui/gtk/windows.py
@@ -571,12 +571,21 @@ class PackageTable:
if self.doEmerge:
self.emergeBtn.set_sensitive(True)
self.installedCheck.set_active(pkg.is_installed())
- self.maskedCheck.set_active(pkg.is_masked())
+
+ if pkg.is_masked(use_changed = False) and not pkg.is_masked(use_changed = True):
+ self.maskedCheck.set_label("<i>(Masked)</i>")
+ self.maskedCheck.get_child().set_use_markup(True)
+ else:
+ self.maskedCheck.set_label("Masked")
+
+ self.maskedCheck.set_active(pkg.is_masked(use_changed = False))
+
if pkg.is_testing(use_keywords = False) and not pkg.is_testing(use_keywords = True):
self.testingCheck.set_label("<i>(Testing)</i>")
self.testingCheck.get_child().set_use_markup(True)
else:
self.testingCheck.set_label("Testing")
+
self.testingCheck.set_active(pkg.is_testing(use_keywords = False))
if self.doEmerge: