summaryrefslogtreecommitdiff
path: root/geneticone/backend
diff options
context:
space:
mode:
authornecoro <>2006-10-08 17:26:27 +0000
committernecoro <>2006-10-08 17:26:27 +0000
commitf27145ec49c6f1cdd13db2f3bf389164f10ac828 (patch)
tree46368b0191a98a7406ea860972f25114955e465f /geneticone/backend
parent1e9ddc03e5667e5a9297508f7bec8b7f3ea46dc9 (diff)
downloadportato-f27145ec49c6f1cdd13db2f3bf389164f10ac828.tar.gz
portato-f27145ec49c6f1cdd13db2f3bf389164f10ac828.tar.bz2
portato-f27145ec49c6f1cdd13db2f3bf389164f10ac828.zip
Made the testing stuff working too ... I hope ^^ ... removed obsolete-dir
Diffstat (limited to 'geneticone/backend')
-rw-r--r--geneticone/backend/__init__.py1
-rw-r--r--geneticone/backend/flags.py23
-rw-r--r--geneticone/backend/package.py43
3 files changed, 47 insertions, 20 deletions
diff --git a/geneticone/backend/__init__.py b/geneticone/backend/__init__.py
index 16c3a2e..5238765 100644
--- a/geneticone/backend/__init__.py
+++ b/geneticone/backend/__init__.py
@@ -20,6 +20,7 @@ import portage
# this is set to "var/lib/portage/world" by default - so we add the leading /
portage.WORLD_FILE = "/"+portage.WORLD_FILE
+portage.settings = None
# portage tree vars
porttree = gentoolkit.porttree
diff --git a/geneticone/backend/flags.py b/geneticone/backend/flags.py
index 1251bfd..2da0a94 100644
--- a/geneticone/backend/flags.py
+++ b/geneticone/backend/flags.py
@@ -468,6 +468,26 @@ TESTING_PATH_IS_DIR = os.path.isdir(TESTING_PATH)
newTesting = {}
arch = ""
+def remove_new_testing (cpv):
+ if isinstance(cpv, package.Package):
+ cpv = cpv.get_cpv()
+
+ try:
+ del newTesting[cpv]
+ except KeyError:
+ pass
+
+def new_testing_status (cpv):
+ if isinstance(cpv, package.Package):
+ cpv = cpv.get_cpv()
+
+ if cpv in newTesting:
+ for file, line in newTesting[cpv]:
+ if line == "-1": return False
+ else: return True
+
+ return None
+
def set_testing (pkg, enable):
"""Enables the package for installing when it is marked as testing (~ARCH).
@param pkg: the package
@@ -484,12 +504,11 @@ def set_testing (pkg, enable):
if not cpv in newTesting:
newTesting[cpv] = []
- debug("arch: "+arch)
for file, line in newTesting[cpv]:
if (enable and line != "-1") or (not enable and line == "-1"):
newTesting[cpv].remove((file, line))
- if (enable and (pkg.get_mask_status() % 3 == 0)) or (not enable and (pkg.get_mask_status() % 3 != 0)):
+ if (enable and not pkg.is_testing(allowed=True)) or (not enable and pkg.is_testing(allowed=True)):
return
if not enable:
diff --git a/geneticone/backend/package.py b/geneticone/backend/package.py
index fec346d..7b917a8 100644
--- a/geneticone/backend/package.py
+++ b/geneticone/backend/package.py
@@ -30,25 +30,33 @@ class Package (gentoolkit.Package):
if isinstance(cpv, gentoolkit.Package):
cpv = cpv.get_cpv()
gentoolkit.Package.__init__(self, cpv)
+ self._status = portage.getmaskingstatus(self.get_cpv(), settings = gentoolkit.settings)
- def get_mask_status(self):
- """Gets the numeric mask status of a package. The return value can be translated as a string when taking the following list of modes: [ " ", " ~", " -", "M ", "M~", "M-" ]
+ def is_missing_keyword(self):
+ if "missing keyword" in self._status:
+ return True
+ return False
- This method adapted from equery 0.1.4
- Original author: Karl Trygve Kalleberg <karltk@gentoo.org>
+ def is_testing(self, allowed = False):
+ testArch = "~" + self.get_settings("ARCH")
+ if not allowed:
+ if testArch in self.get_env_var("KEYWORDS").split():
+ return True
+ return False
+ else:
+ status = flags.new_testing_status(self.get_cpv())
+ if status == None:
+ if testArch+" keyword" in self._status:
+ return True
+ return False
+ else:
+ return status
+
+ def set_testing(self, enable = True):
+ flags.set_testing(self, enable)
- @returns: mask status
- @rtype: int"""
-
- pkgmask = 0
- if self.is_masked():
- pkgmask = pkgmask + 3
- keywords = self.get_env_var("KEYWORDS").split()
- if "~" + gentoolkit.settings["ARCH"] in keywords:
- pkgmask = pkgmask + 1
- elif "-*" in keywords or "-" + gentoolkit.settings["ARCH"] in keywords:
- pkgmask = pkgmask + 2
- return pkgmask
+ def remove_new_testing(self):
+ flags.remove_new_testing(self.get_cpv())
def is_masked (self):
"""Returns True if either masked by package.mask or by profile.
@@ -62,8 +70,7 @@ class Package (gentoolkit.Package):
else:
debug("BUG in flags.new_masking_status. It returns "+status)
else:
- status = portage.getmaskingstatus(self._cpv, settings = gentoolkit.settings)
- if "profile" in status or "package.mask" in status:
+ if "profile" in self._status or "package.mask" in self._status:
return True
return False
lass='insertions'>+1 2014-04-19platform: Auto-detect local platform fileJason A. Donenfeld2-3/+3 In fact, if we're running from the source directory, just auto-detect the platform file in the first place. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com> 2014-04-19platform: Allow custom platform file before installJason A. Donenfeld2-3/+5 The new environment variable, PASSWORD_STORE_PLATFORM_FILE is now used for loading custom platform files while pass lives as src/password-store.sh. After it is installed using 'make install', this environment variable is no longer used, and either no platform file is loaded (if the default platform is acceptable), or a hardcoded also-installed platform file is referenced. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com> 2014-04-18reencrypt: cleaner temp file declarationJason A. Donenfeld1-4/+4 2014-04-18Remove unneeded semicolon.Jason A. Donenfeld1-14/+14 2014-04-18Check sneaky paths.Jason A. Donenfeld1-0/+15 2014-04-18Pruning: turns out rmdir does it for us with -p.Jason A. Donenfeld1-9/+3 2014-04-18Abstract remove empty directories into function.Jason A. Donenfeld1-14/+11 2014-04-18Remember to prune empty folders.Jason A. Donenfeld1-0/+8 2014-04-18init: allow deinitializationJason A. Donenfeld2-2/+18 2014-04-18bash-completion: filter dot files from resultsJason A. Donenfeld1-3/+8 2014-04-18reencrypt: remove option, do automaticallyJason A. Donenfeld5-39/+25 2014-04-18reencryption: add to completion filesJason A. Donenfeld3-1/+5 2014-04-18Specify variable gpg.Jason A. Donenfeld1-1/+1 2014-04-18style: don't escape new line on &&Jason A. Donenfeld1-2/+2 2014-04-18reencryption: remove temporary file on failureJason A. Donenfeld1-1/+1 2014-04-18reencryption: only reencrypt files when requiredJason A. Donenfeld2-16/+37 2014-04-17cp: typo as cvJason A. Donenfeld1-1/+1 2014-04-17bash: gpg_id is localJason A. Donenfeld1-0/+1 2014-04-17move/copy: always reencrypt passwords at destinationJason A. Donenfeld5-25/+56 2014-04-17makefile: allow platform files with gnu sedJason A. Donenfeld1-7/+8 Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com> 2014-04-17mv: Add pass mv/rename supportJason A. Donenfeld5-3/+78 Based-on-work-by: Matthieu Weber <mweber@free.fr> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com> 2014-04-17revelation2pass: add plain XML importJavali1-11/+15 I found that revelatio2pass.py script doesn't work. It can not decrypt my password file. I got following error message: raceback (most recent call last): File "git/password-store/contrib/importers/revelation2pass.py", line 159, in <module> main(args.FILE, verbose=args.verbose, xml=args.xml) File "git/password-store/contrib/importers/revelation2pass.py", line 140, in main cleardata_gz = decrypt_gz(password, data) File "git/password-store/contrib/importers/revelation2pass.py", line 117, in decrypt_gz ct = c.decrypt(cipher_text[28:]) File "/usr/lib/python2.7/site-packages/Crypto/Cipher/blockalgo.py", line 295, in decrypt return self._cipher.decrypt(ciphertext) I was unable to fix the problem, but I created a workaround, that add plain XML import option to the revelation2pass.py script. Revelation can export its password file as plain XML format. 2014-04-17platform: add cygwin supportJason A. Donenfeld2-1/+17 According to Brandon Jones, all we need to do is adjust /dev/clipboard from xclip. So we add a platform specific file to do so. http://www.relaytheurgency.com/2014/04/pass-in-cygwin-relatively-simple.html Suggested-by: Brandon Jones <jones.brandon.lee@gmail.com> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>