Re: Is there an easy way to get a simple dict of rpm attributes from xml metadata?

Brad Smith <[email protected]>
Newsgroups gmane.linux.rpm.metadata
Organization Red Hat
Message-ID <[email protected]>
On Sat, 2005-04-16 at 14:21, seth vidal wrote:
> sadly the metadata import routines there are a bit out of date.

Meaning I shouldn't expect any of that to work with an actual xml-ified
repo?

Am I right in thinking that the code you provided would expect to
receive urls from a yum.conf? I need to be able to pass a url (or file
descriptor) for primary.xml or repomd.xml and get back a hash. But hey,
if this is as close as I'm going to get, then I can import and tweak as
necessary. I would have messed around with the code and answered some of
these questions myself, but I'm having a bit of trouble getting it to
run...

> Well it depends on what you're trying to do but you could always just:

<code snipped>

What version of Yum should I be using for this? The version that comes
with FC2 doesn't seem to include a yum module, so I grabbed the 2.1.11
source rpm and copied the modules from it into site-packages. However,
the snippet you provided still didn't work (see below). The problems
persisted when I forced a proper installation of the binary rpm, just in
case I'd missed something (yes, I know this probably breaks package
installation, but for now I just wanted the modules in place). Here's
what happens:

Python 2.3.3 (#1, May  7 2004, 10:31:40)
[GCC 3.3.3 20040412 (Red Hat Linux 3.3.3-7)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import yum
>>> foo = yum.YumBase()
>>> foo.doConfigSetup()
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
AttributeError: YumBase instance has no attribute 'doConfigSetup'
>>> foo.doRepoSetup()
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
AttributeError: YumBase instance has no attribute 'doRepoSetup'
>>> foo.doSackSetup()
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/usr/lib/python2.3/site-packages/yum/__init__.py", line 84, in
doSackSetup
    self.log(3, 'Setting up Package Sacks')
AttributeError: YumBase instance has no attribute 'log'
>>>

Looking through the code in the srpm I can't see any definition for eg
doConfigSetup() in YumBase or Depsolve. I assume I have the wrong
version and/or it's some sort of dependency issue since I'm trying to do
it under FC2, but the system that tracker is hosted on is running
RH7.3(!!) and I don't have any control over that, so I'm going to have
to figure out which modules I need and copy them into the tracker
directory regardless. Any ideas?

Thanks again,
--Brad

_______________________________________________
Rpm-metadata mailing list
[email protected]
https://lists.dulug.duke.edu/mailman/listinfo/rpm-metadata
signature.asc (application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQBCYwz6Dvp49DvQ8kcRAuNaAJ9P3UNM0nb6PQT4/gnCvf0rw7/TogCfYBEt
bRGlPNfIHit7GBPgizBGMqA=
=hVw9
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.