Gentoo Archives: gentoo-commits

From: "Christian Ruppert (idl0r)" <idl0r@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoolkit r693 - in trunk/gentoolkit-dev: . src/imlate
Date: Mon, 26 Oct 2009 10:09:06
Message-Id: E1N2MVc-0004zt-SW@stork.gentoo.org
1 Author: idl0r
2 Date: 2009-10-26 10:09:04 +0000 (Mon, 26 Oct 2009)
3 New Revision: 693
4
5 Modified:
6 trunk/gentoolkit-dev/ChangeLog
7 trunk/gentoolkit-dev/src/imlate/imlate
8 Log:
9 imlate: Some cleanup. Disable metadata warnings.
10
11
12 Modified: trunk/gentoolkit-dev/ChangeLog
13 ===================================================================
14 --- trunk/gentoolkit-dev/ChangeLog 2009-10-26 08:52:01 UTC (rev 692)
15 +++ trunk/gentoolkit-dev/ChangeLog 2009-10-26 10:09:04 UTC (rev 693)
16 @@ -1,4 +1,8 @@
17 2009-22-10: Christian Ruppert <idl0r@g.o>
18 + src/imlate/imlate: Some cleanup.
19 + Disable metadata warnings.
20 +
21 +2009-22-10: Christian Ruppert <idl0r@g.o>
22 src/imlate/imlate.1: Update man-page.
23
24 2009-11-10: Christian Ruppert <idl0r@g.o>
25
26 Modified: trunk/gentoolkit-dev/src/imlate/imlate
27 ===================================================================
28 --- trunk/gentoolkit-dev/src/imlate/imlate 2009-10-26 08:52:01 UTC (rev 692)
29 +++ trunk/gentoolkit-dev/src/imlate/imlate 2009-10-26 10:09:04 UTC (rev 693)
30 @@ -29,6 +29,7 @@
31 from xml.parsers.expat import ExpatError
32 # TODO: just import needed stuff to safe memory and maybe use "as foo"
33 import portage
34 +import portage.versions
35
36 if __name__ == "__main__":
37 from optparse import OptionParser
38 @@ -39,7 +40,7 @@
39 # the problem is the keyword handling (ACCEPT_KEYWORDS)
40 # portage < 2.1.6 does not support -*
41 # but -* is needed to ensure that we just check for arch
42 -if portage.vercmp(portage.VERSION, "2.1.6") < 0:
43 +if portage.versions.vercmp(portage.VERSION, "2.1.6") < 0:
44 raise StandardError, "imlate requires portage >=2.1.6"
45
46 # override/change portage module settings
47 @@ -138,8 +139,8 @@
48 node = _element.getElementsByTagName(tag)
49
50 if tag == "herd" and (not node or not node[0].childNodes):
51 - print >> stderr, "'%s' is missing a <herd> tag or it is empty," % metadata
52 - print >> stderr, "please file a bug at https://bugs.gentoo.org and refer to http://www.gentoo.org/proj/en/devrel/handbook/handbook.xml?part=2&chap=4"
53 +# print >> stderr, "'%s' is missing a <herd> tag or it is empty," % metadata
54 +# print >> stderr, "please file a bug at https://bugs.gentoo.org and refer to http://www.gentoo.org/proj/en/devrel/handbook/handbook.xml?part=2&chap=4"
55 values.append("no-herd")
56 continue
57
58 @@ -166,10 +167,10 @@
59 return False
60 else:
61 for addy in data:
62 - for foo in mtainer:
63 - if addy == foo:
64 + for contact in mtainer:
65 + if addy == contact:
66 return True
67 - if addy.startswith(foo):
68 + if addy.startswith(contact):
69 return True
70 return False
71
72 @@ -230,10 +231,10 @@
73 slots[slot].append(cpvr)
74
75 for slot in sorted(slots):
76 - cpvr = portage.best( slots[slot] )
77 + cpvr = portage.versions.best( slots[slot] )
78
79 if cpvr:
80 - ( cat, pkg, ver, rev ) = portage.catpkgsplit( cpvr )
81 + ( cat, pkg, ver, rev ) = portage.versions.catpkgsplit( cpvr )
82
83 if not cat in _pkgs.keys():
84 _pkgs[cat] = {}
85 @@ -320,9 +321,9 @@
86 continue
87
88 # look for an existing stable version
89 - our = portage.best( conf["portdb"].dbapi.match( "%s/%s%s" % ( cat, pkg, slot ) ) )
90 + our = portage.versions.best( conf["portdb"].dbapi.match( "%s/%s%s" % ( cat, pkg, slot ) ) )
91 if our:
92 - _foo = portage.pkgsplit( our )
93 + _foo = portage.versions.pkgsplit( our )
94 our_ver = _foo[1]
95 if _foo[2] != "r0":
96 our_ver = "%s-%s" % ( our_ver, _foo[2] )
97 @@ -331,7 +332,7 @@
98
99 # we just need the version if > our_ver
100 if our_ver:
101 - if portage.vercmp( our_ver, vr ) >= 0:
102 + if portage.versions.vercmp( our_ver, vr ) >= 0:
103 continue
104
105 if kwd_type == 1 and conf["STABLE"]:
106 @@ -396,19 +397,19 @@
107 parser.disable_interspersed_args()
108
109 parser.add_option( "-f", "--file", dest = "filename", action = "store", type = "string",
110 - help = "write result into FILE [default: %default]", metavar = "FILE", default = "stdout" )
111 + help = "write result into FILE [default: %default]", metavar = "FILE", default = "stdout" )
112 parser.add_option( "-m", "--main", dest = "main_arch", action = "store", type = "string",
113 - help = "set main ARCH (e.g. your arch) [default: %default]", metavar = "ARCH", default = MAIN_ARCH )
114 + help = "set main ARCH (e.g. your arch) [default: %default]", metavar = "ARCH", default = MAIN_ARCH )
115 parser.add_option( "-t", "--target", dest = "target_arch", action = "store", type = "string",
116 - help = "set target ARCH (e.g. x86) [default: %default]", metavar = "ARCH", default = TARGET_ARCH )
117 + help = "set target ARCH (e.g. x86) [default: %default]", metavar = "ARCH", default = TARGET_ARCH )
118 parser.add_option( "--mtime", dest = "mtime", action = "store", type = "int",
119 help = "set minimum MTIME in days [default: %default]", metavar = "MTIME", default = 30 )
120
121 # TODO: leave a good comment here (about True/False) :)
122 parser.add_option( "-s", "--stable", dest = "stable", action = "store_true", default = False,
123 - help = "just show stable candidates (e.g. -s and -k is the default result) [default: True]" )
124 + help = "just show stable candidates (e.g. -s and -k is the default result) [default: True]" )
125 parser.add_option( "-k", "--keyword", dest = "keyword", action = "store_true", default = False,
126 - help = "just show keyword candidates (e.g. -s and -k is the default result) [default: True]" )
127 + help = "just show keyword candidates (e.g. -s and -k is the default result) [default: True]" )
128
129 parser.add_option( "-M", "--maintainer", dest = "maintainer", action = "store", type = "string",
130 help = "Show only packages from the specified maintainer", metavar = "MAINTAINER", default = None)
131 @@ -418,11 +419,11 @@
132
133 # # EXPERIMENTAL
134 # parser.add_option( "-e", "--experimental", dest = "experimental", action = "store_true", default = False,
135 -# help = "enables experimental functions/features (have a look for # EXPERIMENTAL comments in the source) [default: %default]" )
136 +# help = "enables experimental functions/features (have a look for # EXPERIMENTAL comments in the source) [default: %default]" )
137
138 parser.add_option( "-C", "--category", "--categories", dest = "categories", action = "store", default = None,
139 - metavar = "CATEGORIES",
140 - help = "just check in the specified category/categories (comma separated) [default: %default]")
141 + metavar = "CATEGORIES",
142 + help = "just check in the specified category/categories (comma separated) [default: %default]")
143
144 ( options, args ) = parser.parse_args()