summaryrefslogtreecommitdiff
blob: 76d75e34a6481a61219384ad45e0bd016b8d2d8e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
metagen is copyright 2004,2005 Rob Cakebread, released under
the terms of the GNU Public License v2


metagen is a command line tool that writes a Gentoo metadata.xml file 
in the current working directory.

The metagen package also has a metagenerator class that can be used
from Python to create metadata.xml files easily:

    from metagenerator import MyMetadata

    metadata = MyMetadata()
    metadata.set_herd(["python"])
    print metadata 

    metadata = MyMetadata()
    metadata.set_herd(["gnome", "python"])
    metadata.set_maintainer(["<pythonhead@gentoo.org>"], 
                            ["Rob Cakebread"], 
                            ["Maintainer description."]
                           )
    print metadata 

    * All methods use lists of strings as arguments except
      set_longdescription, which is a string

    * See meta_unittest.py for more detailed examples

    * There isn't much in the way of error checking in metagenerator.py
      Most of the sanity checking is done in metagen.py



Command line tool examples:

metagen -H python

 * One herd

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE pkgmetadata SYSTEMhttp://www.gentoo.org/dtd/metadata.dtd">
    <pkgmetadata>
            <herd>python</herd>
    </pkgmetadata>

metagen -m

 * This takes the maintainer info from your ECHANGELOG_USER variable
   and assigns "no-herd" as the herd.

    <?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>
            </maintainer>
    </pkgmetadata>


metagen -m -d "I maintain this because I'm crazy."

 * Maintainer with description of maintenance

    <?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>
                    <description>I maintain this because I'm crazy.</description>
            </maintainer>
    </pkgmetadata>


metagen -m -H python -l "This package does X, Y, and Z."

 * Maintainer, herd, long description

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE pkgmetadata SYSTEMhttp://www.gentoo.org/dtd/metadata.dtd">
    <pkgmetadata>
            <herd>python</herd>
            <maintainer>
                    <email>pythonhead@gentoo.org</email>
                    <name>Rob Cakebread</name>
            </maintainer>
            <longdescription>This package does X, Y, and Z.</longdescription>
    </pkgmetadata>

metagen -m -e "jdoe@gentoo.org","tsmith@gentoo.org" -n "Jane Doe","Tom Smith" -H python,gnome -l "This package does X, Y, and Z."

 * Two herds, 3 maintainers, long description

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE pkgmetadata SYSTEMhttp://www.gentoo.org/dtd/metadata.dtd">
    <pkgmetadata>
            <herd>python</herd>
            <herd>gnome</herd>
            <maintainer>
                    <email>pythonhead@gentoo.org</email>
                    <name>Rob Cakebread</name>
            </maintainer>
            <maintainer>
                    <email>jdoe@gentoo.org</email>
                    <name>Jane Doe</name>
            </maintainer>
            <maintainer>
                    <email>tsmith@gentoo.org</email>
                    <name>Tom Smith</name>
            </maintainer>
            <longdescription>This package does X, Y, and Z.</longdescription>
    </pkgmetadata>