From 0e00ea5201dc638344db1c2200070cda150a4d40 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Fri, 31 Mar 2000 14:41:03 +0000 Subject: no_comment --- gendepslist2.cc | 2 +- hdlist2groups.cc | 44 ++++++++++++++++++++++++++++++++++++++++++++ rpmtools.spec | 5 ++++- 3 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 hdlist2groups.cc diff --git a/gendepslist2.cc b/gendepslist2.cc index 9709991..dee1a65 100644 --- a/gendepslist2.cc +++ b/gendepslist2.cc @@ -164,7 +164,6 @@ void getRequires(FD_t fd, int current_hdlist) { hdlist2names[current_hdlist].insert(name); sizes[name] = get_int(header, RPMTAG_SIZE); - if (in(s_name, provided_by)) provided_by[s_name].push_back(name); for (ITv p = l.begin(); p != l.end(); p++) { ((*p)[0] == '/' ? frequires : requires)[name].push_back(*p); ((*p)[0] == '/' ? all_frequires : all_requires).insert(*p); @@ -182,6 +181,7 @@ void getProvides(FD_t fd, int current_hdlist) { string s_name = get_name(header, RPMTAG_NAME); string name = s_name + "-" + get_name(header, RPMTAG_VERSION) + "-" + get_name(header, RPMTAG_RELEASE); + if (in(s_name, provided_by)) provided_by[s_name].push_back(name); vector provides = get_info(header, RPMTAG_PROVIDES); for (ITv p = provides.begin(); p != provides.end(); p++) diff --git a/hdlist2groups.cc b/hdlist2groups.cc new file mode 100644 index 0000000..55e53ac --- /dev/null +++ b/hdlist2groups.cc @@ -0,0 +1,44 @@ +#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: hdlist2groups []\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 << "hdlist2groups: cannot open file " << argv[i] << "\n"; + else { + Header header; + while ((header=headerRead(fd, HEADER_MAGIC_YES))) { + printf("%s:%s\n", + get_name(header, RPMTAG_NAME), + get_name(header, RPMTAG_GROUP)); + } + } + fdClose(fd); + } +} diff --git a/rpmtools.spec b/rpmtools.spec index 1b422e4..e55df9a 100644 --- a/rpmtools.spec +++ b/rpmtools.spec @@ -1,5 +1,5 @@ %define name rpmtools -%define release 14mdk +%define release 15mdk # do not modify here, see Makefile in the CVS %define version 1.1 @@ -58,6 +58,9 @@ rm -rf $RPM_BUILD_ROOT /usr/bin/genfilelist %changelog +* Tue Mar 28 2000 Pixel 1.1-15mdk +- fix silly bug + * Fri Mar 31 2000 François PONS 1.1-14mdk - add genfilelist -- cgit v1.2.1