diff options
-rwxr-xr-x | scripts/tatt | 3 | ||||
-rw-r--r-- | tatt/gentooPackage.py | 3 | ||||
-rw-r--r-- | tatt/usecombis.py | 6 |
3 files changed, 7 insertions, 5 deletions
diff --git a/scripts/tatt b/scripts/tatt index f526cd3..a1190a0 100755 --- a/scripts/tatt +++ b/scripts/tatt @@ -6,6 +6,7 @@ import sys import re import os import portage +from portage.dep import dep_getcpv import base64 import requests @@ -195,7 +196,7 @@ if myJob.packageList is not None and len(myJob.packageList) > 0: for p in myJob.packageList: print("Found the following package atom : " + p.packageString()) # check if the package already has the needed keywords - kw = port.aux_get(p.packageString()[1:], ["KEYWORDS"]) + kw = port.aux_get(dep_getcpv(p.packageString()), ["KEYWORDS"]) if len(kw) > 0: kwl = kw[0].split() try: diff --git a/tatt/gentooPackage.py b/tatt/gentooPackage.py index ba5ec54..6df9264 100644 --- a/tatt/gentooPackage.py +++ b/tatt/gentooPackage.py @@ -1,6 +1,7 @@ """Module for easy access to portage's atom syntax """ import re +from portage.dep import dep_getcpv class gentooPackage(object): """A Gentoo package consists of: @@ -11,7 +12,7 @@ class gentooPackage(object): def __init__(self, st): """An atom is initialized from an atom string""" - if st[0] == '=': st = st[1:] + st = dep_getcpv(st) slashparts = st.split("/") self.category = slashparts[0] minusparts = slashparts[1].split("-") diff --git a/tatt/usecombis.py b/tatt/usecombis.py index 2cfdbe8..b40577c 100644 --- a/tatt/usecombis.py +++ b/tatt/usecombis.py @@ -3,7 +3,7 @@ import random import re import math -from portage.dep import check_required_use +from portage.dep import check_required_use, dep_getcpv from subprocess import * from .tool import unique @@ -18,7 +18,7 @@ def findUseFlagCombis (package, config, port): Generate combinations of use flags to test The output will be a list each containing a ready to use USE=... string """ - uselist = sorted(reduce_flags(get_flags(package.packageString()[1:]))) + uselist = sorted(reduce_flags(get_flags(dep_getcpv(package.packageString())))) # The uselist could have duplicates due to slot-conditional # output of equery uselist=unique(uselist) @@ -43,7 +43,7 @@ def findUseFlagCombis (package, config, port): swlist = list(range(2**len(uselist))) usecombis=[] - ruse = " ".join(port.aux_get(package.packageString()[1:], ["REQUIRED_USE"])) + ruse = " ".join(port.aux_get(dep_getcpv(package.packageString()), ["REQUIRED_USE"])) for sw in swlist: mod = [] act = [] # check_required_use doesn't like -flag entries |