Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Mini-Tip] USE pacchetti
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian) Risorse italiane (documentazione e tools)
View previous topic :: View next topic  
Author Message
anacleto44
n00b
n00b


Joined: 24 Aug 2005
Posts: 18

PostPosted: Fri Feb 24, 2006 1:17 pm    Post subject: [Mini-Tip] USE pacchetti Reply with quote

Ragazzi, questa mattina mi era nata l'esigenza di raccogliere tutte le variabili USE che ho utilizzato nel sistema durante la compilazione di tutti i miei pacchetti. Non so se può servire anche a voi, ma per me è molto utile e quindi vi passo il mio piccolo script scritto in perl.

calc-use.pl
Code:
#!/usr/bin/perl

print "Ricerca degli USE utilizzati nei pacchetti...";
@USES = `cat /var/db/pkg/*/*/USE`;
chop(@USES);
print "fatto.\n";
print "Generazione elenco USE...\n";
foreach $USES (@USES) {
  $USEJ = $USEJ." ".$USES;
}
@UX = split(/ /, $USEJ);
$count = scalar @UX;
$i=-1;
for ($j=0; $j<$count; $j++) {
  $equal = 0;
  for ($x=0; $x<=$i; $x++) {
    if (@UU[$x] eq @UX[$j]) {
      $equal = 1;
      $x = $i;
    }
  }
  if ($equal == 0) {
    $i++;
    @UU[$i] = @UX[$j];
  }
  print "\b\b\b\b\b";
  print int(($j/$count)*100);
  print " %";
}
print "\b\b\b\b\b\b";
print "100 %\n";
print "USE Utilizzate: ";
for ($z=0; $z<=$i; $z++) {
  print @UU[$z];
  print " ";
}
print "\n";


Il risultato del funzionamento di questo script è tipo questo:
Code:
localhost ~ # ./calc-use.pl
Ricerca degli USE utilizzati nei pacchetti...fatto.
Generazione elenco USE...
100 %
USE Utilizzate:  x86 X alsa apm avi berkdb bitmap-fonts crypt cups eds emboss en
code foomaticdb fortran gdbm gif gpm gstreamer gtk gtk2 imlib ipv6 jpeg libg++ l
ibwww mad mikmod motif mp3 mpeg ncurses nls ogg oggvorbis opengl oss pam pdflib
perl png python quicktime readline sdl spell ssl tcpd truetype truetype-fonts ty
pe1-fonts vorbis xinerama xml2 xmms xv zlib elibc_glibc input_devices_keyboard i
nput_devices_joystick input_devices_mouse kernel_linux linguas_it userland_GNU v
ideo_cards_nvidia video_cards_vesa video_cards_vga aac dvd dvdread nvidia win32c
odecs xvid audiofile bzip2 cdb exif expat fam glut imagemagick pcre tcltk tiff u
dev arts gnome kde mmx qt sse cdr curl ffmpeg gtkhtml idn java junit lcms mhash
mng mysql recode scanner usb esd gmp guile nptl cdparanoia esd* tga ~x86


Spero che vi possa servire in qualsiasi modo, fatemi sapere. Un saluto a tutti ;)

//$t4cK
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 31348
Location: here

PostPosted: Fri Feb 24, 2006 1:26 pm    Post subject: Reply with quote

Non e' la stessa cosa fare
Code:
$ emerge --info | grep USE
:?:
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
anacleto44
n00b
n00b


Joined: 24 Aug 2005
Posts: 18

PostPosted: Fri Feb 24, 2006 1:28 pm    Post subject: Reply with quote

Tra: emerge --info | grep USE
Code:
USE="x86 X aac alsa apm avi berkdb bitmap-fonts crypt cups dvd dvdread eds emboss encode foomaticdb fortran gdbm gif gpm gstreamer gtk gtk2 imlib ipv6 jpeg libg++ libwww mad mikmod motif mp3 mpeg ncurses nls nptl nvidia ogg oggvorbis opengl oss pam pdflib perl png python quicktime readline sdl spell ssl tcpd truetype truetype-fonts type1-fonts vorbis win32codecs xinerama xml2 xmms xv xvid zlib elibc_glibc kernel_linux linguas_it userland_GNU"

e: ./calc-use.pl
Code:
USE Utilizzate:  x86 X alsa apm avi berkdb bitmap-fonts crypt cups eds emboss encode foomaticdb fortran gdbm gif gpm gstreamer gtk gtk2 imlib ipv6 jpeg libg++ libwww mad mikmod motif mp3 mpeg ncurses nls ogg oggvorbis opengl oss pam pdflib perl png python quicktime readline sdl spell ssl tcpd truetype truetype-fonts type1-fonts vorbis xinerama xml2 xmms xv zlib elibc_glibc input_devices_keyboard input_devices_joystick input_devices_mouse kernel_linux linguas_it userland_GNU video_cards_nvidia video_cards_vesa video_cards_vga aac dvd dvdread nvidia win32codecs xvid audiofile bzip2 cdb exif expat fam glut imagemagick pcre tcltk tiff udev arts gnome kde mmx qt sse cdr curl ffmpeg gtkhtml idn java junit lcms mhash mng mysql recode scanner usb esd gmp guile nptl cdparanoia esd* tga ~x86

io vedo un po' di differenza. Può darsi mi sbaglio fatemi sapere :S
Back to top
View user's profile Send private message
gutter
Bodhisattva
Bodhisattva


Joined: 13 Mar 2004
Posts: 7162
Location: Aarau, Aargau, Switzerland

PostPosted: Sat Feb 25, 2006 9:55 pm    Post subject: Reply with quote

Che risultato ti da questo comando:

Code:

 diff <(cat /var/db/pkg/*/*/USE | sed -e "s/\ /\n/g" | sort | uniq)  <(emerge info | grep USE | sed -e "s/USE=\"//g" -e "s/\"//g" -e "s/\ /\n/g" | sort)


?

Posteresti per favore anche il contenuto di /etc/portage/package.use.
_________________
Registered as User #281564 and Machines #163761
Back to top
View user's profile Send private message
codadilupo
Advocate
Advocate


Joined: 05 Aug 2003
Posts: 3135

PostPosted: Sun Feb 26, 2006 6:56 am    Post subject: Reply with quote

fedeliallalinea wrote:
Non e' la stessa cosa fare
Code:
$ emerge --info | grep USE
:?:


Credo che il metodo di anacleto riporti anche le use abilitate per i singoli pacchetti. Il tuo metodo (molto comodo ;-)) mi dice invece quelle abilitate per tutti i pacchetti.

Coda
Back to top
View user's profile Send private message
gutter
Bodhisattva
Bodhisattva


Joined: 13 Mar 2004
Posts: 7162
Location: Aarau, Aargau, Switzerland

PostPosted: Sun Feb 26, 2006 8:15 am    Post subject: Reply with quote

codadilupo wrote:

Credo che il metodo di anacleto riporti anche le use abilitate per i singoli pacchetti.


Ti riferisci a quelle contenute in /etc/portage/package.use ?
_________________
Registered as User #281564 and Machines #163761
Back to top
View user's profile Send private message
anacleto44
n00b
n00b


Joined: 24 Aug 2005
Posts: 18

PostPosted: Sun Feb 26, 2006 7:22 pm    Post subject: Reply with quote

Il mio /etc/portage/package.use è vuoto.

diff <(cat /var/db/pkg/*/*/USE | sed -e "s/\ /\n/g" | sort | uniq) <(emerge info | grep USE | sed -e "s/USE=\"//g" -e "s/\"//g" -e "s/\ /\n/g" | sort) da come risultato:
Code:
4,5d3
< arts
< audiofile
9,12d6
< bzip2
< cdb
< cdparanoia
< cdr
15d8
< curl
22,27d14
< esd
< esd*
< exif
< expat
< fam
< ffmpeg
32,34d18
< glut
< gmp
< gnome
39,42d22
< gtkhtml
< guile
< idn
< imagemagick
44,46d23
< input_devices_joystick
< input_devices_keyboard
< input_devices_mouse
48d24
< java
50,51d25
< junit
< kde
53d26
< lcms
58d30
< mhash
60,61d31
< mmx
< mng
65d34
< mysql
75d43
< pcre
80d47
< qt
83,84d49
< recode
< scanner
87d51
< sse
89d52
< tcltk
91,92d53
< tga
< tiff
96,97d56
< udev
< usb
99,101d57
< video_cards_nvidia
< video_cards_vesa
< video_cards_vga
106d61
< ~x86

Comunque l'intento del mio script era quello di restituire TUTTI gli USE abilitati da tutti i pacchetti del sistema e quindi dentro /var/db/pkg/ (come ha ben detto codadilupo 8) )
Back to top
View user's profile Send private message
gutter
Bodhisattva
Bodhisattva


Joined: 13 Mar 2004
Posts: 7162
Location: Aarau, Aargau, Switzerland

PostPosted: Mon Feb 27, 2006 10:12 pm    Post subject: Reply with quote

Se lanci un:

Code:
emerge -DuNa world


cosa ti vuole rivcompilare?

E' probabile che tu abbia cambiato le USE ed alcuni pacchetti debbano essere ricompilati con le nuove USE.
_________________
Registered as User #281564 and Machines #163761
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian) Risorse italiane (documentazione e tools) All times are GMT
Page 1 of 1

 
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