On Tue, Mar 26, 2002 at 07:20:20AM +0100, NN_il_Confusionario wrote:
> On Tue, Mar 26, 2002 at 12:24:42AM +0100, Lo'oRiS il Kabukimono wrote:
> > Mi piacerebbe avere un frontend X per apt
> 
> dovrebbe esistere uno o piu` frontend per gnome, speta ...
> 
>  apt-cache search apt|grep gnome
>  gnome-apt - Gnome front-end to apt
So di gente che usa aptitude (ncurses, non X, ma comunque interattivo)
con soddisfazione.

> > inoltre mi piacerebbe (al massimo anche senza frontend) fare una ricerca
> > dei pacchetti "che occupano pi� spazio di TOT" si pu� fare?
> 
> potere si puo` (con script perl per esempio ...) visto che
> sia /var/lib/dpkg/status che /var/lib/dpkg/available 
> hanno un campo ^Installed-Size: per i paccheti.
A proposito: vedo che /var/lib/dpkg/available e` piu` vecchio di
/var/lib/apt/lists/*Packages , quindi magari conviene usare questi
ultimi...

Comunque, io uso questo scriptino (chiamato dpkg-cap , ove "cap"
sta per "capability" (un nome idiota, ok!)) che si puo` facilmente
adattare ai tuoi bisogni.

<code>
#!/bin/sh
nawk 'BEGIN{FS=": "};\
/^Package: /{name=$2};\
/^Description: /{whatis=$2};\
/^'"$*"'/{res=1};\
/^$/{if (res == 1) print name":", whatis; res=0}' /var/lib/apt/lists/*Packages 
| sort -u
</code>

Spiegazione:

/^Package: /{name=$2} assegna alla variabile "name" il nome del pacchetto

/^Description: /{whatis=$2} assegna alla variabile "whatis" la descrizione
        del pacchetto

/^'"$*"'/{res=1} accende "res" se la riga soddisfa la regex data come
        argomento

/^$/{if (res == 1) print name":", whatis; res=0} alla prima riga vuota
        se "res" e` accesa, stampa il contenuto di "name" e di "whatis"

/var/lib/apt/lists/*Packages e` l'insieme dei file da leggere (sotto potato
        sono in /var/cache/apt/lists )

sort -u ordina alfabeticamente l'output scartando eventuali righe duplicate

In sostanza cerca in /var/lib/apt/lists/*Packages le righe che corrispondono
alla regular expression fornita come argomento - esempio:
        % dpkg-cap "Provides: mail-transport-agent"
        exim-tls: Exim Mailer - with TLS (SSL) support
        zmailer-ssl: Mailer for Extreme Performance Demands
        courier-mta: Mail Transport Agent of the Courier Mail Server
        exim: An MTA (Mail Transport Agent)
        masqmail: A mailer for hosts without permanent internet connection
        nullmailer: Simple relay-only mail transport agent
        postfix: A high-performance mail transport agent
        postfix-snap: Postfix Mail Transport Agent - snapshot release
        sendmail: A powerful, efficient, and scalable Mail Transport Agent.
        smail: Electronic mail transport system.
        ssmtp: Extremely simple MTA to get mail off the system to a mail hub
        zmailer: Mailer for Extreme Performance Demands
o annche:
        % dpkg-cap "Depends:.*fftw2"
        mq3: a mp3/ogg audio player written in Qt.
        extace: waveform viewer.
        fftw-dev: Library for computing Fast Fourier Transforms
        grace: An XY plotting tool
        gramofile: Transfer sound from gramophone records to CD
        libsongprint0: Acoustic fingerprinting and song identification
        octave2.1: The GNU Octave language for numerical computations (2.1 
branch)
        paul: Yet another image viewer (displays PNG, TIFF, GIF, JPG, etc.)
        sfftw-dev: Library for computing Fast Fourier Transforms
        swh-plugins: Steve Harris's LADSPA plugins

Come fare ricerche (sensate) su "Installed-Size: " e` lasciato quale
esercizio per il lettore. ;-)

In debian c'e` un pacchetto analogo (molto + complesso & sofisticato), di
nome dpkg-awk .

Ciao,
/dev/null


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]


Rispondere a