From 9be8d3b3407562628b07f0b2c27b673ef208f225 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Mon, 5 Aug 2002 19:04:10 +0000 Subject: - remove obsolete stuff - move packdrake.pm in its own directory to make MakeMaker happy --- hdlist2files.cc | 65 --------------------------------------------------------- 1 file changed, 65 deletions(-) delete mode 100644 hdlist2files.cc (limited to 'hdlist2files.cc') diff --git a/hdlist2files.cc b/hdlist2files.cc deleted file mode 100644 index c439f2f..0000000 --- a/hdlist2files.cc +++ /dev/null @@ -1,65 +0,0 @@ -#include -#include -#include -#include -#include -#include - - -char *get_name(Header header, int_32 tag) { - int_32 type, count; - char *name; - - headerGetEntry(header, tag, &type, (void **) &name, &count); - return name; -} - -int get_int(Header header, int_32 tag) { - int_32 type, count; - int *i; - - headerGetEntry(header, tag, &type, (void **) &i, &count); - return *i; -} - -int main(int argc, char **argv) -{ - if (argc <= 1) { - cerr << "usage: hdlist2files []\n"; - exit(1); - } - for (int i = 1; i < argc; i++) { - FD_t fd = strcmp(argv[i], "-") == 0 ? fdDup(STDIN_FILENO) : fdOpen(argv[i], O_RDONLY, 0); - if (fdFileno(fd) < 0) cerr << "rpmpackdeps: cannot open file " << argv[i] << "\n"; - else { - 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]); - } - - 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%s\n", name, dirNames[dirIndexes[i]], baseNames[i]); - } - } - } - } - fdClose(fd); - } -} -- cgit v1.2.1