From baa561791594af0e0c98cfc1c9f77fc450db4149 Mon Sep 17 00:00:00 2001 From: Frederic Lepied Date: Fri, 18 Feb 2000 17:21:24 +0000 Subject: * new way to retrieve file names in 3.0.4. --- hdlist2files.cc | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'hdlist2files.cc') diff --git a/hdlist2files.cc b/hdlist2files.cc index 1654886..fe905b9 100644 --- a/hdlist2files.cc +++ b/hdlist2files.cc @@ -35,10 +35,29 @@ int main(int argc, char **argv) Header header; int_32 type, count; char **list; + char ** baseNames, ** dirNames; + int_32 * dirIndexes; + while ((header=headerRead(fd, HEADER_MAGIC_YES))) { char *name = get_name(header, RPMTAG_NAME); + headerGetEntry(header, RPMTAG_OLDFILENAMES, &type, (void **) &list, &count); - if (list) for (i = 0; i < count; i++) printf("%s:%s\n", name, list[i]); + + if (list) { + for (i = 0; i < count; i++) printf("%s:%s\n", name, list[i]); + } + + headerGetEntry(header, RPMTAG_BASENAMES, &type, (void **) &baseNames, + &count); + headerGetEntry(header, RPMTAG_DIRINDEXES, &type, (void **) &dirIndexes, + NULL); + headerGetEntry(header, RPMTAG_DIRNAMES, &type, (void **) &dirNames, NULL); + + if (baseNames && dirNames && dirIndexes) { + for(i = 0; i < count; i++) { + printf("%s:%s\n", name, dirNames[dirIndexes[i]], baseNames[i]); + } + } } } fdClose(fd); -- cgit v1.2.1