Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 199788 | Differences between
and this patch

Collapse All | Expand All

(-)/usr/lib/portage/pym/repoman/utilities.py.old (+29 lines)
Lines 12-17 Link Here
12
import os
12
import os
13
import sys
13
import sys
14
14
15
from xml.dom import minidom
16
from xml.dom import NotFoundErr
15
from portage import output
17
from portage import output
16
from portage.output import red, green
18
from portage.output import red, green
17
from portage import exception
19
from portage import exception
Lines 109-114 Link Here
109
		usedict[pkg].add(flag)
111
		usedict[pkg].add(flag)
110
	return usedict
112
	return usedict
111
113
114
def parse_metadata_use(mylines, uselist=None):
115
	"""
116
	Records are wrapped in XML as per GLEP 56
117
	returns a dict of the form a list of flags"""
118
	if uselist is None:
119
		uselist = []
120
	metadatadom = minidom.parse(mylines)
121
122
	try:
123
		usetag = metadatadom.getElementsByTagName("use")
124
		if not usetag:
125
			return uselist
126
	except NotFoundErr:
127
		return uselist
128
129
	try:
130
		flags = usetag[0].getElementsByTagName("flag")
131
	except NotFoundErr:
132
		raise exception,ParseError("metadata.xml: Malformed input: missing 'flag' tag(s)")
133
	for flag in flags:
134
		pkg_flag = flag.getAttribute("name")
135
		if pkg_flag is "":
136
			raise exception,ParseError("metadata.xml: Malformed input: missing 'name' attribute for 'flag' tag")
137
		uselist.append(pkg_flag)
138
	metadatadom.unlink()
139
	return uselist
140
112
141
113
def FindPackagesToScan(settings, startdir, reposplit):
142
def FindPackagesToScan(settings, startdir, reposplit):
114
	""" Try to find packages that need to be scanned
143
	""" Try to find packages that need to be scanned

Return to bug 199788