On Sep 19, 2006, at 4:16 PM, Michael Jennings wrote:
On Tuesday, 19 September 2006, at 15:13:56 (-0500), R. Tyler Ballance wrote:NEVRA, now I get it :) That is what I was looking for. However, your snippets combined with Jeff's snippets don't work:I think you forgot: ret = rpmReadConfigFiles(NULL, NULL); if (ret != RPMRC_OK) { print_error("Unable to read RPM configuration.\n"); }
Yep.Alternatively, all that needs setting is %_dbpath, addMacro() can/ will do that (IIRC).
Hints:1) You can skip headerFreeData() for RPM_STRING_TYPE (and all the integer types).
2) headerDump is annoying and painful, try headerSprintf() instead. If you *really*
want a full dump, then using this query format
const char * qfmt = "[%{*:xml}\n]";
is perhaps more readable than headerDump() spew.
And YAML (for rpm later than 4.4.2) is even more pleasant on the eyes
const char * qfmt = "[%{*:yaml}\n]";
FWIW, if all you're doing is diffs of metadata content, python or perl
is even easier to code up than C.
hth
73 de Jeff