aboutsummaryrefslogtreecommitdiffstats
path: root/parsehdlist.c
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2000-11-20 17:15:11 +0000
committerFrancois Pons <fpons@mandriva.com>2000-11-20 17:15:11 +0000
commite1faf7c7618f84e8cbd8b1c8ec9cd205df318f02 (patch)
tree5ae78eded75b8f104cbea87e76c5151b6912c25a /parsehdlist.c
parent52e953b423ceb14f7001b2cd1e9760f8ea6760a0 (diff)
downloadrpmtools-e1faf7c7618f84e8cbd8b1c8ec9cd205df318f02.tar
rpmtools-e1faf7c7618f84e8cbd8b1c8ec9cd205df318f02.tar.gz
rpmtools-e1faf7c7618f84e8cbd8b1c8ec9cd205df318f02.tar.bz2
rpmtools-e1faf7c7618f84e8cbd8b1c8ec9cd205df318f02.tar.xz
rpmtools-e1faf7c7618f84e8cbd8b1c8ec9cd205df318f02.zip
fixed big bug for execvl (thanks to francis)
Diffstat (limited to 'parsehdlist.c')
-rw-r--r--parsehdlist.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/parsehdlist.c b/parsehdlist.c
index 96b144c..7dc3296 100644
--- a/parsehdlist.c
+++ b/parsehdlist.c
@@ -2,6 +2,7 @@
#include <sys/wait.h>
#include <sys/stat.h>
#include <fcntl.h>
+#include <errno.h>
#include <rpm/rpmlib.h>
#include <rpm/header.h>
#include <stdio.h>
@@ -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", "");