El 18/03/2010, a las 18:29, Lluís Forns escribió:
> hace un año que no trabajo con gentoo, pero en el sistema había un
> fichero llamado "world" con todos los paquetes instalados
> especificamente (no contiene las dependencias instaladas).
>
Cierto, creo que se encuentra en el directorio de portage, en /usr/
portage.
De todas formas, se puede obtener un listado exacto de todas los
programas instalados parseando la salida del programa "eix". Hace
algunos meses yo hice un pequeño parser para obtener los programas
que necesitaban actualizarse (world no es muy fiable a veces). El
código es este, está en python, con unas pequeñas modificaciones se
podría obtener un listado legible de todos los programas instalados y
sus respectivas versiones. Si a alguien le interesa el programa ese,
se llama GUAU y está en http://halcyon.zapto.org/projects/guau aunque
no está terminado, tiene un par de bugs.
def make_report(file):
from components import eix
# Open and save the eix result in the file specified in the
# configuration
# NOTE: We must sync eix first to get an updated list
eix.sync()
eix = Popen('eix -uc >>' + file, shell=True)
# Wait for the process to end
eix.wait()
# Start counting packages
p = 0
print _('* Making update report...')
# We iterate over the object
for line in fileinput.input(file, inplace=1):
package = line.split(' ')
if len(line.strip()) and not line.startswith('Found') and
not line[1].isdigit():
try:
# Count a new package
p += 1
# Write package name, since output
# is redirected to file, print is
# enough. We insert a space
# see the update function
print package[1]
except:
log.error('Couldn\'t write the reportfile. Aborting')
print ERROR
sys.exit(1)
# Open the packages file
mssg = open(file, 'r').read()
externalmail.send(_('Portage tree and eix database updated.
There are') + str(p) + _(' packages to update:\n\n') + mssg + _
('\nGenerated by Gentoo Universal Automatic Updater v.') + VERSION)
log.debug('Report made succesfully.')
print _('* Report sent by email.')
|