Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 214166 Details for
Bug 298389
IUSE_DRIZZLED_PLUGINS for dev-db/drizzle
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
extract_plugins.py try to detect plugins from configure --help output
extract_plugins.py (text/plain), 2.57 KB, created by
Francesco Riosa
on 2009-12-26 00:14:54 UTC
(
hide
)
Description:
extract_plugins.py try to detect plugins from configure --help output
Filename:
MIME Type:
Creator:
Francesco Riosa
Created:
2009-12-26 00:14:54 UTC
Size:
2.57 KB
patch
obsolete
>#!/usr/bin/python -O ># -*- coding: utf-8 -*- ># kate: encoding utf-8; eol unix ># kate: indent-width 4; mixedindent off; replace-tabs on; remove-trailing-space on; space-indent on ># kate: word-wrap-column 120; word-wrap off > ># need: ># app-text/htmltidy > >#import sys >#import time >import xml.dom.minidom as md >#import mechanize >#import pickle >import subprocess > >import re > >#sys.path = ["/srv/sources/brother_py/lib"]+sys.path > ># output of configure --help >FILENAME_CONFIG="/home/vivo/tmp/drizzle/config--help" ># creation path of metadata.xml >FILENAME_METADATA="/home/vivo/tmp/drizzle/metadata.xml" > >RE_PLUGINS = re.compile(r"""(?mxu) >^ >\s\s --with-(?P<plugin>.*)-plugin >\s+ (?P<description>.*) >\s+ \[default=(?P<Pdefault>[^\]]*) \] >""") > >#xfce-extra/xfce4-screenshooter:zimagez - Optional support to host screenshots on ZimageZ, a free online image service > >config_help = open(FILENAME_CONFIG, 'r').read() > >plugins = RE_PLUGINS.findall(config_help) > >################### metadata.xml ################### > >#<?xml version="1.0" encoding="UTF-8"?> >#<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> >METADATA = """ ><pkgmetadata> > <herd>mysql</herd> > <maintainer> > <email>vivo75@gmail.com</email> > </maintainer> > <use> > <flag name='debug'>Compile with debug support</flag> > <flag name='local-infile'>Enable LOAD DATA LOCAL INFILE</flag> > </use> ></pkgmetadata> >""" > >metadata_dom = md.parseString(METADATA) > >pkgmetadata = metadata_dom.getElementsByTagName("pkgmetadata")[0] >doctype = md.DocumentType("pkgmetadata") >doctype.systemId = "http://www.gentoo.org/dtd/metadata.dtd" >metadata_dom.insertBefore(doctype, pkgmetadata) > >uses = metadata_dom.getElementsByTagName("use")[0] >for p in plugins: > newuse = metadata_dom.createElement('flag') > newuse.setAttribute("name", "plugin-" + p[0].strip().lower()) > newuse.appendChild(metadata_dom.createTextNode(p[1].strip())) > uses.appendChild(newuse) > >print "writing %s" % FILENAME_METADATA >metadata_dom.writexml(open(FILENAME_METADATA, 'w'), indent="", addindent=" "*4, newl="\n", encoding="UTF-8") >print "tidying %s" % FILENAME_METADATA >p = subprocess.Popen("/usr/bin/tidy -i -xml -utf8 -wrap 120 -modify '%s'" % FILENAME_METADATA, shell=True) > >################### IUSE || USE_EXPAND ################### > >iuse_plugins = 'IUSE_PLUGINS="' >indent = "\n" + " " * len(iuse_plugins) > >tmp_plug = [] >for p in plugins: > if p[2].lower() == "yes": > tmp_plug.append("+plugin-" + p[0].lower()) > else: > tmp_plug.append("plugin-" + p[0].lower()) > >iuse_plugins = iuse_plugins + indent.join(tmp_plug).strip() + '"' >print iuse_plugins
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 298389
: 214166 |
214167
|
214169
|
214171