public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Martin Svenningsson <e01msv@efd.lth.se>
To: gentoo-dev@gentoo.org
Subject: [gentoo-dev] [PATCH] USE aware emerge
Date: Sat, 28 Dec 2002 21:03:01 +0100 (MET)	[thread overview]
Message-ID: <Pine.GSO.4.44.0212282051190.22371-200000@login-2.efd.lth.se> (raw)

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1150 bytes --]

Well, semi use aware anyway.

What do you think?


$ ./emerge -p mozilla

These are the packages that I would merge, in order:

Calculating dependencies ...done!
[ebuild   R  ] net-www/mozilla-1.2.1-r4


The following USE flags for this action are:

[enabled] java crypt gtk2 ssl gnome
[disabled] ipv6
[unset] ldap mozsvg mozcalendar mozaccess mozinterfaceinfo mozp3p
mozxmlterm moznoirc moznomail moznocompose moznoxft


------


$ ./emerge -s 'mplayer$'
Searching...
[ Results for search key : mplayer$ ]
[ Applications found : 1 ]

*  media-video/mplayer
      Latest version available: 0.90_rc2
      Latest version installed: [ Not Installed ]
      Size of downloaded files: 3,728 kB
      Homepage:    http://www.mplayerhq.hu/
      Description: Media Player for Linux
      Uses:        dga oss jpeg 3dfx sse matrox sdl X svga ggi oggvorbis
3dnow aalib gnome xv opengl truetype dvd gtk gif esd fbcon encode alsa
directfb arts


Where the use variables is color coded:
red: not specified in USE  [unset]
purple: specified not to be used (ie -kde) [disabled]
green: specified and used  [enabled]


Patched against portage-2.0.46-r4.

// Martin

[-- Attachment #2: Type: TEXT/PLAIN, Size: 2537 bytes --]

--- emerge.old	2002-12-24 21:14:01.000000000 +0100
+++ emerge	2002-12-28 20:39:27.000000000 +0100
@@ -286,7 +286,7 @@
 					catpack=portage.pkgsplit(match)[0]
 				if full_package:
 					try:
-						desc, homepage = portage.portdb.aux_get(full_package,["DESCRIPTION","HOMEPAGE"])
+						desc, homepage, uses = portage.portdb.aux_get(full_package,["DESCRIPTION","HOMEPAGE","IUSE"])
 					except KeyError:
 						print "emerge: search: aux_get() failed, skipping"
 						continue
@@ -295,6 +295,20 @@
 					else:
 						print green("*")+"  "+white(match)
 					myversion = self.getVersion(full_package, search.VERSION_RELEASE)
+					
+
+					# red: not specified in USE
+					# purple: specified not to be used (ie -kde)
+					# green: specified and used
+
+					myuse = ""
+					for x in string.split(uses, " "):
+						if "-"+x in portage.settings["USE"].split():
+								myuse = myuse + purple(x) + " "
+						elif not x in portage.settings["USE"].split():
+ 							myuse = myuse + red(x) + " "
+						else:
+							myuse = myuse + green(x) + " "
 
 					mysum = [0,0]
 					mycat = match.split("/")[0]
@@ -323,6 +337,7 @@
 					print "     ", darkgreen("Size of downloaded files:"),mysum[0]
 					print "     ", darkgreen("Homepage:   "),homepage
 					print "     ", darkgreen("Description:"),desc
+					print "     ", darkgreen("Uses:       "),myuse
 					print
 		
 	#
@@ -1537,6 +1552,34 @@
 		print "\b\b ...done!"
 	if ("--pretend" in myopts) and not ("--fetchonly" in myopts):
 		mydepgraph.display(mydepgraph.altlist())
+
+		
+		enabled = ""
+		disabled = ""
+		unset = ""
+
+		for x in mydepgraph.altlist():
+			if x[2]:
+				try:
+						uses = portage.portdb.aux_get(x[2],["IUSE"])
+				except KeyError:
+						print "emerge: search: aux_get() failed, skipping"
+						continue
+
+				for y in string.split(uses[0], " "):
+					if "-"+y in portage.settings["USE"].split() and string.find(disabled, y) < 0:
+						disabled = disabled + purple(y) + " "
+					elif not y in portage.settings["USE"].split() and string.find(unset, y) < 0:
+ 						unset = unset + red(y) + " "
+					elif string.find(enabled, y) < 0:
+						enabled = enabled + green(y) + " "
+
+		print darkgreen("\n\nThe following USE flags for this action are:\n")
+
+		print "[enabled]", enabled 
+		print "[disabled]", disabled
+		print "[unset]", unset
+
 	else:
 		mydepgraph.merge(mydepgraph.altlist())
 		if portage.settings["AUTOCLEAN"] and "yes"==portage.settings["AUTOCLEAN"]:

[-- Attachment #3: Type: text/plain, Size: 37 bytes --]

--
gentoo-dev@gentoo.org mailing list

             reply	other threads:[~2002-12-28 20:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-28 20:03 Martin Svenningsson [this message]
2002-12-28 21:06 ` [gentoo-dev] [PATCH] USE aware emerge Terje Kvernes
2002-12-28 21:36   ` Martin Svenningsson
2002-12-28 22:04     ` Terje Kvernes
2002-12-29 14:52       ` Christian "cycloon" Gut
2003-01-06  5:34 ` [gentoo-dev] " news.gmane.org.
2003-01-06 21:27   ` Martin Svenningsson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.GSO.4.44.0212282051190.22371-200000@login-2.efd.lth.se \
    --to=e01msv@efd.lth.se \
    --cc=gentoo-dev@gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox