Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[portageq] come funziona? [riaperto]
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)
View previous topic :: View next topic  
Author Message
cloc3
Advocate
Advocate


Joined: 13 Jan 2004
Posts: 4810
Location: http://www.gentoo-users.org/user/cloc3/

PostPosted: Wed Aug 23, 2006 3:47 pm    Post subject: [portageq] come funziona? [riaperto] Reply with quote

Ho dato un occhio al comando portageq.
Code:

s939 ~ # portageq
>>> Portage information query tool -- version 1.13.2.1
>>> Usage: portageq <command> [<option> ...]

Available commands:
   config_protect_mask
...

Ho visto che fa molte cose.
Alcune, per la verità sono piuttosto banali. Le più importanti, invece, mi sembrano di utilizzo un po' misterioso.
Per esempio, non ho capito cosa sia il parametro <pkgtype> del comando metadata.

Esiste una documentazione un po' più ampia del semplice `portageq --help`? Magari con qualche esempio d'uso?
_________________
vu vu vu
gentù
mi piaci tu


Last edited by cloc3 on Sat Aug 26, 2006 5:35 am; edited 2 times in total
Back to top
View user's profile Send private message
cloc3
Advocate
Advocate


Joined: 13 Jan 2004
Posts: 4810
Location: http://www.gentoo-users.org/user/cloc3/

PostPosted: Wed Aug 23, 2006 6:50 pm    Post subject: Re: [portageq] come funziona? Reply with quote

cloc3 wrote:

Per esempio, non ho capito cosa sia il parametro <pkgtype> del comando metadata.

Ma tu guarda. Sono quattro righe di codice:
http://www.mail-archive.com/gentoo-portage-dev%40lists.gentoo.org/msg01490.html wrote:

+ type_map = {
+ "ebuild":"porttree",
+ "binary":"bintree",
+ "installed":"vartree"}
+ if pkgtype not in type_map:
+ print >> sys.stderr, "Unrecognized package type: '%s'" % pkgtype
+ sys.exit(1)

adesso si proverò a capire meglio cosa significano le righe successive (e magari cosa sono le metakeys):
Code:

+       try:
+                       values = portage.db[root][type_map[pkgtype]].dbapi.aux_get(
+                               pkgspec, metakeys)


comunque, se qualcuno sapesse dare indicazioni un po' più precise rispetto alla documentazione, lo ringrazio.
_________________
vu vu vu
gentù
mi piaci tu
Back to top
View user's profile Send private message
cloc3
Advocate
Advocate


Joined: 13 Jan 2004
Posts: 4810
Location: http://www.gentoo-users.org/user/cloc3/

PostPosted: Wed Aug 23, 2006 7:37 pm    Post subject: Reply with quote

ecco un esempio di utilizzo:
Code:

s939 ~ # portageq metadata / installed sys-apps/baselayout-1.12.4-r7  USE CFLAGS
amd64 X a52 aac aalib acpi alsa apache2 audiofile avi bash-completion berkdb bitmap-fonts browserplugin bzip2 bzlib cairo caps cddb cdparanoia chroot cli crypt cspell cups curl dba dbus directfb dlloader dmi dri dv dvd dvdr dvdread dvx4linux eds emboss encode exif expat fbcon ffmpeg flac foomaticdb fortran fpx ftp gd gdbm gif gimp gmp gnome gphoto2 gpm graphviz gstreamer gtk gtk2 gtkhtml hal ieee1394 imlib innodb isdnlog jack java javascript jbig jikes jpeg jpeg2k kde kdeenablefinal kdehiddenvisibility lcms ldap libcaca live lzo lzw lzw-tiff mad mailwrapper md5sum memlimit mime mng mozilla mp3 mpeg mplayer mssql mysql mythtv nas ncurses nls nptl nptlonly nsplugin nvidia ogg oggvorbis openexr opengl pam pam_chroot pam_console pam_timestamp pcre pdf pdflib perl php png posix ppds pppd pwdb python qt qt3 qt4 quicktime readline reflection rtc samba scanner sdl seamonkey session slang speex spell spl ssl svg tcltk tcpd tetex tga theora threads tidy tiff tokenizer trace truetype truetype-fonts type1-fonts udev unicode usb userlocales vorbis wmf xcomposite xine xml xml2 xmlreader xmlwriter xmms xorg xpm xprint xv xvid zlib elibc_glibc input_devices_keyboard input_devices_mouse input_devices_evdev kernel_linux linguas_it linguas_en_GB userland_GNU video_cards_nvidia video_cards_vesa video_cards_nv
-march=athlon64 -O2 -pipe -fweb -frename-registers -ftracer

Un po' deludente, perché mostra tutte le use flags dell'universo, comprese quelle che con il pacchetto non centrano nulla, ma vengono prese acriticamente dalla sovrapposizione del make.default - make.conf - package.use con la quale è stato compilato il pacchetto.
Per quelle specificche del pacchetto, esiste un modo diverso da `emerge -pv` ?
_________________
vu vu vu
gentù
mi piaci tu
Back to top
View user's profile Send private message
cloc3
Advocate
Advocate


Joined: 13 Jan 2004
Posts: 4810
Location: http://www.gentoo-users.org/user/cloc3/

PostPosted: Wed Aug 23, 2006 8:08 pm    Post subject: Reply with quote

Luca89 wrote:

prova con IUSE:

grazie. così va bene.
Intanto ho scoperto anche ` equery uses baselayout`, ma l'ouput è un po' troppo pomposo.

P.S.: dove è scomparso il tuo post ???
_________________
vu vu vu
gentù
mi piaci tu
Back to top
View user's profile Send private message
Luca89
Advocate
Advocate


Joined: 27 Apr 2005
Posts: 2107
Location: Agrigento (Italy)

PostPosted: Wed Aug 23, 2006 8:12 pm    Post subject: Reply with quote

cloc3 wrote:
Luca89 wrote:

prova con IUSE:

grazie. cos� va bene.
Intanto ho scoperto anche ` equery uses baselayout`, ma l'ouput � un po' troppo pomposo.


ops, scusa, ho cancellato il messaggio perchè mi ero accorto che IUSE non fa quello che vuoi, infatti ti mostra tutte le use del pacchetto, non ti indica se sono state attivate o meno dall'utente.
_________________
Running Fast!
Back to top
View user's profile Send private message
cloc3
Advocate
Advocate


Joined: 13 Jan 2004
Posts: 4810
Location: http://www.gentoo-users.org/user/cloc3/

PostPosted: Sat Aug 26, 2006 5:35 am    Post subject: Reply with quote

Luca89 wrote:

prova con IUSE:

Non sempre funziona:
Code:

cloc3@s939 ~ $ portageq metadata / installed reiser4-gentoo-sources-2.6.17-r5 IUSE

cloc3@s939 ~ $ emerge -pv =reiser4-gentoo-sources-2.6.17-r5

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R   ] sys-kernel/reiser4-gentoo-sources-2.6.17-r5  USE="-build -symlink" 0 kB [1]

Il problema è che la variabile IUSE, per questo pacchetto, non è definita all'interno dell'ebuild.
In questo caso, come fa emerge a individuare lo stesso le use build e symlink?

Ancora:
Code:

cloc3@s939 ~ $ equery uses -a =gentoo-sources-2.6.17-r6
[ Searching for packages matching =gentoo-sources-2.6.17-r6... ]
[ Colour Code : set unset ]
[ Legend        : Left column  (U) - USE flags from make.conf                     ]
[                  : Right column (I) - USE flags packages was installed with ]
[ Found these USE variables for sys-kernel/gentoo-sources-2.6.17-r6 ]
 U I
 - - build   : !!internal use only!! DO NOT SET THIS FLAG YOURSELF!, used for creating build images and the first half of bootstrapping.
 - - symlink : Force kernel ebuilds to automatically update the /usr/src/linux symlink.
 - - ultra1  : If you have a SUN Ultra 1 with a HME interface
cloc3@s939 ~ $ grep ultra1 /usr/portage/sys-kernel/gentoo-sources/gentoo-sources-2.6.17-r6.ebuild
IUSE="ultra1"
                # hme lockup hack on ultra1
                use ultra1 || UNIPATCH_EXCLUDE="${UNIPATCH_EXCLUDE} 1705_sparc-U1-hme-lockup.patch"
                        einfo "following command: USE=ultra1 emerge ${PN}"

equery individua 3 diverse useflag. Nessuna di essa appartiene a make.conf (U) o use.defaults. Solo ultra1 è prevista in IUSE.
da dove vengono le altre?
Esistono altri pacchetti con questo comportamento?
_________________
vu vu vu
gentù
mi piaci tu
Back to top
View user's profile Send private message
.:chrome:.
Advocate
Advocate


Joined: 19 Feb 2005
Posts: 4588
Location: Brescia, Italy

PostPosted: Sat Aug 26, 2006 11:15 am    Post subject: Reply with quote

cloc3 wrote:
In questo caso, come fa emerge a individuare lo stesso le use build e symlink?

per l'ereditarietà delle classi di pacchetti
quelle flag sono presenti in tutti i pacchetti della classe kernel
la flag ultra1 si applica solo alle macchine Ultra1, che sono UltraSPARC a 64 bit di una quindicina di anni fa, e viene ereditata dal profilo
Back to top
View user's profile Send private message
cloc3
Advocate
Advocate


Joined: 13 Jan 2004
Posts: 4810
Location: http://www.gentoo-users.org/user/cloc3/

PostPosted: Sat Aug 26, 2006 11:20 am    Post subject: Reply with quote

k.gothmog wrote:

per l'ereditarietà delle classi di pacchetti
quelle flag sono presenti in tutti i pacchetti della classe kernel

Grazie. Ma mi rispondi troppo ermeticamente :) .
Esiste un file specifico che definisce questa associazione, tra use_flags e classi di pacchetti?
_________________
vu vu vu
gentù
mi piaci tu
Back to top
View user's profile Send private message
.:chrome:.
Advocate
Advocate


Joined: 19 Feb 2005
Posts: 4588
Location: Brescia, Italy

PostPosted: Sat Aug 26, 2006 11:29 am    Post subject: Reply with quote

cloc3 wrote:
Grazie. Ma mi rispondi troppo ermeticamente :) .

scusa... lo sai che ho il vizio delle risposte telegrafiche

cloc3 wrote:
Esiste un file specifico che definisce questa associazione, tra use_flags e classi di pacchetti?

la struttura precisa dell'ebuild non la conosco perché non me ne sono mai interessato, però...
a occhio dovrebbe essere questo: ETYPE="sources"
che incorpora la classe "sources"

nella specifica della classe "sources" (che non ho idea di dove sia) ci deve essere un controllo che agginge la USE ultra1, ma la lascia disattivata fintanto che il profilo non è default-linux/sparc
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian) 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