summaryrefslogtreecommitdiff
path: root/portato
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.net>2009-03-18 19:20:40 +0100
committerRené 'Necoro' Neumann <necoro@necoro.net>2009-03-18 19:20:40 +0100
commit4ca2d0a723d9084ccb2c8fafbea3f817bf70ca54 (patch)
treee9770ed5871b4b514d1a57aee22fc530d7254145 /portato
parent85a0dbcd99f85e98c3b55f47ced108aa15a3546e (diff)
downloadportato-4ca2d0a723d9084ccb2c8fafbea3f817bf70ca54.tar.gz
portato-4ca2d0a723d9084ccb2c8fafbea3f817bf70ca54.tar.bz2
portato-4ca2d0a723d9084ccb2c8fafbea3f817bf70ca54.zip
Deal with keyword lines missing a keyword
Diffstat (limited to '')
-rw-r--r--portato/backend/flags.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/portato/backend/flags.py b/portato/backend/flags.py
index 0c3713d..5d786b8 100644
--- a/portato/backend/flags.py
+++ b/portato/backend/flags.py
@@ -18,7 +18,7 @@ import itertools as itt
from subprocess import Popen, PIPE # needed for grep
from . import system, is_package
-from ..helper import debug, error, unique_array
+from ..helper import debug, error, warning, unique_array
CONFIG = {
"usefile" : "portato",
@@ -671,7 +671,7 @@ def set_testing (pkg, enable):
arch = pkg.get_global_settings("ARCH")
cpv = pkg.get_cpv()
- if not cpv in newTesting:
+ if not cpv in newTesting:
newTesting[cpv] = []
for file, line in newTesting[cpv]:
@@ -685,7 +685,14 @@ def set_testing (pkg, enable):
test = get_data(pkg, CONST.testing_path())
debug("data (test): %s", str(test))
for file, line, crit, flags in test:
- if pkg.matches(crit) and flags[0] == "~"+arch:
+ try:
+ flagMatches = flags[0] == "~"+arch
+ except IndexError: # no flags
+ warning(_("Line %(line)s in file %(file)s misses a keyword (i.e. '~x86')."), {'line' : line, 'file': file})
+ debug("No keyword. Assuming match.")
+ flagMatches = True
+
+ if pkg.matches(crit) and flagMatches:
newTesting[cpv].append((file, line))
else:
if CONST.testing_path_is_dir():