rpmmodule.so and python 2.0

Olaf Trygve Berglihn olafb+usenet at pvv.org
Thu Dec 14 11:34:45 CET 2000


I've compiled rpmmodule against the new python api. But when I try to
user the interface to the rpm database, I get the following error:

Python 2.0 (#1, Dec 13 2000, 12:05:47)
[GCC 2.95.2 19991024 (release)] on linux2
Type "copyright", "credits" or "license" for more information.
>>> import rpm
>>> db = rpm.opendb( 0, '/' )
cannot open file //var/lib/rpm/nameindex.rpm: Invalid argument
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
rpm.error
>>>


But if I rebuild the database, it works:

>>> rpm.rebuilddb( '/' )
cannot open file //var/lib/rpm/nameindex.rpm: Invalid argument
0
>>> db = rpm.opendb( 0, '/' )
>>> db.findbyname( 'bash' )
[3450392]
>>>


If I now exit to the shell:

$ rpm -q bash
cannot open file //var/lib/rpm/nameindex.rpm: Invalid argument
rpmQuery: rpmdbOpen() failed
$


But if I rebuild:

$ rpm --rebuilddb
cannot open file //var/lib/rpm/nameindex.rpm: Invalid argument
$ rpm -q bash
bash-2.03-11tr
$


Any suggetions why this is so, and how to fix it? I've recompiled the
rpmmodule against python 2.0 libraries.

Olaf
-- 
Olaf Trygve Berglihn <olafb+usenet at pvv.org>



More information about the Python-list mailing list