diff options
author | Zac Medico <zmedico@gentoo.org> | 2012-11-13 19:17:24 -0800 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2012-11-13 19:17:24 -0800 |
commit | 118db4184de67450ec7118f1607b3f8c8ed1ec9e (patch) | |
tree | d23dd179c3460114e5f171622bdc08b7ce203b2f /bin | |
parent | 0f51adcadce66e5ecdac4ce42148d725c6b7227d (diff) | |
download | portage-118db4184de67450ec7118f1607b3f8c8ed1ec9e.tar.gz portage-118db4184de67450ec7118f1607b3f8c8ed1ec9e.tar.bz2 portage-118db4184de67450ec7118f1607b3f8c8ed1ec9e.zip |
repoman: validate use restrict atoms, bug #442786
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/repoman | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/bin/repoman b/bin/repoman index 553b1d20f..91a98153b 100755 --- a/bin/repoman +++ b/bin/repoman @@ -69,8 +69,9 @@ import portage.checksum import portage.const from portage import cvstree, normalize_path from portage import util -from portage.exception import (FileNotFound, MissingParameter, +from portage.exception import (FileNotFound, InvalidAtom, MissingParameter, ParseError, PermissionDenied) +from portage.dep import Atom from portage.process import find_binary, spawn from portage.output import bold, create_color_func, \ green, nocolor, red @@ -1661,6 +1662,22 @@ for x in effective_scanlist: metadata_bad = True stats["metadata.bad"] += 1 fails["metadata.bad"].append("%s/metadata.xml: %s" % (x, e)) + else: + for atom in chain(*musedict.values()): + if atom is None: + continue + try: + atom = Atom(atom) + except InvalidAtom as e: + stats["metadata.bad"] += 1 + fails["metadata.bad"].append( + "%s/metadata.xml: Invalid atom: %s" % (x, e)) + else: + if atom.cp != x: + stats["metadata.bad"] += 1 + fails["metadata.bad"].append( + ("%s/metadata.xml: Atom contains " + "unexpected cat/pn: %s") % (x, atom)) # Run other metadata.xml checkers try: |