Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
TOOL - Usetool for useflag analisys
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
xchris
Advocate
Advocate


Joined: 10 Jul 2003
Posts: 2824

PostPosted: Thu Jul 29, 2004 11:25 am    Post subject: TOOL - Usetool for useflag analisys Reply with quote


UPDATE 04/09/2004


New python version.It has great improvements!
http://www.xchris.net/download.php?file=files/usetool.tar.gz

Usage has changed...please type usetool -h for details!


------------------------------
OLD POST
i've done a tool for useflag analisys on our box.
i paste the README file that comes with the tar.gz

http://xchris.altervista.org/GECHI/
-->usetool.tar.gz
(the dumb site is in italian but the script speaks english :) )
a screenshot: http://xchris.altervista.org/GECHI/usetool-0.1d.jpg


the code is not as clean as i would like,but it seems to work.
Optimizations to come

hope you like it! :D
bye

README wrote:

Usetool is a bash script for USE analisys on your Gentoo System.





As i'm not good with docs i illustrate some typical use:
At first you have to do a database sync (needed to speed up searches)

usetool -dbs



-- Let's search for all INSTALLED packages that can be compiled with
"mmx" useflag (despite if they are or not) and show version

usetool -a mmx -v



-- Let's search for all INSTALLED packages that have been compiled with
"mmx" useflag and show version

usetool -u mmx -v



-- Let's search for all INSTALLED packages that have not been compiled with
"mmx" useflag (among those supporting it) and show version

usetool -nu mmx -v



-- Let's search for all INSTALLED packages that have not been compiled with
"mmx" and "alsa" useflags , show version ,show use description and
don't colorize it. (usefull if you want to pipe it to other scripts)

usetool -nu mmx alsa -v -ud -nc



-- Let's get a summary for "mmx" useflag showing wich packages have been
compiled with. (NOTE:only one useflag supported)

usetool -s mmx



-- Let's analize our entire system and show which packages where compiled
with "extra useflag" and "less useflags" according to our USE settings.

usetool -d



-- Let's analize again like before but restricting our analisys on packages
supporting "mmx" and "alsa" useflags and show version,description

usetool -d mmx alsa -v -ud



-- Again with a database sync before running

usetool -d mmx alsa -v -ud -dbs



type 'usetool -h' for complete usage options

That's all!


a nice use would be:

Code:

emerge `./usetool -nu ipv6 alsa -nc`



and it will recompile packages missing ipv6 and alsa support!
_________________
while True:Gentoo()


Last edited by xchris on Sat Feb 26, 2005 10:26 am; edited 3 times in total
Back to top
View user's profile Send private message
_FD_
n00b
n00b


Joined: 06 Aug 2004
Posts: 37

PostPosted: Tue Aug 10, 2004 1:36 pm    Post subject: Reply with quote

This tool really comes in handy, if you have changed your useflags a lot and want to compile everything, that the changes affect:

USEF=`emerge info |grep USE |cut -d '"' -f2`;emerge -a `./usetool-0.2/usetool -nu $USEF -nc`

All of that in one line. I guess there is an easier way, but it works.
Back to top
View user's profile Send private message
xchris
Advocate
Advocate


Joined: 10 Jul 2003
Posts: 2824

PostPosted: Wed Aug 11, 2004 7:29 am    Post subject: Reply with quote

i'm away from my gentoo (so i can't give you the exact syntax) but you should do it also by "grepping" ebuilds from a

Code:

./usetool -d -dbs -nc


i'm happy you like it :)

bye
_________________
while True:Gentoo()
Back to top
View user's profile Send private message
_FD_
n00b
n00b


Joined: 06 Aug 2004
Posts: 37

PostPosted: Wed Aug 11, 2004 7:43 am    Post subject: Reply with quote

Hey, this is even better. This works after removing USE flags, too. I kinda overlooked this option. Thanks.
Back to top
View user's profile Send private message
_FD_
n00b
n00b


Joined: 06 Aug 2004
Posts: 37

PostPosted: Wed Aug 11, 2004 8:48 am    Post subject: Reply with quote

I just tried the -d flag, but it has too much output to use directly on the command line:

sys-devel/binutils: bootstrap
sys-apps/tcp-wrappers: ( ipv6 )
sys-libs/db: ( java tcltk )
sys-libs/db: ( java tcltk )
dev-lang/python: ( ipv6 tcltk )
net-misc/iputils: ( ipv6 )
net-misc/wget: ( ipv6 )
net-misc/openssh: ( ipv6 )
media-libs/lcms: ( tiff )
media-libs/flac: ( sse )
media-libs/libmikmod: ( esd )
media-libs/pdflib: ( java tcltk )
media-gfx/imagemagick: ( tiff wmf )
media-gfx/xloadimage: ( tiff )
media-sound/esound: ( ipv6 )
media-sound/xmms: ( ipv6 mmx )
x11-libs/qt: ( ipv6 mysql )
kde-base/kdenetwork: ( samba )
kde-base/kdegraphics: ( gphoto2 tetex )
gnome-base/gnome-vfs: ( ipv6 samba )
mail-mta/postfix: mailwrapper mbox
net-libs/libwww: ( mysql )
dev-php/mod_php: ( java )
dev-php/php: ( java )


Referring to your USE setting
Found packages with these extra use: bootstrap mailwrapper mbox
Found packages with these missing use:( esd gphoto2 ipv6 java mmx mysql samba sse tcltk tetex tiff wmf )


There is no '=' in the front there, too, or else one could use:
emerge -a --oneshot `usetool -d -v -nc |sed 's/:.*//'|grep /`

Now one has to use:
emerge -a --oneshot `usetool -d -v -nc |grep / |sed 's/:.*//;s/^/=/'`

EDIT changed syntax. EDIT


Last edited by _FD_ on Sat Aug 28, 2004 2:01 pm; edited 1 time in total
Back to top
View user's profile Send private message
xchris
Advocate
Advocate


Joined: 10 Jul 2003
Posts: 2824

PostPosted: Wed Aug 11, 2004 6:31 pm    Post subject: Reply with quote

thank you for having posted right sintax!

next release will be more comfortable for this kind of work! (and it will be pythonized :) )

thank you again!
bye
_________________
while True:Gentoo()
Back to top
View user's profile Send private message
xchris
Advocate
Advocate


Joined: 10 Jul 2003
Posts: 2824

PostPosted: Sat Aug 14, 2004 3:32 pm    Post subject: Reply with quote

new 0.2-pre2 uploaded!

still bash script. (python coming soon)

added package.use check.

bye
_________________
while True:Gentoo()
Back to top
View user's profile Send private message
gieltje
n00b
n00b


Joined: 14 Aug 2004
Posts: 59

PostPosted: Sat Aug 14, 2004 9:04 pm    Post subject: php+libmcal Reply with quote

_FD_ wrote:
I just tried the -d flag, but it has too much output to use directly on the command line:
blablabla, cut for length


try ./useflag -d | less that should make a list you can easily go back and forth in :P

I builded php without mcal today (fresh install, and mcal is broken currently).
But after I added mcal to the use flag, and rebuilded the database php still wasnt mentioned for the lack of mcal. :oops:
(didn't test with the new pre2, I'll do that tomorow).

--edit-- Just tested with pre2, still doesnt see it --edit--
Back to top
View user's profile Send private message
xchris
Advocate
Advocate


Joined: 10 Jul 2003
Posts: 2824

PostPosted: Sun Aug 15, 2004 6:19 am    Post subject: Reply with quote

i think i don't understand.

can you explain?
hope it's not a bug.

did you run usetool -dbs? (after emerging)

bye
_________________
while True:Gentoo()
Back to top
View user's profile Send private message
gieltje
n00b
n00b


Joined: 14 Aug 2004
Posts: 59

PostPosted: Sun Aug 15, 2004 9:33 am    Post subject: Reply with quote

I did emerge php (without libmcal)
added mcal to /etc/make.conf
(maybe I missed something here?)
./usetool -dbs
./usetool -d
And nothing :evil: while php supports mcal.
Back to top
View user's profile Send private message
xchris
Advocate
Advocate


Joined: 10 Jul 2003
Posts: 2824

PostPosted: Sun Aug 15, 2004 11:53 pm    Post subject: Reply with quote

if you're talking about php,it doesn't support mcal.
if you're talking about mod_php it could be a bug. (because it support it)

if you do:
add mcal to make.conf
(and you don't have compiled mod_php with mcal USE)
usetool -d

if it doesn't come out it could be a bug.

try to do:
usetool -s mcal -nc -dbs

bye
_________________
while True:Gentoo()
Back to top
View user's profile Send private message
gieltje
n00b
n00b


Joined: 14 Aug 2004
Posts: 59

PostPosted: Mon Aug 16, 2004 8:41 pm    Post subject: Reply with quote

It see's mod_php misses mcal now :| but I get this error durring -dbs;
mv: cannot stat `/tmp/usetool.err': No such file or directory
mv: cannot stat `/tmp/usetooltmp': No such file or directory
Back to top
View user's profile Send private message
xchris
Advocate
Advocate


Joined: 10 Jul 2003
Posts: 2824

PostPosted: Mon Aug 16, 2004 11:13 pm    Post subject: Reply with quote

don't mind about those error.
It's a bug (really stupid bug..)

it doesn't change usetool functionality!
just ignore it !

in next release i will fix it!
thank you for having reported!

if don't want to see iy anymore do this
Code:

touch /tmp/usetool.err


bye
_________________
while True:Gentoo()
Back to top
View user's profile Send private message
kogorman
n00b
n00b


Joined: 14 Mar 2004
Posts: 12
Location: Arroyo Grande, California USA

PostPosted: Tue Aug 17, 2004 2:37 am    Post subject: Reply with quote

This sounds great but there must be something going
on with the database. When I try
./usetool -dbs
I get

treat usetool-0.2 # ./usetool -dbs

Updating Database
Please Wait.......Database updated!

mv: cannot stat `/tmp/usetool.err': No such file or directory
mv: cannot stat `/tmp/usetooltmp': No such file or directory
treat usetool-0.2 #

Nevertheless, other options seem to work.

++ kevin
_________________
Kevin O'Gorman, PhD
Back to top
View user's profile Send private message
xchris
Advocate
Advocate


Joined: 10 Jul 2003
Posts: 2824

PostPosted: Tue Aug 17, 2004 2:22 pm    Post subject: Reply with quote

it's a really stupid bug on a really stupid piece of code.

at line 263:

Code:

mv $BASE.err $BASE"tmp"
rm $BASE.* 2> /dev/null
mv $BASE"tmp" $BASE.err


leave only

Code:

rm $BASE.* 2> /dev/null


i'm finishing python version with these feature:
-auto sync db
-more comfortable to paste to emerge
-extra functions --packageuse-create (usetool --packageuse-create > /etc/portage/package.use)
- changed -d behavior (you can filter on packages,instead of use)
-removed --use-description,added quiet.

This version will be easier,faster! (i hope ;) )

It is still alpha but i plan to upload it when i get back to home.
(say 10 days)

bye
_________________
while True:Gentoo()
Back to top
View user's profile Send private message
_FD_
n00b
n00b


Joined: 06 Aug 2004
Posts: 37

PostPosted: Wed Aug 18, 2004 7:12 am    Post subject: Re: php+libmcal Reply with quote

Looking forward to test it. What did you change in Version 0.2?


gieltje wrote:
_FD_ wrote:
I just tried the -d flag, but it has too much output to use directly on the command line:
blablabla, cut for length


try ./useflag -d | less that should make a list you can easily go back and forth in :P


With "too much output" I was refering to all the infromation like the use flags for each package and the useflag summary, all of which make it impossible, to use it directly in a pipe to the emerge command. You have to filter them out first.
Back to top
View user's profile Send private message
xchris
Advocate
Advocate


Joined: 10 Jul 2003
Posts: 2824

PostPosted: Wed Aug 18, 2004 8:01 am    Post subject: Re: php+libmcal Reply with quote

_FD_ wrote:
Looking forward to test it. What did you change in Version 0.2?


i think i will go directly to 0.3 because of change of script language.
First of all i wanted to simplify the use within emerge. ( i could have done --emerge option but i prefer to leave usetool as an analisys tool only,altough now it's very easy)

if you wanna recompile all the system you could issue:
Code:

emerge `usetool --difference --quiet`


you don't need anymore the -nc option (but it is still there) because it detects if you're on a tty or if you are piping to other scripts.

every options return a =cat/pkg-ver

changed output format to be similar to emerge.

you don't need anymore to sync db because it detects automatically when it's necessary.

improved speed! (on my dual xeon it takes less than a second to perform a -d)

removed --use-description (which is default) and added --quiet if you don't need every info.

removed --no-version,added --version (by default prints out version)

added --packageuse-create.
Let's suppose you compiled a pkg with USE="use1 use2" emerge pkt
if you run usetool -d it reports correctly "use1 use2" for pkt.
If now we want to add it to package.use we coul issue a
Code:

usetool -pc -q pkt >>/etc/portage/package.use


and other small fixes.

hope you will like it.

by the end of the month it will be uploaded.
bye
_________________
while True:Gentoo()
Back to top
View user's profile Send private message
BearingSpacer
n00b
n00b


Joined: 17 Feb 2003
Posts: 19

PostPosted: Sat Aug 28, 2004 11:23 am    Post subject: Reply with quote

would you consider useful adding a display to show if the package is in the world file or not ?

coz if you emerge a package that was a dependency of another the way you do in this thread, it would be added to the world file and it shouldn't be in there.

to avoid this, I use --oneshot on the emerges
Back to top
View user's profile Send private message
_FD_
n00b
n00b


Joined: 06 Aug 2004
Posts: 37

PostPosted: Sat Aug 28, 2004 2:00 pm    Post subject: Reply with quote

Yeah, thats right, I didn't think of that. I changed my post to reflect this issue.


The correct code for Version 0.2 is:
Code:

emerge -a --oneshot `usetool -d -v -nc |grep / |sed 's/:.*//;s/^/=/'`
Back to top
View user's profile Send private message
xchris
Advocate
Advocate


Joined: 10 Jul 2003
Posts: 2824

PostPosted: Sat Aug 28, 2004 4:26 pm    Post subject: Reply with quote

are you sure about that?

i'm testing it on gentoo-macos and this is the behavior:

emerge =cat/app --- world file not changed
emerge app --- world file changed

i don't think this version of portage differs from the standard one.

am i wrong?

(new version is almost done....hope to release it in about 10 days)
_________________
while True:Gentoo()
Back to top
View user's profile Send private message
_FD_
n00b
n00b


Joined: 06 Aug 2004
Posts: 37

PostPosted: Sun Aug 29, 2004 1:49 pm    Post subject: Reply with quote

Yep, just tested it. If there is a '=' in front of the package name it is indeed not written in the world file, so the --oneshot would not be necessary.
This is true for Portage 2.0.50-r10. I don't know if this behavier is changed in Portage 2.0.51.
Back to top
View user's profile Send private message
xchris
Advocate
Advocate


Joined: 10 Jul 2003
Posts: 2824

PostPosted: Sat Sep 04, 2004 3:30 pm    Post subject: Reply with quote

New 0.3.17 python version at http://xchris.altervista.org/GECHI/usetool/

Code:

usetool -h

for new usage!

feedback welcome!
bye
_________________
while True:Gentoo()
Back to top
View user's profile Send private message
gieltje
n00b
n00b


Joined: 14 Aug 2004
Posts: 59

PostPosted: Sat Sep 04, 2004 9:45 pm    Post subject: Reply with quote

Will this program in the future be included on the emerge mirror's?
So we can emerge it?
Back to top
View user's profile Send private message
xchris
Advocate
Advocate


Joined: 10 Jul 2003
Posts: 2824

PostPosted: Sat Sep 04, 2004 10:51 pm    Post subject: Reply with quote

i don't think so :)

but there's an ebuild containig it together with other usefull script.
If you wanna try it go here:
https://forums.gentoo.org/viewtopic.php?t=204052


sorry but it's only in italian. (i'll ask for a translation)
but you can still found and download the ebuild.

Right now usetool contained in that ebuild is only 0.2_pre2 version but we (italian group called Gechi) plan to update it in a few days.

Hope you will like it.
bye
_________________
while True:Gentoo()
Back to top
View user's profile Send private message
FonderiaDigitale
Veteran
Veteran


Joined: 06 Nov 2003
Posts: 1710
Location: Rome, Italy

PostPosted: Sun Sep 05, 2004 12:04 am    Post subject: Reply with quote

ok ok, two days at most ;)
_________________
Come disse un amico, i sistemisti sono un po' come gli artigiani per l'informatica :)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum