Re: os.open knows not %_topdir

Jeff Johnson <[email protected]> Wed, 15 Oct 2003 11:34:25 -0400
Newsgroups gmane.linux.redhat.rpm.python
Message-ID <[email protected]>
> 1) Following does not work for me:(
>
> rpm.addMacro("_topdir","/home/pauln/rpm")
> ... (set up ts)
> fd = os.open("foo.src.rpm",os.O_RDONLY)
> ... (read hdr, addInstall, run)

And why should the above work?

OTOH, rpmio desperately needs intelligent binding so that
a FD_t (which is nothing more than a FILE **, and even
the extra indirection could be removed on linux) could
be greased through anything/everything in python that
already knows of a FILE * object.

Well, that almost works, ther's need to be collusion
by overloading the os.open() method to do a macro expansion
on 1st arg before passing to the original os.open() method.

> 2) Specfile queries - which are a hack, it'd be nice to be able to use
> them from python (or I haven't been trying hard enough). Although if
> src.rpms are going away (or surplus to requirements) an equivalent of
> rpm --requires -q foo.src.rpm would be nice from a specfile

We agree "hack".

What's needed here is embedding the rpm CLI, so that rpmlib could
be used just like invoking rpm, w/o the overhead of the exec.

A post processing filter applied to the output buffer to
convert to pretty little tuples of tuples of dictionaries of ...
wouldn't be too hard either.

> 3) A common library for some things would be nice, not re-inventing the
> wheel

Phew, another request for round wheels in python, not rpmlib, implementations. ;-)

OTOH, there's gobs of fucntionality that might be intelligently abstracted and
pushed into rpm-python. I know of several cases, as I get to listen to identical
"Arghs!" from each and evey rpm-python user who re-discovers missing deficiencies
in rpm-python.

73 de Jeff