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

Collapse All | Expand All

(-)bin/ebuild.sh.orig (+9 lines)
Lines 83-88 Link Here
83
83
84
use() {
84
use() {
85
	local x
85
	local x
86
	for x in ${PUSE}; do
87
		if [ "${x}" == "${1}" ]; then
88
			tty --quiet < /dev/stdout || echo "${x}"
89
			return 0
90
		elif [ "${x}" == "-${1}" ]; then
91
			return 1
92
		fi
93
	done
86
	for x in ${USE}; do
94
	for x in ${USE}; do
87
		if [ "${x}" == "${1}" ]; then
95
		if [ "${x}" == "${1}" ]; then
88
			tty --quiet < /dev/stdout || echo "${x}"
96
			tty --quiet < /dev/stdout || echo "${x}"
Lines 706-711 Link Here
706
	echo "$CXXFLAGS" > CXXFLAGS
714
	echo "$CXXFLAGS" > CXXFLAGS
707
	echo "$DEPEND"   > DEPEND
715
	echo "$DEPEND"   > DEPEND
708
	echo "$IUSE"     > IUSE
716
	echo "$IUSE"     > IUSE
717
	echo "$PUSE"     > PUSE
709
	echo "$LICENSE"  > LICENSE
718
	echo "$LICENSE"  > LICENSE
710
	echo "$CATEGORY" > CATEGORY
719
	echo "$CATEGORY" > CATEGORY
711
	echo "$PDEPEND"  > PDEPEND
720
	echo "$PDEPEND"  > PDEPEND
(-)pym/portage.py (-4 / +79 lines)
Lines 897-902 Link Here
897
			sys.exit(1)
897
			sys.exit(1)
898
		self.configlist.append(self.mygcfg)
898
		self.configlist.append(self.mygcfg)
899
		self.configdict["conf"]=self.configlist[-1]
899
		self.configdict["conf"]=self.configlist[-1]
900
		self.configdict["conf"]["PUSEDICT"]=grabdict("/etc/portage/package.use")
900
901
901
		for x in incrementals:
902
		for x in incrementals:
902
			if os.environ.has_key(x):
903
			if os.environ.has_key(x):
Lines 925-931 Link Here
925
		self.regenerate()
926
		self.regenerate()
926
	
927
	
927
	def regenerate(self,useonly=0):
928
	def regenerate(self,useonly=0):
928
		global incrementals,usesplit,profiledir
929
		global incrementals,usesplit,pkgusesplit,profiledir
930
931
		# initialize per-package use variables to an empty dictionary
932
		pkgusesplit={}
933
929
		if useonly:
934
		if useonly:
930
			myincrementals=["USE"]
935
			myincrementals=["USE"]
931
		else:
936
		else:
Lines 968-973 Link Here
968
					#now append our new setting
973
					#now append our new setting
969
					if add:
974
					if add:
970
						mysetting.append(add)
975
						mysetting.append(add)
976
					#override per-package use flags
977
					if mykey=="USE" and pkgusesplit!={}:
978
						for y in pkgusesplit:
979
							if add in pkgusesplit[y]:
980
								pkgusesplit[y].remove(add)
981
							if add[0]=="-" and add[1:] in pkgusesplit[y]:
982
								pkgusesplit[y].remove(add[1:])
983
							if add[0]!="-" and "-"+add in pkgusesplit[y]:
984
								pkgusesplit[y].remove("-"+add)
985
986
				# initialize per-package use flags
987
				if mykey=="USE" and curdb.has_key("PUSEDICT"):
988
					for x in curdb["PUSEDICT"]:
989
						if x[0]=="#":
990
							continue
991
						mypkgusesplit=[]
992
						for y in curdb["PUSEDICT"][x]:
993
							if y=="-*" or y=="*":
994
								continue
995
							if y[0]=="-":
996
								z=y[1:]
997
							else:
998
								z="-"+y
999
							if y not in mysetting and y not in mypkgusesplit and z not in mypkgusesplit:
1000
								mypkgusesplit.append(y)
1001
						if mypkgusesplit:
1002
							pkgusesplit[x]=mypkgusesplit
1003
					del(curdb["PUSEDICT"])
1004
971
			#store setting in last element of configlist, the original environment:
1005
			#store setting in last element of configlist, the original environment:
972
			self.configlist[-1][mykey]=string.join(mysetting," ")
1006
			self.configlist[-1][mykey]=string.join(mysetting," ")
973
		#cache split-up USE var in a global
1007
		#cache split-up USE var in a global
Lines 992-998 Link Here
992
					if self.configdict["defaults"]["ARCH"] not in usesplit:
1026
					if self.configdict["defaults"]["ARCH"] not in usesplit:
993
						usesplit.insert(0,self.configdict["defaults"]["ARCH"])
1027
						usesplit.insert(0,self.configdict["defaults"]["ARCH"])
994
						self.configlist[-1]["USE"]=string.join(usesplit," ")
1028
						self.configlist[-1]["USE"]=string.join(usesplit," ")
995
	
1029
1030
		# Store per-package setting in configlist for display in emerge --info
1031
		self.configlist[-1]["PKGUSE"]=""
1032
		mypkgusesplit=pkgusesplit.copy()
1033
		for x in mypkgusesplit:
1034
			if pkgusesplit[x]==[]:
1035
				del(pkgusesplit[x])
1036
			else:
1037
				self.configlist[-1]["PKGUSE"]=self.configlist[-1]["PKGUSE"]+"( "+x+" => "+string.join(pkgusesplit[x]," ")+" )"
1038
996
	def __getitem__(self,mykey):
1039
	def __getitem__(self,mykey):
997
		if mykey=="CONFIG_PROTECT_MASK":
1040
		if mykey=="CONFIG_PROTECT_MASK":
998
			suffix=" /etc/env.d"
1041
			suffix=" /etc/env.d"
Lines 1546-1551 Link Here
1546
		settings["PVR"]=mysplit[1]
1589
		settings["PVR"]=mysplit[1]
1547
	else:
1590
	else:
1548
		settings["PVR"]=mysplit[1]+"-"+mysplit[2]
1591
		settings["PVR"]=mysplit[1]+"-"+mysplit[2]
1592
1593
	settings["PUSE"]=string.join(dep_getpuse(category+"/"+pf)," ")
1594
1549
	settings["SLOT"]=""
1595
	settings["SLOT"]=""
1550
	if settings.has_key("PATH"):
1596
	if settings.has_key("PATH"):
1551
		mysplit=string.split(settings["PATH"],":")
1597
		mysplit=string.split(settings["PATH"],":")
Lines 2565-2571 Link Here
2565
		mydep=mydep[1:]
2611
		mydep=mydep[1:]
2566
	return prefix+cpv_expand(mydep,mydb)+postfix
2612
	return prefix+cpv_expand(mydep,mydb)+postfix
2567
2613
2614
def dep_getpuse(mypkg):
2615
	global usesplit,pkgusesplit
2616
	if not len(mypkg):
2617
		return []
2618
	mylist=[]
2619
	for mykey in pkgusesplit:
2620
		if db["/"]["porttree"].dbapi.xmatch("bestmatch-list", mykey, None, None, [mypkg]):
2621
			for x in pkgusesplit[mykey]:
2622
				if x[0]=="-":
2623
					y=x[1:]
2624
				else:
2625
					y="-"+x
2626
				if y not in mylist and x not in mylist:
2627
					mylist.append(x)
2628
	return mylist
2629
		
2568
def dep_check(depstring,mydbapi,use="yes",mode=None,myuse=None):
2630
def dep_check(depstring,mydbapi,use="yes",mode=None,myuse=None):
2569
	"""Takes a depend string and parses the condition."""
2631
	"""Takes a depend string and parses the condition."""
2570
	global usesplit
2632
	global usesplit
2571
	if use=="all":
2633
	if use=="all":
Lines 3773-3778 Link Here
3773
		if mylist==None:
3841
		if mylist==None:
3774
			return []
3842
			return []
3775
		newlist=[]
3843
		newlist=[]
3844
		pkglist=grabfile("/etc/portage/package.keywords")
3845
		pkgdict = {}
3846
		for line in pkglist:
3847
			if len(line.split()) == 1:
3848
				mykeywordlist = []
3849
				mykeywordlist = ["~"+keyword for keyword in groups if not keyword[0] in "~-"]
3850
				pkgdict[line] = mykeywordlist
3851
			else:
3852
				pkgdict[line.split()[0]] = line.split()[1:]
3776
		for mycpv in mylist:
3853
		for mycpv in mylist:
3777
			#we need to update this next line when we have fully integrated the new db api
3854
			#we need to update this next line when we have fully integrated the new db api
3778
			auxerr=0
3855
			auxerr=0
Lines 3785-3799 Link Here
3785
				#print "!!! No KEYWORDS for "+str(mycpv)+" -- Untested Status"
3854
				#print "!!! No KEYWORDS for "+str(mycpv)+" -- Untested Status"
3786
				continue
3855
				continue
3787
			mygroups=myaux[0].split()
3856
			mygroups=myaux[0].split()
3857
			pgroups=groups[:]
3788
			match=0
3858
			match=0
3859
			for mykey in pkgdict:
3860
				if db["/"]["porttree"].dbapi.xmatch("bestmatch-list", mykey, None, None, [mycpv]):
3861
					pgroups.extend(pkgdict[mykey])
3789
			for gp in mygroups:
3862
			for gp in mygroups:
3790
				if gp=="*":
3863
				if gp=="*":
3791
					match=1
3864
					match=1
3792
					break
3865
					break
3793
				elif "-"+gp in groups:
3866
				elif "-"+gp in pgroups:
3794
					match=0
3867
					match=0
3795
					break
3868
					break
3796
				elif gp in groups:
3869
				elif gp in pgroups:
3797
					match=1
3870
					match=1
3798
					break
3871
					break
3799
			if match:
3872
			if match:
(-)bin/emerge.orig (-8 / +18 lines)
Lines 640-645 Link Here
640
		mytype,myroot,mykey=mybigkey
640
		mytype,myroot,mykey=mybigkey
641
		if myuse == None:
641
		if myuse == None:
642
			myuse=string.split(portage.settings["USE"], " ")
642
			myuse=string.split(portage.settings["USE"], " ")
643
			for x in portage.dep_getpuse(mykey):
644
				if x[0]=="-" and x[1:] in myuse:
645
					myuse.remove(x[1:])
646
					myuse.append(x)
647
				elif "-"+x in myuse:
648
					myuse.remove("-"+x)
649
					myuse.append(x)
643
	
650
	
644
		# select the correct /var database that we'll be checking against
651
		# select the correct /var database that we'll be checking against
645
		vardbapi=portage.db[myroot]["vartree"].dbapi
652
		vardbapi=portage.db[myroot]["vartree"].dbapi
Lines 1059-1071 Link Here
1059
1059
1060
				iuse=""
1060
				iuse=""
1061
				if "--verbose" in myopts:
1061
				if "--verbose" in myopts:
1062
					myiuse=portage.dep_getpuse(x[2])
1062
					for ebuild_iuse in string.split(portage.portdb.aux_get(x[2],["IUSE"])[0], " "):
1063
					for ebuild_iuse in string.split(portage.portdb.aux_get(x[2],["IUSE"])[0], " "):
1063
						try:
1064
						if ebuild_iuse in myiuse:
1064
							if (portage.usesplit.index(ebuild_iuse) >= 0) :
1065
							iuse=iuse+darkred("+"+ebuild_iuse)+" "
1065
								iuse=iuse+red("+"+ebuild_iuse)+" "
1066
						elif "-"+ebuild_iuse in myiuse:
1066
						except ValueError:
1067
							iuse=iuse+darkblue("-"+ebuild_iuse)+" "
1067
							if ebuild_iuse != "":
1068
						elif ebuild_iuse in portage.usesplit:
1068
								iuse=iuse+blue("-"+ebuild_iuse)+" "
1069
							iuse=iuse+red("+"+ebuild_iuse)+" "
1070
						elif ebuild_iuse != "":
1071
							iuse=iuse+blue("-"+ebuild_iuse)+" "
1069
1072
1070
				xs=portage.pkgsplit(x[2])
1073
				xs=portage.pkgsplit(x[2])
1071
				if xs[2]=="r0":
1074
				if xs[2]=="r0":
Lines 1810-1817 Link Here
1810
	else:
1812
	else:
1811
		myvars=['GENTOO_MIRRORS', 'CONFIG_PROTECT', 'CONFIG_PROTECT_MASK',
1813
		myvars=['GENTOO_MIRRORS', 'CONFIG_PROTECT', 'CONFIG_PROTECT_MASK',
1812
				'PORTDIR', 'DISTDIR', 'PKGDIR', 'PORTAGE_TMPDIR', 'PORTDIR_OVERLAY',
1814
				'PORTDIR', 'DISTDIR', 'PKGDIR', 'PORTAGE_TMPDIR', 'PORTDIR_OVERLAY',
1813
				'USE', 'COMPILER', 'CHOST', 'CFLAGS', 'CXXFLAGS','ACCEPT_KEYWORDS', 
1815
				'USE', 'PKGUSE', 'COMPILER', 'CHOST', 'CFLAGS', 'CXXFLAGS',
1814
				'MAKEOPTS', 'AUTOCLEAN', 'SYNC', 'FEATURES']
1816
				'ACCEPT_KEYWORDS', 'MAKEOPTS', 'AUTOCLEAN', 'SYNC', 'FEATURES']
1815
	for x in myvars:
1817
	for x in myvars:
1816
		print x+'="'+portage.settings[x]+'"'
1818
		print x+'="'+portage.settings[x]+'"'

Return to bug 13616