aboutsummaryrefslogtreecommitdiffstats
path: root/hdlist2files.cc
diff options
context:
space:
mode:
authorFrederic Lepied <flepied@mandriva.com>2000-02-18 17:21:24 +0000
committerFrederic Lepied <flepied@mandriva.com>2000-02-18 17:21:24 +0000
commitbaa561791594af0e0c98cfc1c9f77fc450db4149 (patch)
tree75c23aff57743a4971613bde748a7396106166a4 /hdlist2files.cc
parent1ab1ac710b440b016419cf06e9f18a2df979a24e (diff)
downloadrpmtools-baa561791594af0e0c98cfc1c9f77fc450db4149.tar
rpmtools-baa561791594af0e0c98cfc1c9f77fc450db4149.tar.gz
rpmtools-baa561791594af0e0c98cfc1c9f77fc450db4149.tar.bz2
rpmtools-baa561791594af0e0c98cfc1c9f77fc450db4149.tar.xz
rpmtools-baa561791594af0e0c98cfc1c9f77fc450db4149.zip
* new way to retrieve file names in 3.0.4.
Diffstat (limited to 'hdlist2files.cc')
-rw-r--r--hdlist2files.cc21
1 files changed, 20 insertions, 1 deletions
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);