- raise Exception,'error in left expression %r'%left
-
- except Exception,e:
- ok=False
- print >> stderr, "%s:%d:syntax error: %r"%(filename,lineno,e)
- except Exception,e:
- ok=False
- print >> stderr, 'Could not parse file',filename,e
- return (ok,included,excluded)
+ m = self.m_qualified.match(left)
+ if m:
+ (plus_minus, kw, qual, fcdistro) = m.groups()
+ if kw not in known_keywords:
+ raise Exception("Unknown keyword in {left}".format(**locals()))
+ if fcdistro not in known_fcdistros:
+ raise Exception('Unknown fcdistro {fcdistro}'.format(**locals()))
+ # skip if another keyword
+ if kw != self.keyword: continue
+ # does this fcdistro match ?
+ (distro, version) = m_fcdistro_cutter.match(fcdistro).groups()
+ version = int (version)
+ # skip if another distro family
+ if distro != self.distro: continue
+ # skip if the qualifier does not fit
+ if not self.match (qual, version):
+ if self.options.verbose:
+ print('{filename}:{lineno}:qualifer {left} does not apply'
+ .format(**locals()), file=stderr)
+ continue
+ # we're in, let's add (default) or remove (if plus_minus is minus)
+ if plus_minus == '-':
+ if self.options.verbose:
+ print('{filename}:{lineno}: from {left}, excluding {rights}'
+ .format(**locals()), file=stderr)
+ excluded += rights.split()
+ else:
+ if self.options.verbose:
+ print('{filename}:{lineno}: from {left}, including {rights}'\
+ .format(**locals()), file=stderr)
+ included += rights.split()
+ elif self.m_old.match(left):
+ raise Exception('Old-fashioned syntax not supported anymore {left}'.\
+ format(**locals()))
+ else:
+ raise Exception('error in left expression {left}'.format(**locals()))
+
+ except Exception as e:
+ ok = False
+ print("{filename}:{lineno}:syntax error: {e}".format(**locals()), file=stderr)
+ except Exception as exc:
+ ok = False
+ print('Could not parse file', filename, exc, file=stderr)
+ return (ok, included, excluded)