diff options
author | Nirbheek Chauhan <nirbheek@gentoo.org> | 2012-04-02 00:42:23 +0530 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@gentoo.org> | 2012-04-02 00:42:29 +0530 |
commit | 47392a028ee246f124d03f4c25851111dff5e2d5 (patch) | |
tree | 9a92ccdccff6c3ef7a99e507cfa93e05a13625fe | |
parent | Update package.keywords.gnome3 (diff) | |
download | gnome-47392a028ee246f124d03f4c25851111dff5e2d5.tar.gz gnome-47392a028ee246f124d03f4c25851111dff5e2d5.tar.bz2 gnome-47392a028ee246f124d03f4c25851111dff5e2d5.zip |
scripts/gen_archlist.py: add the ability to append slot info
* As requested by pacho
-rwxr-xr-x | scripts/gen_archlist.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/scripts/gen_archlist.py b/scripts/gen_archlist.py index ffef7eb9..8f0e9a8d 100755 --- a/scripts/gen_archlist.py +++ b/scripts/gen_archlist.py @@ -44,6 +44,7 @@ LINE_SEP = '' DEBUG = False EXTREME_DEBUG = False CHECK_DEPS = False +APPEND_SLOTS = False # Check for stable keywords STABLE = True @@ -80,6 +81,9 @@ else: if os.environ.has_key('CHECK_DEPS'): CHECK_DEPS = os.environ['CHECK_DEPS'] +if os.environ.has_key('APPEND_SLOTS'): + APPEND_SLOTS = os.environ['APPEND_SLOTS'] + if not STABLE: print 'Currently broken for anything except STABLEREQ' print 'Please set STABLE to True' @@ -384,6 +388,15 @@ def consolidate_dupes(cpv_kws): return deduped_cpv_kws +def append_slots(cpv_kws): + "Append slots at the end of cpv atoms" + slotifyed_cpv_kws = [] + for (cpv, kws) in cpv_kws: + slot = portage.portage.portdb.aux_get(cpv, ['SLOT'])[0] + cpv = "%s:%s" % (cpv, slot) + slotifyed_cpv_kws.append([cpv, kws]) + return slotifyed_cpv_kws + # FIXME: This is broken def prettify(cpv_kws): "Takes a list of [cpv, [kws]] and prettifies it" @@ -468,6 +481,8 @@ if __name__ == "__main__": ALL_CPV_KWS.append(LINE_SEP) ALL_CPV_KWS = consolidate_dupes(ALL_CPV_KWS) + if APPEND_SLOTS: + ALL_CPV_KWS = append_slots(ALL_CPV_KWS) for i in prettify(ALL_CPV_KWS): print i[0], flatten(i[1]) |