aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRolf Eike Beer <eike@sf-mail.de>2017-12-02 21:58:18 +0100
committerkensington <kensington@gentoo.org>2017-12-05 22:59:32 +1100
commit34d64c3a8f36151e42b2bc7ad56d5ede8ab8b9e6 (patch)
treee6def505cdb1d89c58a9f25b74ddb658f40f0bca
parentexplicitely flag blocked packages and circular dependencies (diff)
downloadtatt-34d64c3a8f36151e42b2bc7ad56d5ede8ab8b9e6.tar.gz
tatt-34d64c3a8f36151e42b2bc7ad56d5ede8ab8b9e6.tar.bz2
tatt-34d64c3a8f36151e42b2bc7ad56d5ede8ab8b9e6.zip
filter out already stable packages earlier
Drop them entirely from the package list, not only for the use flag testing. This avoids needless rdep testing and unmasking, too.
-rwxr-xr-xscripts/tatt19
-rw-r--r--tatt/scriptwriter.py16
2 files changed, 19 insertions, 16 deletions
diff --git a/scripts/tatt b/scripts/tatt
index 68897fc..f680f4e 100755
--- a/scripts/tatt
+++ b/scripts/tatt
@@ -5,6 +5,7 @@ from subprocess import *
import sys
import re
import os
+import portage
import base64
import requests
@@ -182,8 +183,26 @@ if myJob.packageList is not None and len(myJob.packageList) > 0:
print ("Jobname: " + myJob.name)
## Determine jobtype
+ port = portage.db[portage.root]["porttree"].dbapi
+
+ filteredPackages = []
for p in myJob.packageList:
print("Found the following package atom : " + p.packageString())
+ # check if the package already has the needed keywords
+ if config['arch']:
+ kw = port.aux_get(p.packageString()[1:], ["KEYWORDS"])
+ if len(kw) > 0:
+ kwl = kw[0].split()
+ try:
+ kwl.index(config['arch'])
+ # the list of keywords in portage already contains the target
+ # keyword, skip this package
+ print("\talready stable")
+ continue
+ except ValueError:
+ filteredPackages.append(p)
+
+ myJob.packageList = filteredPackages
# Unmasking:
try:
diff --git a/tatt/scriptwriter.py b/tatt/scriptwriter.py
index 23eb8a1..fd2135e 100644
--- a/tatt/scriptwriter.py
+++ b/tatt/scriptwriter.py
@@ -2,7 +2,6 @@
import random
import os
-import portage
import sys
from .usecombis import findUseFlagCombis
@@ -50,8 +49,6 @@ def writeusecombiscript(job, config):
# config is a tatt configuration
useheader = scriptTemplate(job.name, config, "use-header")
- port = portage.db[portage.root]["porttree"].dbapi
-
outfilename = (job.name + "-useflags.sh")
reportname = (job.name + ".report")
if os.path.isfile(outfilename):
@@ -59,19 +56,6 @@ def writeusecombiscript(job, config):
outfile = open(outfilename, 'w')
outfile.write(useheader)
for p in job.packageList:
- # check if the package already has the needed keywords
- if config['arch']:
- kw = port.aux_get(p.packageString()[1:], ["KEYWORDS"])
- if len(kw) > 0:
- kwl = kw[0].split()
- try:
- kwl.index(config['arch'])
- # the list of keywords in portage already contains the target
- # keyword, skip this package
- continue
- except ValueError:
- pass
-
outfile.write("# Code for " + p.packageCatName() + "\n")
outfile.write(useCombiTestString(job.name, p, config))
outfile.write("echo >> " + reportname + "\n")