diff options
author | ramon <ramongomez@us.es> | 2015-01-27 10:28:45 +0000 |
---|---|---|
committer | ramon <ramongomez@us.es> | 2015-01-27 10:28:45 +0000 |
commit | 246bf13b092aa146e8687a8104bfee17e804e892 (patch) | |
tree | 3bce6d73561ead399be8f833b8cf20fcbbca0fcb /client/engine/Inventory.lib | |
parent | 3f78765f2c9c29b650ae0ea915b7e92ceea9135e (diff) |
#677: Acceder a la BD de RPM para obtener paquetes instalados, si el comando {{{rpm}}} no está instalado en el cliente.
git-svn-id: https://opengnsys.es/svn/branches/version1.0@4483 a21b9725-9963-47de-94b9-378ad31fedc9
Diffstat (limited to 'client/engine/Inventory.lib')
-rwxr-xr-x | client/engine/Inventory.lib | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/client/engine/Inventory.lib b/client/engine/Inventory.lib index 0f26f15c..ac6edf0e 100755 --- a/client/engine/Inventory.lib +++ b/client/engine/Inventory.lib @@ -319,9 +319,13 @@ case "$TYPE" in awk '$1!~/-devel$/ {sub(/-.*$/,"",$2); print $0}' | sort | uniq rm -f ${RPMDIR}/__db.* else - # FIXME Sólo 32 bits - chroot $MNTDIR /bin/rpm -qa --qf "%{NAME} %{VERSION}\n" | \ - awk '$1!~/-devel$/ {sub(/-.*$/,"",$2); print $0}' | sort | uniq + # Obtener el nombre de cada paquete en la BD de RPM. + python <<<" +import re; +import bsddb; +db=bsddb.hashopen('$RPMDIR/Name','r'); +for k in db.keys(): + print re.sub('-debel$','',k);" | sort | uniq fi fi # Procesar paquetes pacman. |