diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2002-08-05 19:04:10 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2002-08-05 19:04:10 +0000 |
commit | 9be8d3b3407562628b07f0b2c27b673ef208f225 (patch) | |
tree | 90b9744ee4fc8b953fc120ff38671d44c35aa35f /hdlist2prereq.cc | |
parent | eac9649e7ca04a812481abb66c922c2345ef9207 (diff) | |
download | rpmtools-9be8d3b3407562628b07f0b2c27b673ef208f225.tar rpmtools-9be8d3b3407562628b07f0b2c27b673ef208f225.tar.gz rpmtools-9be8d3b3407562628b07f0b2c27b673ef208f225.tar.bz2 rpmtools-9be8d3b3407562628b07f0b2c27b673ef208f225.tar.xz rpmtools-9be8d3b3407562628b07f0b2c27b673ef208f225.zip |
- remove obsolete stuff4.5.2
- move packdrake.pm in its own directory to make MakeMaker happy
Diffstat (limited to 'hdlist2prereq.cc')
-rw-r--r-- | hdlist2prereq.cc | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/hdlist2prereq.cc b/hdlist2prereq.cc deleted file mode 100644 index 68434f0..0000000 --- a/hdlist2prereq.cc +++ /dev/null @@ -1,53 +0,0 @@ -#include <sys/types.h> -#include <sys/stat.h> -#include <fcntl.h> -#include <rpm/rpmlib.h> -#include <rpm/header.h> -#include <iostream> - - -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: hdlist2prereq <hdlist> [<hdlists...>]\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; - int *flags; - - while ((header=headerRead(fd, HEADER_MAGIC_YES))) { - char *name = get_name(header, RPMTAG_NAME); - - headerGetEntry(header, RPMTAG_REQUIRENAME, &type, (void **) &list, &count); - headerGetEntry(header, RPMTAG_REQUIREFLAGS, &type, (void **) &flags, &count); - - if (flags && list) - for(i = 0; i < count; i++) - if (flags[i] & RPMSENSE_PREREQ) printf("%s:%s\n", name, list[i]); - } - } - fdClose(fd); - } -} |