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

Collapse All | Expand All

(-)gentoolkit-0.3.0.9/pym/gentoolkit/eclean/search.py (-9 / +13 lines)
Lines 560-583 Link Here
560
			if stat.S_ISLNK(st[stat.ST_MODE]):
560
			if stat.S_ISLNK(st[stat.ST_MODE]):
561
				clean_me[cpv].append(os.path.realpath(path))
561
				clean_me[cpv].append(os.path.realpath(path))
562
	# keep only obsolete ones
562
	# keep only obsolete ones
563
	if destructive:
563
	if destructive and package_names:
564
		dbapi = var_dbapi
564
		cp_all = dict.fromkeys(var_dbapi.cp_all())
565
		if package_names:
566
			cp_all = dict.fromkeys(dbapi.cp_all())
567
		else:
568
			cp_all = {}
569
	else:
565
	else:
570
		dbapi = port_dbapi
571
		cp_all = {}
566
		cp_all = {}
572
	for cpv in list(clean_me):
567
	for cpv in list(clean_me):
573
		if exclDictMatchCP(exclude,portage.cpv_getkey(cpv)):
568
		if exclDictMatchCP(exclude,portage.cpv_getkey(cpv)):
574
			# exclusion because of the exclude file
569
			# exclusion because of the exclude file
575
			del clean_me[cpv]
570
			del clean_me[cpv]
576
			continue
571
			continue
577
		if dbapi.cpv_exists(cpv):
572
		if not destructive and port_dbapi.cpv_exists(cpv):
578
			# exclusion because pkg still exists (in porttree or vartree)
573
			# exclusion because pkg still exists (in porttree)
579
			del clean_me[cpv]
574
			del clean_me[cpv]
580
			continue
575
			continue
576
		if destructive and var_dbapi.cpv_exists(cpv):
577
			buildtime = var_dbapi.aux_get(cpv, ['BUILD_TIME'])[0].encode('utf-8').strip()
578
			clean_me[cpv] = [path for path in clean_me[cpv]
579
				# only keep path if BUILD_TIME is identical with vartree
580
				if portage.xpak.tbz2(path).getfile('BUILD_TIME').strip() != buildtime]
581
			if not clean_me[cpv]:
582
				# nothing we can clean for this package
583
				del clean_me[cpv]
584
				continue
581
		if portage.cpv_getkey(cpv) in cp_all:
585
		if portage.cpv_getkey(cpv) in cp_all:
582
			# exlusion because of --package-names
586
			# exlusion because of --package-names
583
			del clean_me[cpv]
587
			del clean_me[cpv]

Return to bug 586658