Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 546512
Collapse All | Expand All

(-)a/pym/portage/package/ebuild/_config/UseManager.py (-1 / +7 lines)
Lines 208-213 class UseManager(object): Link Here
208
			useflags = []
208
			useflags = []
209
			use_expand_prefix = ''
209
			use_expand_prefix = ''
210
			for prefixed_useflag in v:
210
			for prefixed_useflag in v:
211
				if extended_syntax and prefixed_useflag == "\n":
212
					use_expand_prefix = ""
213
					continue
211
				if extended_syntax and prefixed_useflag[-1] == ":":
214
				if extended_syntax and prefixed_useflag[-1] == ":":
212
					use_expand_prefix = prefixed_useflag[:-1].lower() + "_"
215
					use_expand_prefix = prefixed_useflag[:-1].lower() + "_"
213
					continue
216
					continue
Lines 236-246 class UseManager(object): Link Here
236
		ret = ExtendedAtomDict(dict)
239
		ret = ExtendedAtomDict(dict)
237
		if user_config:
240
		if user_config:
238
			pusedict = grabdict_package(
241
			pusedict = grabdict_package(
239
				os.path.join(location, file_name), recursive=1, allow_wildcard=True, allow_repo=True, verify_eapi=False)
242
				os.path.join(location, file_name), recursive=1, newlines=1, allow_wildcard=True, allow_repo=True, verify_eapi=False)
240
			for k, v in pusedict.items():
243
			for k, v in pusedict.items():
241
				l = []
244
				l = []
242
				use_expand_prefix = ''
245
				use_expand_prefix = ''
243
				for flag in v:
246
				for flag in v:
247
					if flag == "\n":
248
						use_expand_prefix = ""
249
						continue
244
					if flag[-1] == ":":
250
					if flag[-1] == ":":
245
						use_expand_prefix = flag[:-1].lower() + "_"
251
						use_expand_prefix = flag[:-1].lower() + "_"
246
						continue
252
						continue
(-)a/pym/portage/util/__init__.py (-4 / +7 lines)
Lines 340-346 def stack_lists(lists, incremental=1, remember_source_file=False, Link Here
340
	else:
340
	else:
341
		return list(new_list)
341
		return list(new_list)
342
342
343
def grabdict(myfilename, juststrings=0, empty=0, recursive=0, incremental=1):
343
def grabdict(myfilename, juststrings=0, empty=0, recursive=0, incremental=1, newlines=0):
344
	"""
344
	"""
345
	This function grabs the lines in a file, normalizes whitespace and returns lines in a dictionary
345
	This function grabs the lines in a file, normalizes whitespace and returns lines in a dictionary
346
346
Lines 354-359 def grabdict(myfilename, juststrings=0, empty=0, recursive=0, incremental=1): Link Here
354
	@type recursive: Boolean (integer)
354
	@type recursive: Boolean (integer)
355
	@param incremental: Append to the return list, don't overwrite
355
	@param incremental: Append to the return list, don't overwrite
356
	@type incremental: Boolean (integer)
356
	@type incremental: Boolean (integer)
357
	@param newlines: Append newlines
358
	@type newlines: Boolean (integer)
357
	@rtype: Dictionary
359
	@rtype: Dictionary
358
	@return:
360
	@return:
359
	1.  Returns the lines in a file in a dictionary, for example:
361
	1.  Returns the lines in a file in a dictionary, for example:
Lines 379-384 def grabdict(myfilename, juststrings=0, empty=0, recursive=0, incremental=1): Link Here
379
			continue
381
			continue
380
		if len(myline) < 1 and empty == 1:
382
		if len(myline) < 1 and empty == 1:
381
			continue
383
			continue
384
		if newlines:
385
			myline.append("\n")
382
		if incremental:
386
		if incremental:
383
			newdict.setdefault(myline[0], []).extend(myline[1:])
387
			newdict.setdefault(myline[0], []).extend(myline[1:])
384
		else:
388
		else:
Lines 424-430 def read_corresponding_eapi_file(filename, default="0"): Link Here
424
		return default
428
		return default
425
	return eapi
429
	return eapi
426
430
427
def grabdict_package(myfilename, juststrings=0, recursive=0,
431
def grabdict_package(myfilename, juststrings=0, recursive=0, newlines=0,
428
	allow_wildcard=False, allow_repo=False, allow_build_id=False,
432
	allow_wildcard=False, allow_repo=False, allow_build_id=False,
429
	verify_eapi=False, eapi=None, eapi_default="0"):
433
	verify_eapi=False, eapi=None, eapi_default="0"):
430
	""" Does the same thing as grabdict except it validates keys
434
	""" Does the same thing as grabdict except it validates keys
Lines 438-444 def grabdict_package(myfilename, juststrings=0, recursive=0, Link Here
438
	atoms = {}
442
	atoms = {}
439
	for filename in file_list:
443
	for filename in file_list:
440
		d = grabdict(filename, juststrings=False,
444
		d = grabdict(filename, juststrings=False,
441
			empty=True, recursive=False, incremental=True)
445
			empty=True, recursive=False, incremental=True, newlines=newlines)
442
		if not d:
446
		if not d:
443
			continue
447
			continue
444
		if verify_eapi and eapi is None:
448
		if verify_eapi and eapi is None:
445
- 

Return to bug 546512