From: Fred Van Andel <fred@vanandel.net>
To: gentoo-dev@gentoo.org
Subject: Re: [gentoo-dev] mplayer with dvdread
Date: Fri, 11 Apr 2003 12:55:16 -0700 [thread overview]
Message-ID: <20030411125516.4D2BACA8.fred@vanandel.net> (raw)
In-Reply-To: <20030410145459.9DE94BA8.fred@vanandel.net>
[-- Attachment #1: Type: text/plain, Size: 852 bytes --]
Fred Van Andel <fred@vanandel.net> wrote:
(04/10/2003 14:54)
>The code is not quite ready for prime time so I don't want distribute the
>source yet. But if you or anyone wants a copy or the output let me know
>and I will email you a copy off-list (its 85K).
Sorry for replying to myself but the code is complete and attached to this
email.
To run either type:
perl extractuse.pl
or set the executable bit and run it directly.
It will print to stdout 2 lists, the first is a list of packages and the
use flags associated with them. The second list is of the use flags
and which packages use them.
You will probable want to redirect the output to a file or use
a pager, the output is > 3000 lines.
Depending on the speed of your machine it can take a couple of
minutes before it produces any output so be patient.
Enjoy
Fred Van Andel
[-- Attachment #2: extractuse.pl --]
[-- Type: application/octet-stream, Size: 2680 bytes --]
#!/usr/bin/perl
# Copyright 2003 by Fred Van Andel (fred@vanandel.net)
#
# Licenced under the GPL
#
# Extract USE flags information from the /usr/portage/ directory
# and print lists to stdout showing how they are used.
#
# Note: Sometimes different versions of a package will have
# different USE flags, this software will show them all
# under the base package name.
#
use File::Find;
use strict vars;
our(%Packages, %UseFlags);
sub ProcessEachFile
{
our($Pname, @UseList, $tmp, $i, $last);
if(($File::Find::name =~ m!\.ebuild$!) != 0)
{
open(EBUILD, "<" . $File::Find::name);
$/ = '<<NON EXISTENT SEPARATOR>>'; # Set slurp mode
$_ = <EBUILD>;
close(EBUILD);
# extract the use flags from the IUSE variable
m!IUSE[ \t]*=[ \t]*"([^"]*)"!ig;
$tmp = $1;
$tmp =~ s!\n! !;
@UseList = split(m![ ]+!, $tmp);
# produce the package name from the file name
if($File::Find::name =~ m!^/usr/portage/([^/]*/[^/]*)/! != 0)
{ $Pname = $1; }
else
{ $Pname = ""; }
# if we have use flags and a package name then save them for later processing
if(($#UseList != -1) && ($Pname ne ""))
{
$last = "";
for $i (sort(@UseList))
{
if($last ne $i)
{
$last = $i;
$Packages{$i} .= "$Pname\t";
$UseFlags{$Pname} .= "$i\t";
}
}
}
}
}
find(\&ProcessEachFile, ("/usr/portage/"));
our(@FlagList, @UseList, $i, $j, $last);
# print out the list of use flags for each package
for $i (sort(keys %UseFlags))
{
@FlagList = sort(split(m!\t!, $UseFlags{$i}));
print "$i:";
$last = "";
for $j (@FlagList)
{
if($last ne $j)
{
print " $j";
$last = $j;
}
}
print "\n";
}
print "\n\n\n";
# print out the packages for each use flag
for $i (sort(keys %Packages))
{
our(@UseList, $i, $j, $last);
@UseList = sort(split(m!\t!, $Packages{$i}));
print "$i:\n";
$last = "";
for $j (@UseList)
{
if($last ne $j)
{
print " $j\n";
$last = $j;
}
}
}
[-- Attachment #3: Type: text/plain, Size: 37 bytes --]
--
gentoo-dev@gentoo.org mailing list
next prev parent reply other threads:[~2003-04-11 19:55 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-04-09 22:48 [gentoo-dev] mplayer with dvdread M. Zuelsdorff
2003-04-09 21:47 ` Martin Schlemmer
2003-04-10 8:38 ` Henti Smith
2003-04-10 17:49 ` Martin Schlemmer
2003-04-10 21:32 ` M. Zuelsdorff
2003-04-10 20:43 ` [gentoo-dev] mplayer with dvdread -- use flag comment Riyad Kalla
2003-04-10 21:15 ` Martin Schlemmer
2003-04-10 21:25 ` Riyad Kalla
2003-04-10 21:55 ` Martin Schlemmer
2003-04-10 21:02 ` [gentoo-dev] mplayer with dvdread Martin Schlemmer
2003-04-10 21:22 ` Riyad Kalla
2003-04-10 21:52 ` Martin Schlemmer
2003-04-10 21:54 ` Fred Van Andel
2003-04-11 19:55 ` Fred Van Andel [this message]
2003-04-11 18:09 ` Thilo Bangert
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=20030411125516.4D2BACA8.fred@vanandel.net \
--to=fred@vanandel.net \
--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