From e1faf7c7618f84e8cbd8b1c8ec9cd205df318f02 Mon Sep 17 00:00:00 2001 From: Francois Pons Date: Mon, 20 Nov 2000 17:15:11 +0000 Subject: fixed big bug for execvl (thanks to francis) --- Makefile | 2 +- parsehdlist.c | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 5032bf4..6954d3a 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ FROMCC_STATIC = $(FROMCC:%=%_static) ALL = $(FROMC) $(FROMCC) ALL_STATIC = $(FROMC_STATIC) $(FROMCC_STATIC) CFLAGS = -Wall -g -LIBRPM = -lrpm -lrpmio -ldb1 -lz -lbz2 -I/usr/include/rpm -lpopt +LIBRPM = -lrpm -lrpmio -lz -lbz2 -I/usr/include/rpm -lpopt all: $(ALL) diff --git a/parsehdlist.c b/parsehdlist.c index 96b144c..7dc3296 100644 --- a/parsehdlist.c +++ b/parsehdlist.c @@ -2,6 +2,7 @@ #include #include #include +#include #include #include #include @@ -208,9 +209,12 @@ int main(int argc, char **argv) close(fdno[1]); } else { dup2(fdno[1], STDOUT_FILENO); - execl("/usr/bin/packdrake", "/usr/bin/packdrake", "-c", argv[i]); + execl("/usr/bin/packdrake", "/usr/bin/packdrake", "-c", argv[i], NULL); + perror("packdrake: unable to run packdrake"); exit(2); } + } else { + fprintf(stderr, "packdrake: unable to create pipe for packdrake\n"); } } if (fdFileno(fd) < 0) fprintf(stderr, "parsehdlist: cannot open file %s\n", argv[i]); @@ -272,6 +276,7 @@ int main(int argc, char **argv) hash_in_name = hash(in_name); for (i = 0; i < count_headers; ++i) { if (headers[i].hash_name == hash_in_name && !strcmp(headers[i].name, in_name)) { + printf("found %s:%s\n", in_name, in_tag); if (!strncmp(in_tag, "provides", 8)) print_list(headers[i].header, RPMTAG_PROVIDENAME, "%2$s\n", ""); else if (!strncmp(in_tag, "requires", 8)) print_list_flags(headers[i].header, RPMTAG_REQUIRENAME, RPMTAG_REQUIREFLAGS, RPMTAG_REQUIREVERSION,"%2$s", ""); -- cgit v1.2.1