Mageia Bugzilla – Attachment 1181 Details for
Bug 1962
genhdlist2 doesn't reuse most of the existing hdlist
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
New Account
|
Forgot Password
test case from Panu Matilainen
rpm-header-test-case.c (text/plain), 498 bytes, created by
Thierry Vignaud
on 2011-12-06 16:17:08 CET
(
hide
)
Description:
test case from Panu Matilainen
Filename:
MIME Type:
Creator:
Thierry Vignaud
Created:
2011-12-06 16:17:08 CET
Size:
498 bytes
patch
obsolete
>#include <rpm/rpmlib.h> >#include <rpm/rpmio.h> >#include <rpm/header.h> > >int main(int argc, char *argv[]) >{ > FD_t fd; > Header h; > int i = 0; > rpmReadConfigFiles(NULL, NULL); > > fd = Fopen(argv[1], "r.gzdio"); > while ((h = headerRead(fd, HEADER_MAGIC_YES)) != NULL) { > /* do something with the header... */ > char *nevra = headerGetAsString(h, RPMTAG_NEVRA); > printf("%s\n", nevra); > i++; > free(nevra); > } > printf("read %d headers\n", i); > Fclose(fd); >}
#include <rpm/rpmlib.h> #include <rpm/rpmio.h> #include <rpm/header.h> int main(int argc, char *argv[]) { FD_t fd; Header h; int i = 0; rpmReadConfigFiles(NULL, NULL); fd = Fopen(argv[1], "r.gzdio"); while ((h = headerRead(fd, HEADER_MAGIC_YES)) != NULL) { /* do something with the header... */ char *nevra = headerGetAsString(h, RPMTAG_NEVRA); printf("%s\n", nevra); i++; free(nevra); } printf("read %d headers\n", i); Fclose(fd); }
View Attachment As Raw
Actions:
View
Attachments on
bug 1962
: 1181 |
1182
|
1183
|
1184