[gentoo-portage-dev] [PATCH] Ignore system packages that are in package.provided

2005-09-27 Thread Jason Stubbs
Removes any atoms that are satisfied by package.provided in emerge's getlist() 
function.
diff -uNr 2.0/bin/emerge 2.0-patched/bin/emerge
--- 2.0/bin/emerge	2005-09-27 13:16:09.0 +0900
+++ 2.0-patched/bin/emerge	2005-09-27 15:00:23.0 +0900
@@ -861,6 +861,16 @@
 continue
 			myline=myline[1:]
 		mynewlines.append(myline.strip())
+
+	# Remove everything that is package.provided from our list
+	for atom in mynewlines[:]:
+		for expanded_atom in portage.flatten(portage.dep_virtual([atom], portage.settings)):
+			mykey = portage.dep_getkey(expanded_atom)
+			if portage.settings.pprovideddict.has_key(mykey) and \
+portage.match_from_list(expanded_atom, portage.settings.pprovideddict[mykey]):
+	mynewlines.remove(atom)
+	break
+
 	return mynewlines
 
 def genericdict(mylist):


[gentoo-portage-dev] [PATCH] Extra info about installed packages feature

2005-09-27 Thread Jason Stubbs
This patch is by swegener. It allows one to specify atoms after `emerge info` 
that will be matched to installed packages. Any installed packages found that 
have settings differing to the current settings will have those settings 
printed out along with the global info.
diff -u -r1.345.2.37 emerge
--- bin/emerge	5 Aug 2005 04:15:00 -	1.345.2.37
+++ bin/emerge	11 Aug 2005 14:26:16 -
@@ -2838,6 +2879,8 @@
 	unameout=commands.getstatusoutput(uname -mrp)[1]
 	print getportageversion()
 	print =
+	printSystem Settings
+	print =
 	print System uname: +unameout
 	if os.path.exists(/etc/gentoo-release):
 		os.system(cat /etc/gentoo-release)
@@ -2914,6 +2957,61 @@
 			if cvs_id_string in dir(module):
 print %s: %s % (str(x), str(module.cvs_id_string))
 
+	# See if we can find any packages installed matching the strings
+	# passed on the command line
+	mypkgs = {}
+	for x in myfiles:
+		for y in portage.db[portage.root][vartree].dbapi.match(x):
+			if y:
+mypkgs[y] = True
+	mypkgs = mypkgs.keys()
+	mypkgs.sort()
+
+	# If some packages were found...
+	if mypkgs:
+		# Get our global settings (we only print stuff if it varies from
+		# the current config)
+		mydesiredvars = [ 'CHOST', 'CFLAGS', 'CXXFLAGS', 'USE' ]
+
+		# Loop through each package
+		# Only print settings if they differ from global settings
+		header_printed = False
+		for pkg in mypkgs:
+
+			# Get the directory where the files are stored
+			prefix = os.path.join(portage.root, portage.VDB_PATH, pkg)
+
+			# Get all package specific variables
+			tmp = portage.db[portage.root][vartree].dbapi.aux_get(pkg, mydesiredvars)
+			diff_found = False
+			for i in range(len(mydesiredvars)):
+# If the package variable doesn't match the
+# current global variable, something has changed
+# so set diff_found so we know to print
+if tmp[i] != portage.settings[mydesiredvars[i]]:
+	diff_found = True
+
+			# If a difference was found, print the info for
+			# this package.
+			if diff_found:
+
+# If we have not yet printed the header, 
+# print it now
+if not header_printed:
+	print =
+	printPackage Settings
+	print =
+	header_printed = True
+
+# Print package info
+print %s was built with the following: % pkg
+for i in range(len(mydesiredvars)):
+	if tmp[i] != portage.settings[mydesiredvars[i]]:
+		print %s=\%s\ % (mydesiredvars[i], tmp[i])
+print 
+diff_found = False
+
+
 # SEARCH action
 elif search==myaction:
 	if not myfiles:


[gentoo-portage-dev] [PATCH] More info when dependencies can't be satisfied

2005-09-27 Thread Jason Stubbs
This patch has two parts. The first adds information to show what package 
brought in the offending atom. The second part clarifies that the problem 
with ebuild foo is talking about the world/system/cli package rather than 
the actual package requiring the unsatisfiable atom.
diff -u -r1.345.2.37 emerge
--- bin/emerge	5 Aug 2005 04:15:00 -	1.345.2.37
+++ bin/emerge	11 Aug 2005 14:26:16 -
@@ -1256,6 +1264,8 @@
 			print !!! Either add a suitable binary package or compile from an ebuild.
 	else:
 		print \nemerge: there are no ebuilds to satisfy +xinfo+.
+		if myparent:
+			print xfrom
 		print
 	return 0
 
@@ -1423,7 +1433,7 @@
 
 			if not self.create(myk,myuse=binpkguseflags):
 print
-print !!! Problem with,myk[0],myk[2]
+print !!! Problem with dependencies under ,myk[0],myk[2]
 print !!! Possibly a DEPEND/*DEPEND problem.
 print
 return 0


[gentoo-portage-dev] [PATCH] Ignore blockers when fetching and using --ask

2005-09-27 Thread Jason Stubbs
Subject says it all...
diff -uNr 2.0/bin/emerge 2.0-patched/bin/emerge
--- 2.0/bin/emerge	2005-09-27 13:16:09.0 +0900
+++ 2.0-patched/bin/emerge	2005-09-27 15:18:53.0 +0900
@@ -3173,7 +3173,7 @@
 if x[3]!=nomerge:
 	mergecount+=1
 #check for blocking dependencies
-if x[0]==blocks:
+if x[0]==blocks and --fetchonly not in myopts and --fetch-all-uri not in myopts:
 	print \n!!! Error: The above package list contains packages which cannot be installed
 	print   !!!on the same system.
 	print


Re: [gentoo-portage-dev] [PATCH] Ignore blockers when fetching and using --ask

2005-09-27 Thread Jason Stubbs
While not harmful, there was one issue with the previous patch; the parent of 
the blocking package would be fetched as well. This would usually mean that 
one of the packages being merged would be fetched twice. This patch fixes 
that.
diff -uNr 2.0/bin/emerge 2.0-patched/bin/emerge
--- 2.0/bin/emerge	2005-09-27 13:16:09.0 +0900
+++ 2.0-patched/bin/emerge	2005-09-27 15:34:03.0 +0900
@@ -3173,7 +3173,7 @@
 if x[3]!=nomerge:
 	mergecount+=1
 #check for blocking dependencies
-if x[0]==blocks:
+if x[0]==blocks and --fetchonly not in myopts and --fetch-all-uri not in myopts:
 	print \n!!! Error: The above package list contains packages which cannot be installed
 	print   !!!on the same system.
 	print
@@ -3224,7 +3224,14 @@
 		y=portage.portdb.findname(pkgline[2])
 		tmpsettings = portage.config(clone=portage.settings)
 		retval=portage.doebuild(y,digest,portage.root,tmpsettings,edebug,(--pretend in myopts))
-			mydepgraph.merge(mydepgraph.altlist())
+			if --fetchonly in myopts or --fetch-all-uri in myopts:
+pkglist = []
+for pkg in mydepgraph.altlist():
+	if pkg[0] != blocks:
+		pkglist.append(pkg)
+			else:
+pkglist = mydepgraph.altlist()
+			mydepgraph.merge(pkglist)
 
 		if portage.mtimedb.has_key(resume):
 			del portage.mtimedb[resume]


[gentoo-portage-dev] [PATCH] Kill the smileys!

2005-09-27 Thread Jason Stubbs
Kill 'em all!
(Original patch by solar)
diff -uNr 2.0/pym/portage.py 2.0-patched/pym/portage.py
--- 2.0/pym/portage.py	2005-09-26 11:48:15.0 +0900
+++ 2.0-patched/pym/portage.py	2005-09-27 16:06:21.0 +0900
@@ -1864,7 +1864,7 @@
 	fetched=0
 else:
 	for x_key in mydigests[myfile].keys():
-		writemsg( Previously fetched file: +str(myfile)+ +x_key+ ;-)\n)
+		writemsg( Previously fetched file: +str(myfile)+ +x_key+\n)
 	fetched=2
 	break #No need to keep looking for this file, we have it!
 	else:
@@ -1962,8 +1962,6 @@
 	os.unlink(mysettings[DISTDIR]+/+myfile)
 	fetched=0
 else:
-	for x_key in mydigests[myfile].keys():
-		writemsg( +str(myfile)+ +x_key+ ;-)\n)
 	fetched=2
 	break
 		except (OSError,IOError),e:


Re: [gentoo-portage-dev] [PATCH] Kill the smileys!

2005-09-27 Thread Jason Stubbs
On Wednesday 28 September 2005 12:15, Marius Mauch wrote:
 Jason Stubbs wrote:
  Kill 'em all!
  (Original patch by solar)

 Hmm, I actually liked them.

Even now that FEATURES=strict is default and every package results in a 
screenful of everything's alright, mate ;-) ?
-- 
gentoo-portage-dev@gentoo.org mailing list