Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bugzilla DB migration completed. Please report issues to Infra team via email via infra@gentoo.org or IRC
View | Details | Raw Unified | Return to bug 2365 | Differences between
and this patch

Collapse All | Expand All

(-)emerge (-89 / +89 lines)
Lines 39-79 Link Here
39
"regen", "rsync",  "search",   "sync", "system", "unmerge", "world"
39
"regen", "rsync",  "search",   "sync", "system", "unmerge", "world"
40
]
40
]
41
options=[
41
options=[
42
"--buildpkg",     "--buildpkgonly",
42
"--build-package",     "--build-package-only",
43
"--changelog",    "--columns",
43
"--changelog",    "--columns",
44
"--debug",        "--deep",
44
"--debug",        "--deep",
45
"--digest",
45
"--digest",
46
"--emptytree",    "--fetchonly",
46
"--empty-tree",    "--fetch-only",
47
"--getbinpkg",    "--getbinpkgonly",
47
"--get-binary-package",    "--get-binary-package-only",
48
"--help",         "--noconfmem",
48
"--help",         "--forget-configuration",
49
"--nodeps",       "--noreplace",
49
"--no-dependencies",       "--no-replace",
50
"--nospinner",    "--oneshot",
50
"--no-spinner",    "--once-only",
51
"--onlydeps",     "--pretend",
51
"--dependencies-only",     "--pretend",
52
"--quiet",        "--resume",
52
"--quiet",        "--resume",
53
"--searchdesc",   "--selective",
53
"--search-description",   "--selective",
54
"--skipfirst",
54
"--skip-first",
55
"--update",       "--upgradeonly",
55
"--update",       "--upgrade-only",
56
"--usepkg",       "--usepkgonly",
56
"--use-package",       "--use-package-only",
57
"--verbose",      "--version"
57
"--verbose",      "--version"
58
]
58
]
59
59
60
shortmapping={
60
shortmapping={
61
"b":"--buildpkg",  "B":"--buildpkgonly",
61
"b":"--build-package",  "B":"--build-package-only",
62
"c":"--clean",     "C":"--unmerge",
62
"c":"--clean",     "C":"--unmerge",
63
"d":"--debug",     "D":"--deep",
63
"d":"--debug",     "D":"--deep",
64
"e":"--emptytree",
64
"e":"--empty-tree",
65
"f":"--fetchonly",
65
"f":"--fetch-only",
66
"g":"--getbinpkg", "G":"--getbinpkgonly",
66
"g":"--get-binary-package", "G":"--get-binary-package-only",
67
"h":"--help",
67
"h":"--help",
68
"i":"--inject",
68
"i":"--inject",
69
"k":"--usepkg",    "K":"--usepkgonly",
69
"k":"--use-package",    "K":"--use-package-only",
70
"l":"--changelog",
70
"l":"--changelog",
71
"n":"--noreplace",
71
"n":"--no-replace",
72
"o":"--onlydeps",  "O":"--nodeps",
72
"o":"--dependencies-only",  "O":"--no-dependencies",
73
"p":"--pretend",   "P":"--prune",
73
"p":"--pretend",   "P":"--prune",
74
"q":"--quiet",
74
"q":"--quiet",
75
"s":"--search",    "S":"--searchdesc",
75
"s":"--search",    "S":"--search-description",
76
"u":"--update",    "U":"--upgradeonly",
76
"u":"--update",    "U":"--upgrade-only",
77
"v":"--verbose",   "V":"--version"
77
"v":"--verbose",   "V":"--version"
78
}
78
}
79
79
Lines 153-183 Link Here
153
	sys.exit(1)
153
	sys.exit(1)
154
154
155
# Always create packages if FEATURES=buildpkg
155
# Always create packages if FEATURES=buildpkg
156
# Imply --buildpkg if --buildpkgonly
156
# Imply --build-package if --build-package-only
157
if ("buildpkg" in portage.features) or ("--buildpkgonly" in myopts):
157
if ("buildpkg" in portage.features) or ("--build-package-only" in myopts):
158
	if "--buildpkg" not in myopts:
158
	if "--build-package" not in myopts:
159
		myopts.append("--buildpkg")
159
		myopts.append("--build-package")
160
160
161
# Also allow -S to invoke search action (-sS)
161
# Also allow -S to invoke search action (-sS)
162
if ("--searchdesc" in myopts) and (not myaction):
162
if ("--search-description" in myopts) and (not myaction):
163
	myaction = "search"
163
	myaction = "search"
164
164
165
if ("--getbinpkgonly" in myopts) and not ("--usepkgonly" in myopts):
165
if ("--get-binary-package-only" in myopts) and not ("--use-package-only" in myopts):
166
	myopts.append("--usepkgonly")
166
	myopts.append("--use-package-only")
167
167
168
if ("--getbinpkgonly" in myopts) and not ("--getbinpkg" in myopts):
168
if ("--get-binary-package-only" in myopts) and not ("--get-binary-package" in myopts):
169
	myopts.append("--getbinpkg")
169
	myopts.append("--get-binary-package")
170
170
171
if ("--getbinpkg" in myopts) and not ("--usepkg" in myopts):
171
if ("--get-binary-package" in myopts) and not ("--use-package" in myopts):
172
	myopts.append("--usepkg")
172
	myopts.append("--use-package")
173
173
174
# Also allow -K to apply --usepkg/-k
174
# Also allow -K to apply --use-package/-k
175
if ("--usepkgonly" in myopts) and not ("--usepkg" in myopts):
175
if ("--use-package-only" in myopts) and not ("--use-package" in myopts):
176
	myopts.append("--usepkg")
176
	myopts.append("--use-package")
177
177
178
# Also allow -U to apply --update/-u
178
# Also allow -U to apply --update/-u
179
if ("--upgradeonly" in myopts) and not ("--update" in myopts):
179
if ("--upgrade-only" in myopts) and not ("--update" in myopts):
180
	print ">>> --upgradeonly implies --update... adding --update to options."
180
	print ">>> --upgrade-only implies --update... adding --update to options."
181
	myopts.append("--update")
181
	myopts.append("--update")
182
182
183
# Also allow -l to apply --pretend/-p
183
# Also allow -l to apply --pretend/-p
Lines 186-192 Link Here
186
	myopts.append("--pretend")
186
	myopts.append("--pretend")
187
187
188
# Set so that configs will be merged regardless of remembered status
188
# Set so that configs will be merged regardless of remembered status
189
if ("--noconfmem" in myopts):
189
if ("--forget-configuration" in myopts):
190
	portage.settings["NOCONFMEM"]="1"
190
	portage.settings["NOCONFMEM"]="1"
191
191
192
# Set various debug markers... They should be merged somehow.
192
# Set various debug markers... They should be merged somehow.
Lines 317-328 Link Here
317
sub=[]
317
sub=[]
318
if "--update" in myopts:
318
if "--update" in myopts:
319
	add.extend(["selective","empty"])
319
	add.extend(["selective","empty"])
320
if "--emptytree" in myopts:
320
if "--empty-tree" in myopts:
321
	add.extend(["empty"])
321
	add.extend(["empty"])
322
	sub.extend(["selective"])
322
	sub.extend(["selective"])
323
if "--nodeps" in myopts:
323
if "--no-dependencies" in myopts:
324
	sub.extend(["recurse"])
324
	sub.extend(["recurse"])
325
if "--noreplace" in myopts:
325
if "--no-replace" in myopts:
326
	add.extend(["selective"])
326
	add.extend(["selective"])
327
if "--deep" in myopts:
327
if "--deep" in myopts:
328
	add.extend(["deep"])
328
	add.extend(["deep"])
Lines 342-348 Link Here
342
342
343
def update_spinner():
343
def update_spinner():
344
	global spinner, spinpos
344
	global spinner, spinpos
345
	if sys.stdout.isatty() and not ("--nospinner" in myopts):
345
	if sys.stdout.isatty() and not ("--no-spinner" in myopts):
346
		sys.stdout.write("\b"+spinner[spinpos])
346
		sys.stdout.write("\b"+spinner[spinpos])
347
		spinpos=(spinpos+1)%8
347
		spinpos=(spinpos+1)%8
348
		sys.stdout.flush()
348
		sys.stdout.flush()
Lines 370-376 Link Here
370
		global myopts
370
		global myopts
371
		self.searchkey=searchkey
371
		self.searchkey=searchkey
372
		self.packagematches = []
372
		self.packagematches = []
373
		if "--searchdesc" in myopts:
373
		if "--search-description" in myopts:
374
			self.searchdesc=1
374
			self.searchdesc=1
375
			self.matches = {"pkg":[], "desc":[]}
375
			self.matches = {"pkg":[], "desc":[]}
376
		else:
376
		else:
Lines 563-571 Link Here
563
			else:
563
			else:
564
				self.mydbapi[portage.root]=portage.db[portage.root]["vartree"].dbapi
564
				self.mydbapi[portage.root]=portage.db[portage.root]["vartree"].dbapi
565
			
565
			
566
		if "--usepkg" in myopts:
566
		if "--use-package" in myopts:
567
			try:
567
			try:
568
				portage.db["/"]["bintree"].populate(("--getbinpkg" in myopts), ("--getbinpkgonly" in myopts))
568
				portage.db["/"]["bintree"].populate(("--get-binary-package" in myopts), ("--get-binary-package-only" in myopts))
569
			except ValueError, e:
569
			except ValueError, e:
570
				sys.stderr.write(red("!!! Failed to get all metadata: "+str(e)+"\n"))
570
				sys.stderr.write(red("!!! Failed to get all metadata: "+str(e)+"\n"))
571
				sys.exit(1)
571
				sys.exit(1)
Lines 573-579 Link Here
573
	def create(self,mybigkey,myparent=None,addme=1):
573
	def create(self,mybigkey,myparent=None,addme=1):
574
		"""creates the actual digraph of packages to merge.  return 1 on success, 0 on failure
574
		"""creates the actual digraph of packages to merge.  return 1 on success, 0 on failure
575
		mybigkey = specification of package to merge; myparent = parent package (one depending on me);
575
		mybigkey = specification of package to merge; myparent = parent package (one depending on me);
576
		addme = should I be added to the tree? (for the --onlydeps mode)"""
576
		addme = should I be added to the tree? (for the --dependencies-only mode)"""
577
		#stuff to add:
577
		#stuff to add:
578
		#SLOT-aware emerge
578
		#SLOT-aware emerge
579
		#IUSE-aware emerge
579
		#IUSE-aware emerge
Lines 715-729 Link Here
715
						sys.exit(1)
715
						sys.exit(1)
716
				mytbz2=xpak.tbz2(x)
716
				mytbz2=xpak.tbz2(x)
717
				mykey=mytbz2.getelements("CATEGORY")[0]+"/"+os.path.basename(x)[:-5]
717
				mykey=mytbz2.getelements("CATEGORY")[0]+"/"+os.path.basename(x)[:-5]
718
				if not self.create(["binary",portage.root,mykey],None,"--onlydeps" not in myopts):
718
				if not self.create(["binary",portage.root,mykey],None,"--dependencies-only" not in myopts):
719
					return (0,myfavorites)
719
					return (0,myfavorites)
720
				elif not "--oneshot" in myopts:
720
				elif not "--once-only" in myopts:
721
					myfavorites.append(mykey)
721
					myfavorites.append(mykey)
722
			elif x[-7:]==".ebuild":
722
			elif x[-7:]==".ebuild":
723
				mykey=os.path.basename(os.path.abspath(x+"/../.."))+"/"+os.path.basename(x)[:-7]
723
				mykey=os.path.basename(os.path.abspath(x+"/../.."))+"/"+os.path.basename(x)[:-7]
724
				if not self.create(["ebuild",portage.root,mykey],None,"--onlydeps" not in myopts):
724
				if not self.create(["ebuild",portage.root,mykey],None,"--dependencies-only" not in myopts):
725
					return (0,myfavorites)
725
					return (0,myfavorites)
726
				elif not "--oneshot" in myopts:
726
				elif not "--once-only" in myopts:
727
					myfavorites.append(mykey)
727
					myfavorites.append(mykey)
728
			else:
728
			else:
729
				mykey=portage.dep_expand(x,portage.portdb)
729
				mykey=portage.dep_expand(x,portage.portdb)
Lines 737-747 Link Here
737
737
738
				if not self.mysd:
738
				if not self.mysd:
739
					return (0,myfavorites)
739
					return (0,myfavorites)
740
				elif not "--oneshot" in myopts:
740
				elif not "--once-only" in myopts:
741
					myfavorites.append(mykey)
741
					myfavorites.append(mykey)
742
742
743
		self.missingbins=0
743
		self.missingbins=0
744
		if "--usepkgonly" in myopts:
744
		if "--use-package-only" in myopts:
745
			for x in self.digraph.dict.keys():
745
			for x in self.digraph.dict.keys():
746
				xs=string.split(x," ")
746
				xs=string.split(x," ")
747
				if (xs[0] != "binary") and (xs[3]=="merge"):
747
				if (xs[0] != "binary") and (xs[3]=="merge"):
Lines 795-805 Link Here
795
			else:
795
			else:
796
				#We are not processing a blocker but a normal dependency
796
				#We are not processing a blocker but a normal dependency
797
				myeb_pkg=None
797
				myeb_pkg=None
798
				if ("--usepkg" in myopts):
798
				if ("--use-package" in myopts):
799
					myeb_pkg=portage.db[portage.root]["bintree"].dep_bestmatch(x)
799
					myeb_pkg=portage.db[portage.root]["bintree"].dep_bestmatch(x)
800
				
800
				
801
				myeb=None
801
				myeb=None
802
				if ("--usepkgonly" not in myopts):
802
				if ("--use-package-only" not in myopts):
803
					myeb=portage.portdb.xmatch("bestmatch-visible",x)
803
					myeb=portage.portdb.xmatch("bestmatch-visible",x)
804
				
804
				
805
				if (not myeb) and (not myeb_pkg):
805
				if (not myeb) and (not myeb_pkg):
Lines 811-817 Link Here
811
						xfrom = '(dependency required by '+green('"'+myparent.split()[2]+'"')+red(' ['+myparent.split()[0]+"])")
811
						xfrom = '(dependency required by '+green('"'+myparent.split()[2]+'"')+red(' ['+myparent.split()[0]+"])")
812
					alleb=portage.portdb.xmatch("match-all",x)
812
					alleb=portage.portdb.xmatch("match-all",x)
813
					if alleb:
813
					if alleb:
814
						if "--usepkgonly" not in myopts:
814
						if "--use-package-only" not in myopts:
815
							print "\n!!! "+red("all ebuilds that could satisfy ")+green(xinfo)+red(" have been masked.")
815
							print "\n!!! "+red("all ebuilds that could satisfy ")+green(xinfo)+red(" have been masked.")
816
							if myparent:
816
							if myparent:
817
								print     "!!!    "+red(xfrom)
817
								print     "!!!    "+red(xfrom)
Lines 837-843 Link Here
837
					else:
837
					else:
838
						myeb = None
838
						myeb = None
839
839
840
 				if "--upgradeonly" in myopts:
840
 				if "--upgrade-only" in myopts:
841
 					# Check that there isn't a newer version of this package already installed
841
 					# Check that there isn't a newer version of this package already installed
842
 					cand=self.is_newer_ver_installed(myroot,x,myeb)
842
 					cand=self.is_newer_ver_installed(myroot,x,myeb)
843
 					if cand:
843
 					if cand:
Lines 851-857 Link Here
851
					sys.stderr.write("!!! Confused... Don't know what I'm using for dependency info. :(\n")
851
					sys.stderr.write("!!! Confused... Don't know what I'm using for dependency info. :(\n")
852
					sys.exit(1)
852
					sys.exit(1)
853
853
854
				#if "--usepkg" in myopts:
854
				#if "--use-package" in myopts:
855
				#	#If we want to use packages, see if we have a pre-built one...
855
				#	#If we want to use packages, see if we have a pre-built one...
856
				#	mypk=portage.db["/"]["bintree"].dbapi.match(x)
856
				#	mypk=portage.db["/"]["bintree"].dbapi.match(x)
857
				#	if myeb in mypk:
857
				#	if myeb in mypk:
Lines 867-874 Link Here
867
					return 0
867
					return 0
868
			else:
868
			else:
869
				#if mysource is not set, then we are a command-line dependency and should not be added
869
				#if mysource is not set, then we are a command-line dependency and should not be added
870
				#if --onlydeps is specified.
870
				#if --dependencies-only is specified.
871
				if not self.create(myk,myparent,"--onlydeps" not in myopts):
871
				if not self.create(myk,myparent,"--dependencies-only" not in myopts):
872
					return 0
872
					return 0
873
873
874
		if "--debug" in myopts:
874
		if "--debug" in myopts:
Lines 940-957 Link Here
940
				#this is an unavailable world entry; just continue
940
				#this is an unavailable world entry; just continue
941
				continue
941
				continue
942
942
943
			if "--upgradeonly" in myopts:
943
			if "--upgrade-only" in myopts:
944
				cand=self.is_newer_ver_installed(portage.root,mydep,myeb)
944
				cand=self.is_newer_ver_installed(portage.root,mydep,myeb)
945
				if cand:
945
				if cand:
946
					myeb=cand
946
					myeb=cand
947
947
948
			#THIS NEXT BUNCH OF CODE NEEDS TO BE REPLACED TO SUPPORT WORLD ANTI-DEPS
948
			#THIS NEXT BUNCH OF CODE NEEDS TO BE REPLACED TO SUPPORT WORLD ANTI-DEPS
949
			#if mydep2[0]=="!":, etc.
949
			#if mydep2[0]=="!":, etc.
950
			if "--usepkg" in myopts:
950
			if "--use-package" in myopts:
951
				mypk=portage.db[portage.root]["bintree"].dep_bestmatch(mydep)
951
				mypk=portage.db[portage.root]["bintree"].dep_bestmatch(mydep)
952
				if myeb==mypk:
952
				if myeb==mypk:
953
					myk=["binary",portage.root,mypk]
953
					myk=["binary",portage.root,mypk]
954
				elif "--usepkgonly" in myopts:
954
				elif "--use-package-only" in myopts:
955
					self.missingbins += [myeb]
955
					self.missingbins += [myeb]
956
					myk=["binary",portage.root,myeb]
956
					myk=["binary",portage.root,myeb]
957
					#print "mypk:",mypk
957
					#print "mypk:",mypk
Lines 987-993 Link Here
987
				print
987
				print
988
				sys.exit(1)
988
				sys.exit(1)
989
989
990
			if "--usepkg" in myopts:
990
			if "--use-package" in myopts:
991
				mypk=portage.db[portage.root]["bintree"].dep_bestmatch(mydep)
991
				mypk=portage.db[portage.root]["bintree"].dep_bestmatch(mydep)
992
				if myeb==mypk:
992
				if myeb==mypk:
993
					myk="binary "+portage.root+" "+mypk
993
					myk="binary "+portage.root+" "+mypk
Lines 1028-1036 Link Here
1028
				#we need to use "--emptrytree" testing here rather than "empty" param testing because "empty"
1028
				#we need to use "--emptrytree" testing here rather than "empty" param testing because "empty"
1029
				#param is used for -u, where you still *do* want to see when something is being upgraded.
1029
				#param is used for -u, where you still *do* want to see when something is being upgraded.
1030
				myoldbest=""
1030
				myoldbest=""
1031
				if (not "--emptytree" in myopts) and portage.db[x[1]]["vartree"].exists_specific(x[2]):
1031
				if (not "--empty-tree" in myopts) and portage.db[x[1]]["vartree"].exists_specific(x[2]):
1032
					addl="  "+yellow("R")+fetch+"  "
1032
					addl="  "+yellow("R")+fetch+"  "
1033
				elif (not "--emptytree" in myopts) and portage.db[x[1]]["vartree"].exists_specific_cat(x[2]):
1033
				elif (not "--empty-tree" in myopts) and portage.db[x[1]]["vartree"].exists_specific_cat(x[2]):
1034
					myoldbest=portage.best(portage.db[x[1]]["vartree"].dbapi.match(portage.pkgsplit(x[2])[0]))
1034
					myoldbest=portage.best(portage.db[x[1]]["vartree"].dbapi.match(portage.pkgsplit(x[2])[0]))
1035
1035
1036
					try:
1036
					try:
Lines 1113-1119 Link Here
1113
			mysplit=portage.pkgsplit(x[2])
1113
			mysplit=portage.pkgsplit(x[2])
1114
			# XXX mysplit _can_ be None.... Why?
1114
			# XXX mysplit _can_ be None.... Why?
1115
			if mysplit and (len(mysplit)==3):
1115
			if mysplit and (len(mysplit)==3):
1116
				if "--emptytree" not in myopts:
1116
				if "--empty-tree" not in myopts:
1117
					if mysplit[0]=="sys-apps/portage":
1117
					if mysplit[0]=="sys-apps/portage":
1118
						if mysplit[1]+mysplit[2]!=portage.VERSION:
1118
						if mysplit[1]+mysplit[2]!=portage.VERSION:
1119
							if mylist.index(x)<len(mylist)-1:
1119
							if mylist.index(x)<len(mylist)-1:
Lines 1123-1129 Link Here
1123
									print darkgreen("    You may avoid the remerging of packages by updating portage on its own.")
1123
									print darkgreen("    You may avoid the remerging of packages by updating portage on its own.")
1124
								print
1124
								print
1125
				else:
1125
				else:
1126
					if mysplit[0]=="sys-apps/portage" and ("--emptytree" in myopts):
1126
					if mysplit[0]=="sys-apps/portage" and ("--empty-tree" in myopts):
1127
						if mysplit[1]+mysplit[2]!=portage.VERSION:
1127
						if mysplit[1]+mysplit[2]!=portage.VERSION:
1128
							print red("***")+" Please update portage to the above version before proceeding."
1128
							print red("***")+" Please update portage to the above version before proceeding."
1129
							print "    Failure to do so may result in failed or improper merges."
1129
							print "    Failure to do so may result in failed or improper merges."
Lines 1191-1197 Link Here
1191
		mymergelist=[]
1191
		mymergelist=[]
1192
1192
1193
		#check for blocking dependencies
1193
		#check for blocking dependencies
1194
		if ("--fetchonly" not in myopts) and ("--buildpkgonly" not in myopts):
1194
		if ("--fetch-only" not in myopts) and ("--build-package-only" not in myopts):
1195
			for x in mylist:
1195
			for x in mylist:
1196
				if x[0]=="blocks":
1196
				if x[0]=="blocks":
1197
					print "\n!!! Error: the "+x[2]+" package conflicts with another package."
1197
					print "\n!!! Error: the "+x[2]+" package conflicts with another package."
Lines 1206-1212 Link Here
1206
			print green("*** Resuming merge...")
1206
			print green("*** Resuming merge...")
1207
			emergelog(" *** Resuming merge...")
1207
			emergelog(" *** Resuming merge...")
1208
			mymergelist=portage.mtimedb["resume"]["mergelist"][:]
1208
			mymergelist=portage.mtimedb["resume"]["mergelist"][:]
1209
			if ("--skipfirst" in myopts) and mymergelist:
1209
			if ("--skip-first" in myopts) and mymergelist:
1210
				del mymergelist[0]
1210
				del mymergelist[0]
1211
		else:
1211
		else:
1212
			myfavs=portage.grabfile(portage.root+"var/cache/edb/world")
1212
			myfavs=portage.grabfile(portage.root+"var/cache/edb/world")
Lines 1219-1231 Link Here
1219
				else:
1219
				else:
1220
					# Add to the world file. Since we won't be able to later.
1220
					# Add to the world file. Since we won't be able to later.
1221
					myfavkey=portage.cpv_getkey(mylist[x][2])
1221
					myfavkey=portage.cpv_getkey(mylist[x][2])
1222
					if (not "--fetchonly" in myopts) and (myfavkey in favorites):
1222
					if (not "--fetch-only" in myopts) and (myfavkey in favorites):
1223
						#don't record if already in system profile or already recorded
1223
						#don't record if already in system profile or already recorded
1224
						if (not mysysdict.has_key(myfavkey)) and (not myfavdict.has_key(myfavkey)):
1224
						if (not mysysdict.has_key(myfavkey)) and (not myfavdict.has_key(myfavkey)):
1225
							#we don't have a favorites entry for this package yet; add one
1225
							#we don't have a favorites entry for this package yet; add one
1226
							myfavdict[myfavkey]=myfavkey
1226
							myfavdict[myfavkey]=myfavkey
1227
							print ">>> Recording",myfavkey,"in \"world\" favorites file..."
1227
							print ">>> Recording",myfavkey,"in \"world\" favorites file..."
1228
			if not "--fetchonly" in myopts:
1228
			if not "--fetch-only" in myopts:
1229
				portage.writedict(myfavdict,portage.root+"var/cache/edb/world",writekey=0)
1229
				portage.writedict(myfavdict,portage.root+"var/cache/edb/world",writekey=0)
1230
1230
1231
			portage.mtimedb["resume"]["mergelist"]=mymergelist[:]
1231
			portage.mtimedb["resume"]["mergelist"]=mymergelist[:]
Lines 1251-1257 Link Here
1251
				print ">>> emerge ("+str(mergecount)+" of "+str(len(mymergelist))+")",x[pkgindex],"to",x[1]
1251
				print ">>> emerge ("+str(mergecount)+" of "+str(len(mymergelist))+")",x[pkgindex],"to",x[1]
1252
				emergelog(" >>> emerge ("+str(mergecount)+" of "+str(len(mymergelist))+") "+x[pkgindex]+" to "+x[1])
1252
				emergelog(" >>> emerge ("+str(mergecount)+" of "+str(len(mymergelist))+") "+x[pkgindex]+" to "+x[1])
1253
			if x[0] in ["ebuild","blocks"]:
1253
			if x[0] in ["ebuild","blocks"]:
1254
				if ("--fetchonly" in myopts) or (x[0]=="blocks"):
1254
				if ("--fetch-only" in myopts) or (x[0]=="blocks"):
1255
					retval=portage.doebuild(y,"fetch",myroot,edebug,("--pretend" in myopts),fetchonly=1)
1255
					retval=portage.doebuild(y,"fetch",myroot,edebug,("--pretend" in myopts),fetchonly=1)
1256
					if retval:
1256
					if retval:
1257
						print
1257
						print
Lines 1259-1265 Link Here
1259
						print	
1259
						print	
1260
						returnme=1
1260
						returnme=1
1261
					continue
1261
					continue
1262
				elif "--buildpkg" in myopts:
1262
				elif "--build-package" in myopts:
1263
					#create pkg, then merge pkg
1263
					#create pkg, then merge pkg
1264
					emergelog(" === ("+str(mergecount)+" of "+str(len(mymergelist))+") Cleaning ("+y+")")
1264
					emergelog(" === ("+str(mergecount)+" of "+str(len(mymergelist))+") Cleaning ("+y+")")
1265
					retval=portage.doebuild(y,"clean",myroot,edebug)
1265
					retval=portage.doebuild(y,"clean",myroot,edebug)
Lines 1271-1277 Link Here
1271
					if retval:
1271
					if retval:
1272
						sys.exit(1)
1272
						sys.exit(1)
1273
					#dynamically update our database
1273
					#dynamically update our database
1274
					if "--buildpkgonly" not in myopts:
1274
					if "--build-package-only" not in myopts:
1275
						portage.db[portage.root]["bintree"].inject(x[2])
1275
						portage.db[portage.root]["bintree"].inject(x[2])
1276
						mytbz2=portage.db[portage.root]["bintree"].getname(x[2])
1276
						mytbz2=portage.db[portage.root]["bintree"].getname(x[2])
1277
						emergelog(" === ("+str(mergecount)+" of "+str(len(mymergelist))+") Merging ("+y+")")
1277
						emergelog(" === ("+str(mergecount)+" of "+str(len(mymergelist))+") Merging ("+y+")")
Lines 1297-1306 Link Here
1297
				if retval==None:
1297
				if retval==None:
1298
					sys.exit(1)
1298
					sys.exit(1)
1299
				#need to check for errors
1299
				#need to check for errors
1300
			if "--buildpkgonly" not in myopts:
1300
			if "--build-package-only" not in myopts:
1301
				portage.db[x[1]]["vartree"].inject(x[2])
1301
				portage.db[x[1]]["vartree"].inject(x[2])
1302
				myfavkey=portage.cpv_getkey(x[2])
1302
				myfavkey=portage.cpv_getkey(x[2])
1303
				if (not "--fetchonly" in myopts) and (myfavkey in favorites):
1303
				if (not "--fetch-only" in myopts) and (myfavkey in favorites):
1304
					myfavs=portage.grabfile(myroot+"var/cache/edb/world")
1304
					myfavs=portage.grabfile(myroot+"var/cache/edb/world")
1305
					myfavdict=genericdict(myfavs)
1305
					myfavdict=genericdict(myfavs)
1306
					mysysdict=genericdict(syslist)
1306
					mysysdict=genericdict(syslist)
Lines 1318-1324 Link Here
1318
					if retval:
1318
					if retval:
1319
						sys.exit(1)
1319
						sys.exit(1)
1320
			
1320
			
1321
				if ("--pretend" not in myopts) and ("--fetchonly" not in myopts):
1321
				if ("--pretend" not in myopts) and ("--fetch-only" not in myopts):
1322
					# Clean the old package that we have merged over top of it.
1322
					# Clean the old package that we have merged over top of it.
1323
					if portage.settings.has_key("AUTOCLEAN") and (portage.settings["AUTOCLEAN"]=="yes"):
1323
					if portage.settings.has_key("AUTOCLEAN") and (portage.settings["AUTOCLEAN"]=="yes"):
1324
						xsplit=portage.pkgsplit(x[2])
1324
						xsplit=portage.pkgsplit(x[2])
Lines 1348-1354 Link Here
1348
								portage.portageexit()
1348
								portage.portageexit()
1349
								os.execv("/usr/lib/portage/bin/emerge", myargv)
1349
								os.execv("/usr/lib/portage/bin/emerge", myargv)
1350
1350
1351
			if ("--pretend" not in myopts) and ("--fetchonly" not in myopts):
1351
			if ("--pretend" not in myopts) and ("--fetch-only" not in myopts):
1352
				emergelog(" ::: completed emerge ("+str(mergecount)+" of "+str(len(mymergelist))+") "+x[2]+" to "+x[1])
1352
				emergelog(" ::: completed emerge ("+str(mergecount)+" of "+str(len(mymergelist))+") "+x[2]+" to "+x[1])
1353
			
1353
			
1354
			# Unsafe for parallel merges
1354
			# Unsafe for parallel merges
Lines 1361-1373 Link Here
1361
			del portage.mtimedb["resume"]
1361
			del portage.mtimedb["resume"]
1362
1362
1363
		if ("--pretend" not in myopts):
1363
		if ("--pretend" not in myopts):
1364
			if ("--fetchonly" not in myopts):
1364
			if ("--fetch-only" not in myopts):
1365
				if (mergecount>0):
1365
				if (mergecount>0):
1366
					portage.env_update()
1366
					portage.env_update()
1367
1367
1368
		#by doing an exit this way, --fetchonly can continue to try to
1368
		#by doing an exit this way, --fetch-only can continue to try to
1369
		#fetch everything even if a particular download fails.
1369
		#fetch everything even if a particular download fails.
1370
		if "--fetchonly" in myopts:
1370
		if "--fetch-only" in myopts:
1371
			if returnme:
1371
			if returnme:
1372
				print "\n\n!!! Some fetch errors were encountered.  Please see above for details.\n\n"
1372
				print "\n\n!!! Some fetch errors were encountered.  Please see above for details.\n\n"
1373
				sys.exit(returnme)
1373
				sys.exit(returnme)
Lines 1913-1923 Link Here
1913
		sys.exit(1)
1913
		sys.exit(1)
1914
	print "\b\b ... done!"
1914
	print "\b\b ... done!"
1915
1915
1916
	if ("--usepkgonly" in myopts) and mydepgraph.missingbins:
1916
	if ("--use-package-only" in myopts) and mydepgraph.missingbins:
1917
		sys.stderr.write(red("The following binaries are not available for merging...\n"))
1917
		sys.stderr.write(red("The following binaries are not available for merging...\n"))
1918
		for x in mydepgraph.missingbins:
1918
		for x in mydepgraph.missingbins:
1919
			sys.stderr.write("   "+str(x)+"\n")
1919
			sys.stderr.write("   "+str(x)+"\n")
1920
		sys.stderr.write("\nThese are required by '--usepkgonly' -- Terminating.\n\n")
1920
		sys.stderr.write("\nThese are required by '--use-package-only' -- Terminating.\n\n")
1921
		sys.exit(1)
1921
		sys.exit(1)
1922
1922
1923
	alldeps=mydepgraph.digraph.allnodes()
1923
	alldeps=mydepgraph.digraph.allnodes()
Lines 1997-2003 Link Here
1997
else:
1997
else:
1998
	favorites=[]
1998
	favorites=[]
1999
	syslist=getlist("system")
1999
	syslist=getlist("system")
2000
	if ("--pretend" in myopts) and not ("--fetchonly" in myopts):
2000
	if ("--pretend" in myopts) and not ("--fetch-only" in myopts):
2001
		print
2001
		print
2002
		print darkgreen("These are the packages that I would merge, in order:")
2002
		print darkgreen("These are the packages that I would merge, in order:")
2003
		print
2003
		print
Lines 2036-2059 Link Here
2036
				sys.exit(1)
2036
				sys.exit(1)
2037
			print "\b\b ...done!"
2037
			print "\b\b ...done!"
2038
2038
2039
			if ("--usepkgonly" in myopts) and mydepgraph.missingbins:
2039
			if ("--use-package-only" in myopts) and mydepgraph.missingbins:
2040
				sys.stderr.write(red("The following binaries are not available for merging...\n"))
2040
				sys.stderr.write(red("The following binaries are not available for merging...\n"))
2041
2041
2042
		if mydepgraph.missingbins:
2042
		if mydepgraph.missingbins:
2043
			for x in mydepgraph.missingbins:
2043
			for x in mydepgraph.missingbins:
2044
				sys.stderr.write("   "+str(x)+"\n")
2044
				sys.stderr.write("   "+str(x)+"\n")
2045
			sys.stderr.write("\nThese are required by '--usepkgonly' -- Terminating.\n\n")
2045
			sys.stderr.write("\nThese are required by '--use-package-only' -- Terminating.\n\n")
2046
			sys.exit(1)
2046
			sys.exit(1)
2047
2047
2048
	if ("--pretend" in myopts) and ("--fetchonly" not in myopts):
2048
	if ("--pretend" in myopts) and ("--fetch-only" not in myopts):
2049
		if ("--resume" in myopts):
2049
		if ("--resume" in myopts):
2050
			mydepgraph.display(portage.mtimedb["resume"]["mergelist"])
2050
			mydepgraph.display(portage.mtimedb["resume"]["mergelist"])
2051
		else:
2051
		else:
2052
			mydepgraph.display(mydepgraph.altlist())
2052
			mydepgraph.display(mydepgraph.altlist())
2053
	else:
2053
	else:
2054
		if ("--buildpkgonly" in myopts):
2054
		if ("--build-package-only" in myopts):
2055
			if not mydepgraph.digraph.hasallzeros():
2055
			if not mydepgraph.digraph.hasallzeros():
2056
				print "\n!!! --buildpkgonly requires all dependencies to be merged."
2056
				print "\n!!! --build-package-only requires all dependencies to be merged."
2057
				print "!!! Cannot merge requested packages. Merge deps and try again.\n"
2057
				print "!!! Cannot merge requested packages. Merge deps and try again.\n"
2058
				sys.exit(1)
2058
				sys.exit(1)
2059
2059
Lines 2064-2070 Link Here
2064
			portage.mtimedb["resume"]={}
2064
			portage.mtimedb["resume"]={}
2065
			portage.mtimedb["resume"]["myopts"]=myopts
2065
			portage.mtimedb["resume"]["myopts"]=myopts
2066
			portage.mtimedb["resume"]["favorites"]=favorites
2066
			portage.mtimedb["resume"]["favorites"]=favorites
2067
			if ("--digest" in myopts) and not ("--fetchonly" in myopts):
2067
			if ("--digest" in myopts) and not ("--fetch-only" in myopts):
2068
				for pkgline in mydepgraph.altlist():
2068
				for pkgline in mydepgraph.altlist():
2069
					if pkgline[0]=="ebuild" and pkgline[3]=="merge":
2069
					if pkgline[0]=="ebuild" and pkgline[3]=="merge":
2070
						y=portage.portdb.findname(pkgline[2])
2070
						y=portage.portdb.findname(pkgline[2])

Return to bug 2365