diff options
-rw-r--r-- | .gitignore | 3 | ||||
-rw-r--r-- | docs/README | 5 | ||||
-rw-r--r-- | docs/metagen.1 | 7 | ||||
-rwxr-xr-x | metagen/main.py | 11 | ||||
-rw-r--r-- | metagen/meta_unittest.py | 12 | ||||
-rwxr-xr-x | metagen/metagenerator.py | 2 | ||||
-rwxr-xr-x | metagen/test_cli | 4 | ||||
-rw-r--r-- | metagen/version.py | 2 |
8 files changed, 17 insertions, 29 deletions
@@ -1,2 +1,3 @@ *.pyc - +dist/* +MANIFEST diff --git a/docs/README b/docs/README index 4f6bf0b..56c56c9 100644 --- a/docs/README +++ b/docs/README @@ -47,13 +47,11 @@ metagen -H python metagen -m - * This takes the maintainer info from your ECHANGELOG_USER variable - and assigns "no-herd" as the herd. + * This takes the maintainer info from your ECHANGELOG_USER variable. <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE pkgmetadata SYSTEMhttp://www.gentoo.org/dtd/metadata.dtd"> <pkgmetadata> - <herd>no-herd</herd> <maintainer> <email>pythonhead@gentoo.org</email> <name>Rob Cakebread</name> @@ -68,7 +66,6 @@ metagen -m -d "I maintain this because I'm crazy." <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE pkgmetadata SYSTEMhttp://www.gentoo.org/dtd/metadata.dtd"> <pkgmetadata> - <herd>no-herd</herd> <maintainer> <email>pythonhead@gentoo.org</email> <name>Rob Cakebread</name> diff --git a/docs/metagen.1 b/docs/metagen.1 index 0977087..c80d5db 100644 --- a/docs/metagen.1 +++ b/docs/metagen.1 @@ -1,4 +1,4 @@ -.\" Contact pythonhead@gentoo.org to correct errors or omissions. +.\" Contact neurogeek@gentoo.org to correct errors or omissions. .TH man 1 "22 August 2004" "1.0" "metagen man page" .SH NAME .B metagen @@ -8,7 +8,7 @@ [options] .SH DESCRIPTION .B metagen -will create a valid metadata.xml file in the current directory. metadata.xml requires a herd tag (-H). If you only specify a package maintainer's email address (-e) "no-herd" will be inserted in the herd tag automatically. +will create a valid metadata.xml file in the current directory. If you need multiple elements, such as two herds, use a comma to separate them. See EXAMPLES. @@ -67,7 +67,7 @@ Creates metadata in current directory with two herds and long description -d 'The voices in my head told me to maintain this package' \ -Q -herd='no-herd', maintainer email, maintainer name, description of maintainership, to stdout only +maintainer email, maintainer name, description of maintainership, to stdout only .B metagen -H net-p2p,python -e jo@gentoo.org,flo@gentoo.org \ @@ -89,6 +89,7 @@ No known bugs at this time. .SH AUTHOR .nf Rob 'pythonhead' Cakebread (pythonhead@gentoo.org) +Jesus Rivero (neurogeek@gentoo.org) .fi .SH HISTORY 2004 \- Initial revision diff --git a/metagen/main.py b/metagen/main.py index 22abbd5..0a996f7 100755 --- a/metagen/main.py +++ b/metagen/main.py @@ -62,8 +62,6 @@ def generate_xml(options): if options.herd: herds = options.herd.split(",") - else: - herds = ["no-herd"] for herd in herds: if not HB.known_herd(herd): @@ -96,7 +94,7 @@ def validate_xml(my_xml): """Test for valid XML""" #TODO validate against DTD #This just makes sure its valid XML of some sort. - #Probably not necessary since repoma validates against DTD? + #Probably not necessary since repoman validates against DTD? re_escape_quotes = re.compile('"') s = re_escape_quotes.sub('\\"', my_xml) cmd = "echo \"%s\" | xmllint --valid - 2>&1 > /dev/null" % s @@ -106,8 +104,7 @@ def validate_xml(my_xml): if __name__ == '__main__': optParser = OptionParser(version=__version__) optParser.add_option("-H", action="store", dest="herd", type="string", - help="Name of herd. If not specified, " + - "'no-herd' will be inserted. " + + help="Name of herd. If not specified, It will be empty. " + "This requires either the -e or -m option.") optParser.add_option("-e", action="store", dest="email", type="string", @@ -156,10 +153,6 @@ if __name__ == '__main__': print red("!!! Options -d and -n are only valid with -e or -m") sys.exit(1) - if options.herd == "no-herd" and not options.email and not options.echangelog: - print red("!!! You must specify a maintainer if you have no-herd.") - sys.exit(1) - if not options.herd and not options.email and not options.echangelog: print red("!!! You must specify at least a herd (-H) " + "or maintainer's email address (-e)\n") diff --git a/metagen/meta_unittest.py b/metagen/meta_unittest.py index 2e6440a..83c311d 100644 --- a/metagen/meta_unittest.py +++ b/metagen/meta_unittest.py @@ -15,8 +15,7 @@ def test2(): metadata.set_herd() metadata.set_maintainer(["<pythonhead@gentoo.org>"], ["Rob Cakebread"], - ["Maintainer description."] - ) + ["Maintainer description."]) return metadata def test3(): @@ -25,8 +24,7 @@ def test3(): metadata.set_herd(["python"]) metadata.set_maintainer(["<pythonhead@gentoo.org>"], ["Rob Cakebread"], - ["Maintainer description."] - ) + ["Maintainer description."]) return metadata def test4(): @@ -35,8 +33,7 @@ def test4(): metadata.set_herd(["python", "gnome"]) metadata.set_maintainer(["pythonhead@gentoo.org"], ["Rob Cakebread"], - ["Maintainer description."] - ) + ["Maintainer description."]) return metadata def test5(): @@ -45,8 +42,7 @@ def test5(): metadata.set_herd(["python", "gnome"]) metadata.set_maintainer(["goofy@gentoo.org", "pythonhead@gentoo.org"], ["Goo Fi", "Rob Cakebread"], - ["Maintainer one.", "Maintainer two"] - ) + ["Maintainer one.", "Maintainer two"]) metadata.set_longdescription("This packages does X Y and Z.") return metadata diff --git a/metagen/metagenerator.py b/metagen/metagenerator.py index 99aad2f..8b69ca0 100755 --- a/metagen/metagenerator.py +++ b/metagen/metagenerator.py @@ -17,7 +17,7 @@ class MyMetadata(jaxml.XML_document): '"http://www.gentoo.org/dtd/metadata.dtd">') self.pkgmetadata() - def set_herd(self, opt_herds=["no-herd"]): + def set_herd(self, opt_herds=[]): """Set herd(s)""" for my_herd in opt_herds: self.herd(my_herd) diff --git a/metagen/test_cli b/metagen/test_cli index 8995050..84cf9cf 100755 --- a/metagen/test_cli +++ b/metagen/test_cli @@ -15,8 +15,8 @@ echo 'metagen -m -H python -e "foo@bar.com" -d "Foo bar.","Chow fun" -Q' ./metagen.py -m -H python -e "foo@bar.com" -d "Foo bar.","Chow fun" -Q #Should fail: -echo 'metagen -H no-herd -Q' -./metagen.py -H no-herd -Q +echo 'metagen -Q' +./metagen.py -Q #Should fail: echo 'metagen -l "Long desc" -Q' diff --git a/metagen/version.py b/metagen/version.py index 743d158..f320129 100644 --- a/metagen/version.py +++ b/metagen/version.py @@ -1 +1 @@ -__version__="0.6" +__version__="0.6.1" |