Re: rpmlib functions problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Apr 25, 2006, at 5:54 PM, Marcin Krzysztof Porwit wrote:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I'm playing around with the functions exposed via librpm. Using
Chapter 16 of the Red Hat RPM Guide as a crutch, I'm trying to read
the header information from a package. I'm pretty sure that I coded
it up correctly, but I get rather odd results. My code calls
headerDump() first, and then headerNEVRE(), and attempts to print out
the results. Here's the output that I get:
rhel4-devel[RPMs]% ~/rpmheader zsh-4.2.0-3.i386.rpm
Entry count: 7

CT TAG TYPE OFSET COUNT Entry : 000 (62)(unknown) BIN 0xffffff90 00000016 Entry : 001 (267)(unknown) BIN 0xffffff90 00000065 Entry : 002 (269)(unknown) STRING 0xffffff90 00000001 Entry : 003 (1000)(unknown) INT32 0xffffff90 00000001 Entry : 004 (1004)(unknown) BIN 0xffffff90 00000016 Entry : 005 (1005)(unknown) BIN 0xffffff90 00000065 Entry : 006 (1007)(unknown) INT32 0xffffff90 00000001
Name is [(null)]
Epoch is []
Version is [(null)]
Relase is [(null)]
Arch is [(null)]

What's bizarre here is that the RPMTAG definitions don't seem to line
up with the tag types. RPMTAG_NAME is defined as 1000, but is stored
as an INT32 type. I'm testing this on RPMs that ship with RHEL4ES, so
I'm assuming those were created properly, with all the fields populated.
The platform ships with rpm-devel v4.3...

You're looking at a signature header, not the package metadata header.

Yes it was very stupid to define 2 tags that map to the number 1000. I dinna do it ...

There's a different table that needs to be passed to map the numbers to strings if you want to look at signature headers. It's hardly worth the bother, headerDump()
is really ancient and rather useless.

You might want to look at tools/rpmtool.c for various ways of slicing/ dicing headers out of rpm packages. The code is mostly a prototype so I can see what problems there are in using the rpmlib API, but was working when I last looked abt 2 years ago. And the code
is more recent than "The Red Hat RPM Guide" as well.

HTH

73 de Jeff

_______________________________________________
Rpm-list mailing list
Rpm-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/rpm-list

[Index of Archives]     [RPM Ecosystem]     [Linux Kernel]     [Red Hat Install]     [PAM]     [Red Hat Watch]     [Red Hat Development]     [Red Hat]     [Gimp]     [Yosemite News]     [IETF Discussion]

  Powered by Linux