1 |
commit: bdaf557f19876472cde430a53259b9e0bfee55fb |
2 |
Author: Jesus Rivero <neurogeek <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Sep 25 09:42:02 2011 +0000 |
4 |
Commit: Jesus Rivero <neurogeek <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Sep 25 09:42:02 2011 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/metagen.git;a=commit;h=bdaf557f |
7 |
|
8 |
Removed support for no-herd and empty herd tags |
9 |
|
10 |
--- |
11 |
docs/README | 5 +---- |
12 |
docs/metagen.1 | 7 ++++--- |
13 |
metagen/main.py | 11 ++--------- |
14 |
metagen/meta_unittest.py | 12 ++++-------- |
15 |
metagen/metagenerator.py | 2 +- |
16 |
metagen/test_cli | 4 ++-- |
17 |
metagen/version.py | 2 +- |
18 |
7 files changed, 15 insertions(+), 28 deletions(-) |
19 |
|
20 |
diff --git a/docs/README b/docs/README |
21 |
index 4f6bf0b..56c56c9 100644 |
22 |
--- a/docs/README |
23 |
+++ b/docs/README |
24 |
@@ -47,13 +47,11 @@ metagen -H python |
25 |
|
26 |
metagen -m |
27 |
|
28 |
- * This takes the maintainer info from your ECHANGELOG_USER variable |
29 |
- and assigns "no-herd" as the herd. |
30 |
+ * This takes the maintainer info from your ECHANGELOG_USER variable. |
31 |
|
32 |
<?xml version="1.0" encoding="UTF-8"?> |
33 |
<!DOCTYPE pkgmetadata SYSTEMhttp://www.gentoo.org/dtd/metadata.dtd"> |
34 |
<pkgmetadata> |
35 |
- <herd>no-herd</herd> |
36 |
<maintainer> |
37 |
<email>pythonhead@g.o</email> |
38 |
<name>Rob Cakebread</name> |
39 |
@@ -68,7 +66,6 @@ metagen -m -d "I maintain this because I'm crazy." |
40 |
<?xml version="1.0" encoding="UTF-8"?> |
41 |
<!DOCTYPE pkgmetadata SYSTEMhttp://www.gentoo.org/dtd/metadata.dtd"> |
42 |
<pkgmetadata> |
43 |
- <herd>no-herd</herd> |
44 |
<maintainer> |
45 |
<email>pythonhead@g.o</email> |
46 |
<name>Rob Cakebread</name> |
47 |
|
48 |
diff --git a/docs/metagen.1 b/docs/metagen.1 |
49 |
index 0977087..c80d5db 100644 |
50 |
--- a/docs/metagen.1 |
51 |
+++ b/docs/metagen.1 |
52 |
@@ -1,4 +1,4 @@ |
53 |
-.\" Contact pythonhead@g.o to correct errors or omissions. |
54 |
+.\" Contact neurogeek@g.o to correct errors or omissions. |
55 |
.TH man 1 "22 August 2004" "1.0" "metagen man page" |
56 |
.SH NAME |
57 |
.B metagen |
58 |
@@ -8,7 +8,7 @@ |
59 |
[options] |
60 |
.SH DESCRIPTION |
61 |
.B metagen |
62 |
-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. |
63 |
+will create a valid metadata.xml file in the current directory. |
64 |
|
65 |
If you need multiple elements, such as two herds, use a comma to |
66 |
separate them. See EXAMPLES. |
67 |
@@ -67,7 +67,7 @@ Creates metadata in current directory with two herds and long description |
68 |
-d 'The voices in my head told me to maintain this package' \ |
69 |
-Q |
70 |
|
71 |
-herd='no-herd', maintainer email, maintainer name, description of maintainership, to stdout only |
72 |
+maintainer email, maintainer name, description of maintainership, to stdout only |
73 |
|
74 |
|
75 |
.B metagen -H net-p2p,python -e jo@g.o,flo@g.o \ |
76 |
@@ -89,6 +89,7 @@ No known bugs at this time. |
77 |
.SH AUTHOR |
78 |
.nf |
79 |
Rob 'pythonhead' Cakebread (pythonhead@g.o) |
80 |
+Jesus Rivero (neurogeek@g.o) |
81 |
.fi |
82 |
.SH HISTORY |
83 |
2004 \- Initial revision |
84 |
|
85 |
diff --git a/metagen/main.py b/metagen/main.py |
86 |
index 22abbd5..0a996f7 100755 |
87 |
--- a/metagen/main.py |
88 |
+++ b/metagen/main.py |
89 |
@@ -62,8 +62,6 @@ def generate_xml(options): |
90 |
|
91 |
if options.herd: |
92 |
herds = options.herd.split(",") |
93 |
- else: |
94 |
- herds = ["no-herd"] |
95 |
|
96 |
for herd in herds: |
97 |
if not HB.known_herd(herd): |
98 |
@@ -96,7 +94,7 @@ def validate_xml(my_xml): |
99 |
"""Test for valid XML""" |
100 |
#TODO validate against DTD |
101 |
#This just makes sure its valid XML of some sort. |
102 |
- #Probably not necessary since repoma validates against DTD? |
103 |
+ #Probably not necessary since repoman validates against DTD? |
104 |
re_escape_quotes = re.compile('"') |
105 |
s = re_escape_quotes.sub('\\"', my_xml) |
106 |
cmd = "echo \"%s\" | xmllint --valid - 2>&1 > /dev/null" % s |
107 |
@@ -106,8 +104,7 @@ def validate_xml(my_xml): |
108 |
if __name__ == '__main__': |
109 |
optParser = OptionParser(version=__version__) |
110 |
optParser.add_option("-H", action="store", dest="herd", type="string", |
111 |
- help="Name of herd. If not specified, " + |
112 |
- "'no-herd' will be inserted. " + |
113 |
+ help="Name of herd. If not specified, It will be empty. " + |
114 |
"This requires either the -e or -m option.") |
115 |
|
116 |
optParser.add_option("-e", action="store", dest="email", type="string", |
117 |
@@ -156,10 +153,6 @@ if __name__ == '__main__': |
118 |
print red("!!! Options -d and -n are only valid with -e or -m") |
119 |
sys.exit(1) |
120 |
|
121 |
- if options.herd == "no-herd" and not options.email and not options.echangelog: |
122 |
- print red("!!! You must specify a maintainer if you have no-herd.") |
123 |
- sys.exit(1) |
124 |
- |
125 |
if not options.herd and not options.email and not options.echangelog: |
126 |
print red("!!! You must specify at least a herd (-H) " + |
127 |
"or maintainer's email address (-e)\n") |
128 |
|
129 |
diff --git a/metagen/meta_unittest.py b/metagen/meta_unittest.py |
130 |
index 2e6440a..83c311d 100644 |
131 |
--- a/metagen/meta_unittest.py |
132 |
+++ b/metagen/meta_unittest.py |
133 |
@@ -15,8 +15,7 @@ def test2(): |
134 |
metadata.set_herd() |
135 |
metadata.set_maintainer(["<pythonhead@g.o>"], |
136 |
["Rob Cakebread"], |
137 |
- ["Maintainer description."] |
138 |
- ) |
139 |
+ ["Maintainer description."]) |
140 |
return metadata |
141 |
|
142 |
def test3(): |
143 |
@@ -25,8 +24,7 @@ def test3(): |
144 |
metadata.set_herd(["python"]) |
145 |
metadata.set_maintainer(["<pythonhead@g.o>"], |
146 |
["Rob Cakebread"], |
147 |
- ["Maintainer description."] |
148 |
- ) |
149 |
+ ["Maintainer description."]) |
150 |
return metadata |
151 |
|
152 |
def test4(): |
153 |
@@ -35,8 +33,7 @@ def test4(): |
154 |
metadata.set_herd(["python", "gnome"]) |
155 |
metadata.set_maintainer(["pythonhead@g.o"], |
156 |
["Rob Cakebread"], |
157 |
- ["Maintainer description."] |
158 |
- ) |
159 |
+ ["Maintainer description."]) |
160 |
return metadata |
161 |
|
162 |
def test5(): |
163 |
@@ -45,8 +42,7 @@ def test5(): |
164 |
metadata.set_herd(["python", "gnome"]) |
165 |
metadata.set_maintainer(["goofy@g.o", "pythonhead@g.o"], |
166 |
["Goo Fi", "Rob Cakebread"], |
167 |
- ["Maintainer one.", "Maintainer two"] |
168 |
- ) |
169 |
+ ["Maintainer one.", "Maintainer two"]) |
170 |
metadata.set_longdescription("This packages does X Y and Z.") |
171 |
return metadata |
172 |
|
173 |
|
174 |
diff --git a/metagen/metagenerator.py b/metagen/metagenerator.py |
175 |
index 99aad2f..8b69ca0 100755 |
176 |
--- a/metagen/metagenerator.py |
177 |
+++ b/metagen/metagenerator.py |
178 |
@@ -17,7 +17,7 @@ class MyMetadata(jaxml.XML_document): |
179 |
'"http://www.gentoo.org/dtd/metadata.dtd">') |
180 |
self.pkgmetadata() |
181 |
|
182 |
- def set_herd(self, opt_herds=["no-herd"]): |
183 |
+ def set_herd(self, opt_herds=[]): |
184 |
"""Set herd(s)""" |
185 |
for my_herd in opt_herds: |
186 |
self.herd(my_herd) |
187 |
|
188 |
diff --git a/metagen/test_cli b/metagen/test_cli |
189 |
index 8995050..84cf9cf 100755 |
190 |
--- a/metagen/test_cli |
191 |
+++ b/metagen/test_cli |
192 |
@@ -15,8 +15,8 @@ echo 'metagen -m -H python -e "foo@×××.com" -d "Foo bar.","Chow fun" -Q' |
193 |
./metagen.py -m -H python -e "foo@×××.com" -d "Foo bar.","Chow fun" -Q |
194 |
|
195 |
#Should fail: |
196 |
-echo 'metagen -H no-herd -Q' |
197 |
-./metagen.py -H no-herd -Q |
198 |
+echo 'metagen -Q' |
199 |
+./metagen.py -Q |
200 |
|
201 |
#Should fail: |
202 |
echo 'metagen -l "Long desc" -Q' |
203 |
|
204 |
diff --git a/metagen/version.py b/metagen/version.py |
205 |
index 743d158..f320129 100644 |
206 |
--- a/metagen/version.py |
207 |
+++ b/metagen/version.py |
208 |
@@ -1 +1 @@ |
209 |
-__version__="0.6" |
210 |
+__version__="0.6.1" |