From ddf1d9bb078a010915d576fb1ce50024c836fa2d Mon Sep 17 00:00:00 2001 From: "Jesus Rivero (Neurogeek)" Date: Sat, 13 Aug 2011 14:06:30 -0400 Subject: Added checks for HERD existance --- metagen/main.py | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/metagen/main.py b/metagen/main.py index 06f0239..22abbd5 100755 --- a/metagen/main.py +++ b/metagen/main.py @@ -1,31 +1,31 @@ #!/usr/bin/python - """ NAME - metagen - SYNOPSIS - Adds metadata.xml to current directory - -AUTHOR - Rob Cakebread - +AUTHOR - Rob Cakebread +AUTHOR - Jesus Rivero USE - metagen --help - EXAMPLES - man metagen """ -import sys import re import os +import sys from optparse import OptionParser from commands import getstatusoutput +from portage import config +from repoman import herdbase from portage.output import red, blue from metagen.version import __version__ from metagen import metagenerator +PORTDIR = config(local_config=False)["PORTDIR"] +HB = herdbase.make_herd_base(os.path.sep.join([PORTDIR, 'metadata', 'herds.xml'])) def parse_echangelog_variable(name, email): """Extract developer name and email from ECHANGELOG_USER variable""" @@ -64,6 +64,12 @@ def generate_xml(options): herds = options.herd.split(",") else: herds = ["no-herd"] + + for herd in herds: + if not HB.known_herd(herd): + print red("!!! Error. Herd %s does not exist." % herd) + sys.exit(1) + metadata.set_herd(herds) if options.echangelog: -- cgit v1.2.3-65-gdbad From 4b7238c6f5c70e2b1db43a499363107a5cafc18e Mon Sep 17 00:00:00 2001 From: "Jesus Rivero (Neurogeek)" Date: Fri, 9 Sep 2011 05:12:48 -0400 Subject: Version change for the inminent release of 0.6 --- metagen/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metagen/version.py b/metagen/version.py index 7f40384..743d158 100644 --- a/metagen/version.py +++ b/metagen/version.py @@ -1 +1 @@ -__version__="0.5.2" +__version__="0.6" -- cgit v1.2.3-65-gdbad From 72dcc70b58cfbe705696fefeb3e3a2f6dc309d20 Mon Sep 17 00:00:00 2001 From: "Jesus Rivero (Neurogeek)" Date: Fri, 9 Sep 2011 05:39:23 -0400 Subject: Fixed some failing tests --- metagen/meta_unittest.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/metagen/meta_unittest.py b/metagen/meta_unittest.py index 06208a6..2e6440a 100644 --- a/metagen/meta_unittest.py +++ b/metagen/meta_unittest.py @@ -6,13 +6,13 @@ from metagenerator import MyMetadata def test1(): """1 herd specified""" metadata = MyMetadata() - metadata.set_herd(("python")) + metadata.set_herd(["python"]) return metadata def test2(): """No herd specified, 1 maintainer""" metadata = MyMetadata() - metadata.set_herd([""]) + metadata.set_herd() metadata.set_maintainer([""], ["Rob Cakebread"], ["Maintainer description."] -- cgit v1.2.3-65-gdbad