1 |
/var/lib/portage/world |
2 |
|
3 |
Atentamente, |
4 |
David |
5 |
|
6 |
|
7 |
On Thu, Mar 18, 2010 at 7:16 PM, pizted@×××××.com <pizted@×××××.com> wrote: |
8 |
|
9 |
> El 18/03/2010, a las 18:29, Lluís Forns escribió: |
10 |
> |
11 |
> |
12 |
> hace un año que no trabajo con gentoo, pero en el sistema había un |
13 |
>> fichero llamado "world" con todos los paquetes instalados |
14 |
>> especificamente (no contiene las dependencias instaladas). |
15 |
>> |
16 |
>> |
17 |
> Cierto, creo que se encuentra en el directorio de portage, en /usr/portage. |
18 |
> |
19 |
> De todas formas, se puede obtener un listado exacto de todas los programas |
20 |
> instalados parseando la salida del programa "eix". Hace algunos meses yo |
21 |
> hice un pequeño parser para obtener los programas que necesitaban |
22 |
> actualizarse (world no es muy fiable a veces). El código es este, está en |
23 |
> python, con unas pequeñas modificaciones se podría obtener un listado |
24 |
> legible de todos los programas instalados y sus respectivas versiones. Si a |
25 |
> alguien le interesa el programa ese, se llama GUAU y está en |
26 |
> http://halcyon.zapto.org/projects/guau aunque no está terminado, tiene un |
27 |
> par de bugs. |
28 |
> |
29 |
> def make_report(file): |
30 |
> from components import eix |
31 |
> # Open and save the eix result in the file specified in the |
32 |
> # configuration |
33 |
> # NOTE: We must sync eix first to get an updated list |
34 |
> eix.sync() |
35 |
> eix = Popen('eix -uc >>' + file, shell=True) |
36 |
> # Wait for the process to end |
37 |
> eix.wait() |
38 |
> # Start counting packages |
39 |
> p = 0 |
40 |
> print _('* Making update report...') |
41 |
> # We iterate over the object |
42 |
> for line in fileinput.input(file, inplace=1): |
43 |
> package = line.split(' ') |
44 |
> if len(line.strip()) and not line.startswith('Found') and not |
45 |
> line[1].isdigit(): |
46 |
> try: |
47 |
> # Count a new package |
48 |
> p += 1 |
49 |
> # Write package name, since output |
50 |
> # is redirected to file, print is |
51 |
> # enough. We insert a space |
52 |
> # see the update function |
53 |
> print package[1] |
54 |
> except: |
55 |
> log.error('Couldn\'t write the reportfile. Aborting') |
56 |
> print ERROR |
57 |
> sys.exit(1) |
58 |
> # Open the packages file |
59 |
> mssg = open(file, 'r').read() |
60 |
> externalmail.send(_('Portage tree and eix database updated. There are') |
61 |
> + str(p) + _(' packages to update:\n\n') + mssg + _('\nGenerated by Gentoo |
62 |
> Universal Automatic Updater v.') + VERSION) |
63 |
> log.debug('Report made succesfully.') |
64 |
> print _('* Report sent by email.') |
65 |
> |
66 |
> |
67 |
> |