* [gentoo-dev] USE_EXPAND and IUSE @ 2005-06-20 0:43 Jason Stubbs 2005-06-19 16:48 ` Alin Nastac 0 siblings, 1 reply; 13+ messages in thread From: Jason Stubbs @ 2005-06-20 0:43 UTC (permalink / raw To: gentoo-dev [-- Attachment #1: Type: text/plain, Size: 1289 bytes --] Hi all, So there have been many complaints about how USE_EXPANDed flags don't belong in IUSE. There haven't actually been any reasons given though. :P I've assumed that the reasons they haven't been added thus far are due to what emerge's output would look like if they were. So I've taken the liberty of fixing up the output a bit. Now IUSE flags that are expansions of USE_EXPAND will be outputted like this: [ebuild N ] kde-base/kde-i18n-3.4.1 +arts -debug +kdeenablefinal -xinerama LINGUAS="-ar -bg -bn -br -bs -ca -cs -cy -da -de -el -en_GB -eo -es -et -eu -fi -fr -fy -ga -he -hi -hsb -hu -is -it +ja -lt -mk -nb -nds -nl -nn -pa -pl -pt -pt_BR -ro -ru -se -sk -sl -sr -sr@Latn -sv -ta -tg -tr -uk -zh_CN" 0 kB The format follows the same as standard USE flags but are separated out into the individual variables that enable them. Of course, the ebuilds themselves need to be updated to add the appropriate flags to IUSE. Although I believe they should be, I'll leave it up to others to decide whether said flags should be documented in use.desc. However, if it is decided to not document them in use.desc, they won't be dropped from repoman's checks until there is some other way that they can be documented. Regards, Jason Stubbs [-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --] ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [gentoo-dev] USE_EXPAND and IUSE 2005-06-20 0:43 [gentoo-dev] USE_EXPAND and IUSE Jason Stubbs @ 2005-06-19 16:48 ` Alin Nastac 2005-06-19 17:10 ` Sven Wegener 2005-06-20 7:37 ` Jason Stubbs 0 siblings, 2 replies; 13+ messages in thread From: Alin Nastac @ 2005-06-19 16:48 UTC (permalink / raw To: gentoo-dev [-- Attachment #1: Type: text/plain, Size: 558 bytes --] Jason Stubbs wrote: >So there have been many complaints about how USE_EXPANDed flags don't belong >in IUSE. There haven't actually been any reasons given though. :P > > > net-dialup/pppconfig-2.3.11-r1 depends on LINGUAS, but the list of supported languages is created in pkg_unpack, based on what tarball contains. The IUSE thing would raise 2 problems: - lower maintainability - not really a major problem - if user wants all languages, it will be forced to select them one by one - now if LINGUAS is empty, all available languages gets installed. [-- Attachment #2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 256 bytes --] ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [gentoo-dev] USE_EXPAND and IUSE 2005-06-19 16:48 ` Alin Nastac @ 2005-06-19 17:10 ` Sven Wegener 2005-06-20 7:37 ` Jason Stubbs 1 sibling, 0 replies; 13+ messages in thread From: Sven Wegener @ 2005-06-19 17:10 UTC (permalink / raw To: gentoo-dev [-- Attachment #1: Type: text/plain, Size: 1671 bytes --] On Sun, Jun 19, 2005 at 07:48:27PM +0300, Alin Nastac wrote: > Jason Stubbs wrote: > > >So there have been many complaints about how USE_EXPANDed flags don't belong > >in IUSE. There haven't actually been any reasons given though. :P > net-dialup/pppconfig-2.3.11-r1 depends on LINGUAS, but the list of > supported languages is created in pkg_unpack, based on what tarball > contains. > > The IUSE thing would raise 2 problems: > - lower maintainability - not really a major problem > - if user wants all languages, it will be forced to select them one by > one - now if LINGUAS is empty, all available languages gets installed. We're talking about USE_EXPANDed USE flags. The LINGUAS variable will still exist and the way you use LINGUAS in net-dialup/pppconfig doesn't involve USE flags. So you don't need to add them to IUSE. We currently don't have a policy that enforces the use of the expanded linguas_* USE flags instead of directly using the LINGUAS variable. Maybe we should first decide, if it's OK to use LINGUAS directly. If not, we need to modify the packages, which is tricky for packages like pppconfig that take the list of available languages from the tarball. IMHO using the linguas_* USE flags makes better binary packages because the USE flags are handled by portage and shown on emerge -pv output. Portage will merge the binary package using the compiled USE flags and will not react on current USE settings. Same is for LINGUAS, but using the USE flags the user knows on emerge -pv with which language support the package was compiled. Sven -- Sven Wegener Gentoo Linux Developer http://www.gentoo.org/ [-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --] ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [gentoo-dev] USE_EXPAND and IUSE 2005-06-19 16:48 ` Alin Nastac 2005-06-19 17:10 ` Sven Wegener @ 2005-06-20 7:37 ` Jason Stubbs 2005-06-21 5:11 ` Donnie Berkholz 2005-06-21 5:35 ` Alin Nastac 1 sibling, 2 replies; 13+ messages in thread From: Jason Stubbs @ 2005-06-20 7:37 UTC (permalink / raw To: gentoo-dev [-- Attachment #1: Type: text/plain, Size: 1113 bytes --] On Monday 20 June 2005 01:48, Alin Nastac wrote: > Jason Stubbs wrote: > > So there have been many complaints about how USE_EXPANDed flags don't > > belong in IUSE. There haven't actually been any reasons given though. :P > > net-dialup/pppconfig-2.3.11-r1 depends on LINGUAS, but the list of > supported languages is created in pkg_unpack, based on what tarball > contains. What happened to determinism and predictability? From the user's standpoint, there is no way to know what is going to be installed until it is actually installed. > The IUSE thing would raise 2 problems: > - lower maintainability - not really a major problem > - if user wants all languages, it will be forced to select them one by > one - now if LINGUAS is empty, all available languages gets installed. FRITZCAPI_CARDS FCDSL_CARDS VIDEO_CARDS INPUT_DEVICES LINGUAS Do any of these not follow the same pattern of empty var == all installed? Any objections to making that a requirement for adding a new USE_EXPAND variable? If so, the emerge *display* issue would be no problem. Regards, Jason Stubbs [-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --] ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [gentoo-dev] USE_EXPAND and IUSE 2005-06-20 7:37 ` Jason Stubbs @ 2005-06-21 5:11 ` Donnie Berkholz 2005-06-21 21:35 ` Jason Stubbs 2005-06-21 5:35 ` Alin Nastac 1 sibling, 1 reply; 13+ messages in thread From: Donnie Berkholz @ 2005-06-21 5:11 UTC (permalink / raw To: gentoo-dev -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Jason Stubbs wrote: > FRITZCAPI_CARDS FCDSL_CARDS VIDEO_CARDS INPUT_DEVICES LINGUAS > > Do any of these not follow the same pattern of empty var == all installed? Any > objections to making that a requirement for adding a new USE_EXPAND variable? > If so, the emerge *display* issue would be no problem. x11-drm dies if you don't set VIDEO_CARDS. At the time, I thought it was better to make the user understand the available video cards and set them manually, since settings of multiple cards are allowed. Perhaps that's worth rethinking. Thanks, Donnie -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) iD8DBQFCt6GPXVaO67S1rtsRAhtgAJ97XgL92Tj/3aW4xYQMcx5pMzYTWwCgj++F kdOxDd1RJNOJCMOmizr2zGk= =2Fyn -----END PGP SIGNATURE----- -- gentoo-dev@gentoo.org mailing list ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [gentoo-dev] USE_EXPAND and IUSE 2005-06-21 5:11 ` Donnie Berkholz @ 2005-06-21 21:35 ` Jason Stubbs 2005-06-21 16:29 ` Donnie Berkholz 0 siblings, 1 reply; 13+ messages in thread From: Jason Stubbs @ 2005-06-21 21:35 UTC (permalink / raw To: gentoo-dev [-- Attachment #1: Type: text/plain, Size: 1213 bytes --] On Tuesday 21 June 2005 14:11, Donnie Berkholz wrote: > Jason Stubbs wrote: > > FRITZCAPI_CARDS FCDSL_CARDS VIDEO_CARDS INPUT_DEVICES LINGUAS > > > > Do any of these not follow the same pattern of empty var == all > > installed? Any objections to making that a requirement for adding a new > > USE_EXPAND variable? If so, the emerge *display* issue would be no > > problem. > > x11-drm dies if you don't set VIDEO_CARDS. At the time, I thought it was > better to make the user understand the available video cards and set > them manually, since settings of multiple cards are allowed. Perhaps > that's worth rethinking. It seems we have the following behaviour when unset: FRITZCAPI_CARDS => Selective based on "pcmcia" and "usb" USE flags FCDSL_CARDS => All VIDEO_CARDS => Dies INPUT_DEVICES => None LINGUAS => All It would be nice to unify the behaviour among these. I like either the "All" or the "Dies" option though. While the FRITZCAPI_CARDS behaviour is 'probably what the user wants', it is not predictable. Any reason why INPUT_DEVICES is needed in USE_EXPAND rather than just as local USE flags? It's kind of the odd one out among the above. Regards, Jason Stubbs [-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --] ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [gentoo-dev] USE_EXPAND and IUSE 2005-06-21 21:35 ` Jason Stubbs @ 2005-06-21 16:29 ` Donnie Berkholz 2005-06-21 16:59 ` Alec Warner 0 siblings, 1 reply; 13+ messages in thread From: Donnie Berkholz @ 2005-06-21 16:29 UTC (permalink / raw To: gentoo-dev -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Jason Stubbs wrote: > Any reason why INPUT_DEVICES is needed in USE_EXPAND rather than just as local > USE flags? It's kind of the odd one out among the above. The reasoning for that is that hardware support doesn't make sense as USE flags, so it should be something else. In this case, that was INPUT_DEVICES. We haven't been able to take much advantage of it yet, but it may work out better after X's upstream modularization. Thanks, Donnie -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) iD8DBQFCuEBpXVaO67S1rtsRApqXAKCssJLG1lWtsoNXWGz05I8vGoxw1wCgvPGF SaEd0RXRIJqok+oOjgUg39Y= =SZxT -----END PGP SIGNATURE----- -- gentoo-dev@gentoo.org mailing list ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [gentoo-dev] USE_EXPAND and IUSE 2005-06-21 16:29 ` Donnie Berkholz @ 2005-06-21 16:59 ` Alec Warner 2005-06-21 17:07 ` Donnie Berkholz 0 siblings, 1 reply; 13+ messages in thread From: Alec Warner @ 2005-06-21 16:59 UTC (permalink / raw To: gentoo-dev Donnie Berkholz wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Jason Stubbs wrote: > >>Any reason why INPUT_DEVICES is needed in USE_EXPAND rather than just as local >>USE flags? It's kind of the odd one out among the above. > > > The reasoning for that is that hardware support doesn't make sense as > USE flags, so it should be something else. In this case, that was > INPUT_DEVICES. We haven't been able to take much advantage of it yet, > but it may work out better after X's upstream modularization. So those make no sense but 3dnow,sse,sse2,makemyprocessorgrow are fine as USE flags? Those also enable support for special hardware. > > Thanks, > Donnie > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.1 (GNU/Linux) > > iD8DBQFCuEBpXVaO67S1rtsRApqXAKCssJLG1lWtsoNXWGz05I8vGoxw1wCgvPGF > SaEd0RXRIJqok+oOjgUg39Y= > =SZxT > -----END PGP SIGNATURE----- -- gentoo-dev@gentoo.org mailing list ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [gentoo-dev] USE_EXPAND and IUSE 2005-06-21 16:59 ` Alec Warner @ 2005-06-21 17:07 ` Donnie Berkholz 2005-08-17 3:42 ` Jason Stubbs 0 siblings, 1 reply; 13+ messages in thread From: Donnie Berkholz @ 2005-06-21 17:07 UTC (permalink / raw To: gentoo-dev -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Alec Warner wrote: > Donnie Berkholz wrote: > The reasoning for that is that hardware support doesn't make sense as > USE flags, so it should be something else. In this case, that was > INPUT_DEVICES. We haven't been able to take much advantage of it yet, > but it may work out better after X's upstream modularization. > >> So those make no sense but 3dnow,sse,sse2,makemyprocessorgrow are fine >> as USE flags? Those also enable support for special hardware. I think we had that argument already. Try searching the archives and see whether you can find it. Thanks, Donnie -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) iD8DBQFCuElEXVaO67S1rtsRAhDpAKDrizHHPj7QVEYmfsuaekGagBsdxACeNDbO 0MEGWzTPSh5IDbvZwDtjnZs= =61aD -----END PGP SIGNATURE----- -- gentoo-dev@gentoo.org mailing list ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [gentoo-dev] USE_EXPAND and IUSE 2005-06-21 17:07 ` Donnie Berkholz @ 2005-08-17 3:42 ` Jason Stubbs 0 siblings, 0 replies; 13+ messages in thread From: Jason Stubbs @ 2005-08-17 3:42 UTC (permalink / raw To: gentoo-dev [-- Attachment #1: Type: text/plain, Size: 843 bytes --] On Wednesday 22 June 2005 02:07, Donnie Berkholz wrote: > Alec Warner wrote: > > Donnie Berkholz wrote: > > The reasoning for that is that hardware support doesn't make sense as > > USE flags, so it should be something else. In this case, that was > > INPUT_DEVICES. We haven't been able to take much advantage of it yet, > > but it may work out better after X's upstream modularization. > > > >> So those make no sense but 3dnow,sse,sse2,makemyprocessorgrow are > >> fine as USE flags? Those also enable support for special hardware. > > I think we had that argument already. Try searching the archives and see > whether you can find it. I tried searching but no luck. Care to elaborate on how "building optional support for drivers" doesn't fall under the umbrella of "building optional support"? -- Jason Stubbs [-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --] ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [gentoo-dev] USE_EXPAND and IUSE 2005-06-20 7:37 ` Jason Stubbs 2005-06-21 5:11 ` Donnie Berkholz @ 2005-06-21 5:35 ` Alin Nastac 2005-06-21 20:28 ` Jason Stubbs 1 sibling, 1 reply; 13+ messages in thread From: Alin Nastac @ 2005-06-21 5:35 UTC (permalink / raw To: gentoo-dev [-- Attachment #1: Type: text/plain, Size: 1222 bytes --] Jason Stubbs wrote: >On Monday 20 June 2005 01:48, Alin Nastac wrote: > > >>net-dialup/pppconfig-2.3.11-r1 depends on LINGUAS, but the list of >>supported languages is created in pkg_unpack, based on what tarball >>contains. >> >> > >What happened to determinism and predictability? From the user's standpoint, >there is no way to know what is going to be installed until it is actually >installed. > > > I don't really understand why you consider pppconfig unpredictable. the ebuild displays what languages will be installed. >>The IUSE thing would raise 2 problems: >> - lower maintainability - not really a major problem >> - if user wants all languages, it will be forced to select them one by >>one - now if LINGUAS is empty, all available languages gets installed. >> >> > >FRITZCAPI_CARDS FCDSL_CARDS VIDEO_CARDS INPUT_DEVICES LINGUAS > >Do any of these not follow the same pattern of empty var == all installed? Any >objections to making that a requirement for adding a new USE_EXPAND variable? >If so, the emerge *display* issue would be no problem. > > This would be fine as long as LINGUAS do not appear in IUSE. When LINGUAS var is empty, the "equery uses" report would be an abomination . [-- Attachment #2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 256 bytes --] ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [gentoo-dev] USE_EXPAND and IUSE 2005-06-21 5:35 ` Alin Nastac @ 2005-06-21 20:28 ` Jason Stubbs 2005-06-21 21:17 ` Jason Stubbs 0 siblings, 1 reply; 13+ messages in thread From: Jason Stubbs @ 2005-06-21 20:28 UTC (permalink / raw To: gentoo-dev [-- Attachment #1: Type: text/plain, Size: 1187 bytes --] On Tuesday 21 June 2005 14:35, Alin Nastac wrote: > I don't really understand why you consider pppconfig unpredictable. > the ebuild displays what languages will be installed. Because there is no way to foretell what will be installed without actually initiating an install. > > >The IUSE thing would raise 2 problems: > > > - lower maintainability - not really a major problem > > > - if user wants all languages, it will be forced to select them one by > > >one - now if LINGUAS is empty, all available languages gets installed. > > > > FRITZCAPI_CARDS FCDSL_CARDS VIDEO_CARDS INPUT_DEVICES LINGUAS > > > > Do any of these not follow the same pattern of empty var == all installed? > > Any objections to making that a requirement for adding a new USE_EXPAND > > variable? If so, the emerge *display* issue would be no problem. > > This would be fine as long as LINGUAS do not appear in IUSE. When > LINGUAS var is empty, the "equery uses" report would be an abomination . The whole point is to add this stuff to IUSE and improve the output accordingly. Using current tools as a reason to not improve things isn't really logical. Regards, Jason Stubbs [-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --] ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [gentoo-dev] USE_EXPAND and IUSE 2005-06-21 20:28 ` Jason Stubbs @ 2005-06-21 21:17 ` Jason Stubbs 0 siblings, 0 replies; 13+ messages in thread From: Jason Stubbs @ 2005-06-21 21:17 UTC (permalink / raw To: gentoo-dev [-- Attachment #1.1: Type: text/plain, Size: 1166 bytes --] On Wednesday 22 June 2005 05:28, Jason Stubbs wrote: > On Tuesday 21 June 2005 14:35, Alin Nastac wrote: > > This would be fine as long as LINGUAS do not appear in IUSE. When > > LINGUAS var is empty, the "equery uses" report would be an abomination . > > The whole point is to add this stuff to IUSE and improve the output > accordingly. Using current tools as a reason to not improve things isn't > really logical. And here's a messy patch that took me ten minutes (after looking at equery code for the first time) that does just that. Output as follows: $ ./equery uses portage ... [ Found these USE variables for sys-apps/portage-2.0.51.22-r1 ] U I - - build : !!internal use only!! DO NOT SET THIS FLAG YOURSELF!, used for creating build images and the first half of bootstrapping. - - selinux : !!internal use only!! Security Enhanced Linux support, this must be set by the selinux profile or breakage will occur $ ./equery vars portage ... [ Found these environment variables for sys-apps/portage-2.0.51.22-r1 ] U I ----- LINGUAS + + en : <unknown> - - fr : <unknown> + + ja : <unknown> Regards, Jason Stubbs [-- Attachment #1.2: equery-use_expand.patch --] [-- Type: text/x-diff, Size: 7741 bytes --] --- /usr/bin/equery 2005-06-22 05:29:36.000000000 +0900 +++ equery 2005-06-22 06:14:45.000000000 +0900 @@ -451,6 +451,8 @@ except IOError: print_warn(5, "Could not load USE flag descriptions from " + ppath(gentoolkit.settings["PORTDIR"] + "/profiles/use.desc")) + use_expand = gentoolkit.settings["USE_EXPAND"].lower().split() + # Load local USE flag descriptions try: fd = open(gentoolkit.settings["PORTDIR"]+"/profiles/use.local.desc") @@ -483,12 +485,19 @@ matches_found += 1 bestver = p.get_cpv() - iuse = p.get_env_var("IUSE") - - if iuse: - usevar = iuse.split() - else: - usevar = [] + iuse = p.get_env_var("IUSE").split() + + for usevar in iuse[:]: + found = False + for usehead in use_expand: + if usevar.startswith(usehead+"_"): + found = True + break + if found: + iuse.remove(usevar) + + usevar = iuse + usevar.sort() inuse = [] if p.is_installed(): @@ -570,6 +579,206 @@ " " + pp.localoption("-a, --all") + " - include non-installed packages\n" +class CmdDisplayVars(Command): + """Advanced report of a package's USE flags""" + def __init__(self): + self.default_opts = { + "installedOnly" : True + } + def parseArgs(self, args): + + query = "" + need_help = 0 + opts = self.default_opts + skip = 0 + + for i in xrange(len(args)): + + if skip: + skip -= 1 + continue + x = args[i] + + if x in ["-h","--help"]: + need_help = 1 + break + elif x in ["-a", "--all"]: + opts["installedOnly"] = False + else: + query = x + + if need_help or query == "": + print_info(0, self.longHelp()) + sys.exit(-1) + + return (query, opts) + + def perform(self, args): + + (query, opts) = self.parseArgs(args) + + if not Config["piping"]: + print_info(3, "[ Searching for packages matching " + pp.pkgquery(query) + "... ]") + + matches = gentoolkit.find_packages(query, True) + + if not matches: + die(3, "No matching packages found for \"" + pp.pkgquery(query) + "\"") + + + useflags = gentoolkit.settings["USE"].split() + usedesc = {} + uselocaldesc = {} + + # Load global USE flag descriptions + try: + fd = open(gentoolkit.settings["PORTDIR"]+"/profiles/use.desc") + usedesc = {} + for line in fd.readlines(): + if line[0] == "#": + continue + fields = line.split(" - ") + if len(fields) == 2: + usedesc[fields[0].strip()] = fields[1].strip() + except IOError: + print_warn(5, "Could not load USE flag descriptions from " + ppath(gentoolkit.settings["PORTDIR"] + "/profiles/use.desc")) + + # Load local USE flag descriptions + try: + fd = open(gentoolkit.settings["PORTDIR"]+"/profiles/use.local.desc") + for line in fd.readlines(): + if line[0] == "#": + continue + fields = line.split(" - ") + if len(fields) == 2: + catpkguse = re.search("([a-z]+-[a-z]+/.*):(.*)", fields[0]) + if catpkguse: + if not uselocaldesc.has_key(catpkguse.group(1).strip()): + uselocaldesc[catpkguse.group(1).strip()] = {catpkguse.group(2).strip() : fields[1].strip()} + else: + uselocaldesc[catpkguse.group(1).strip()][catpkguse.group(2).strip()] = fields[1].strip() + except IOError: + print_warn(5, "Could not load USE flag descriptions from " + path(gentoolkit.settings["PORTDIR"] + "/profiles/use.desc")) + + if not Config["piping"]: + print_info(3, "[ Colour Code : " + pp.useflagon("set") + " " + pp.useflagoff("unset") + " ]") + print_info(3, "[ Legend : Left column (U) - USE flags from make.conf ]") + print_info(3, "[ : Right column (I) - USE flags packages was installed with ]") + + use_expand = gentoolkit.settings["USE_EXPAND"].lower().split() + + # Iterate through matches, printing a report for each package + matches_found = 0 + for p in matches: + + if not p.is_installed() and opts["installedOnly"]: + continue + + matches_found += 1 + + bestver = p.get_cpv() + iuse = p.get_env_var("IUSE").split() + + use_expand_map = {} + + for usevar in iuse[:]: + found = False + for usehead in use_expand: + if usevar.startswith(usehead+"_"): + found = True + use_expand_map[usevar] = usehead + break + if not found: + iuse.remove(usevar) + + usevar = use_expand_map.keys() + usevar.sort() + + inuse = [] + if p.is_installed(): + used = p.get_use_flags().split() + else: + # cosmetic issue here as noninstalled packages don't have "used" flags + used = useflags + + # store (inuse, inused, flag, desc) + output = [] + + for u in usevar: + inuse = 0 + inused = 0 + try: + desc = usedesc[u] + except KeyError: + try: + desc = uselocaldesc[p.get_category() + "/" + p.get_name()][u] + except KeyError: + desc = "" + + if u in p.get_settings("USE"): + inuse = 1 + if u in used: + inused = 1 + + output.append((inuse, inused, u, desc)) + + # pretty print + if output: + if not Config["piping"]: + print_info(0, "[ Found these environment variables for " + pp.cpv(bestver) + " ]") + print_info(3, pp.emph(" U I")) + + maxflag_len = 0 + for inuse, inused, u, desc in output: + if len(u) - len(use_expand_map[u]) - 1 > maxflag_len: + maxflag_len = len(u)-len(use_expand_map[u])-1 + + prev_usehead = "" + for in_makeconf, in_installed, flag, desc in output: + if use_expand_map[flag] != prev_usehead: + prev_usehead = use_expand_map[flag] + print "-----",prev_usehead.upper() + markers = ["-","+"] + colour = [pp.useflagoff, pp.useflagon] + if Config["piping"]: + print_info(0, markers[in_makeconf] + flag[len(prev_usehead)+1:]) + else: + if in_makeconf != in_installed: + print_info(0, pp.emph(" %s %s" % (markers[in_makeconf], markers[in_installed])), False) + else: + print_info(0, " %s %s" % (markers[in_makeconf], markers[in_installed]), False) + + print_info(0, " " + colour[in_makeconf](flag[len(prev_usehead)+1:].ljust(maxflag_len)), False) + + # print description + if desc: + print_info(0, " : " + desc) + else: + print_info(0, " : <unknown>") + else: + if not Config["piping"]: + print_info(1, "[ No environment variables found for " + pp.cpv(p.get_cpv()) + "]") + + if Config["verbosityLevel"] >= 2: + if matches_found == 0: + s = "" + if opts["installedOnly"]: + s = "installed " + die(3, "No " + s + "packages found for " + pp.pkgquery(query)) + + + def shortHelp(self): + return pp.localoption("<local-opts> ") + pp.pkgquery("pkgspec") + " - display environment variables for " + pp.pkgquery("pkgspec") + def longHelp(self): + return "Display environment for a given package\n" + \ + "\n" + \ + "Syntax:\n" + \ + " " + pp.command("vars") + pp.localoption(" <local-opts> ") + pp.pkgquery("pkgspec") + \ + "\n" + \ + pp.localoption("<local-opts>") + " is either of: \n" + \ + " " + pp.localoption("-a, --all") + " - include non-installed packages\n" + + class CmdDisplayDepGraph(Command): """Display tree graph of dependencies for a query""" @@ -1403,6 +1612,7 @@ "depends" : CmdListDepends(), "hasuse" : CmdFindUSEs(), "uses" : CmdDisplayUSEs(), + "vars" : CmdDisplayVars(), "depgraph" : CmdDisplayDepGraph(), "changes" : CmdDisplayChanges(), "size" : CmdDisplaySize(), @@ -1427,6 +1637,7 @@ "s" : "size", "t" : "stats", "u" : "uses", + "v" : "vars", "w" : "which" } [-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --] ^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2005-08-17 3:44 UTC | newest] Thread overview: 13+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2005-06-20 0:43 [gentoo-dev] USE_EXPAND and IUSE Jason Stubbs 2005-06-19 16:48 ` Alin Nastac 2005-06-19 17:10 ` Sven Wegener 2005-06-20 7:37 ` Jason Stubbs 2005-06-21 5:11 ` Donnie Berkholz 2005-06-21 21:35 ` Jason Stubbs 2005-06-21 16:29 ` Donnie Berkholz 2005-06-21 16:59 ` Alec Warner 2005-06-21 17:07 ` Donnie Berkholz 2005-08-17 3:42 ` Jason Stubbs 2005-06-21 5:35 ` Alin Nastac 2005-06-21 20:28 ` Jason Stubbs 2005-06-21 21:17 ` Jason Stubbs
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox