aboutsummaryrefslogtreecommitdiffstats
path: root/parsehdlist.c
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2001-04-03 12:50:27 +0000
committerFrancois Pons <fpons@mandriva.com>2001-04-03 12:50:27 +0000
commitdb2545e316e7d1293241a5cd94668234aa1afd51 (patch)
tree0c7aec8fb590a2b2fd3b24c134baa50835025486 /parsehdlist.c
parent0c9ffe1302eb0ef019c674e9700de26201b5e5ae (diff)
downloadrpmtools-db2545e316e7d1293241a5cd94668234aa1afd51.tar
rpmtools-db2545e316e7d1293241a5cd94668234aa1afd51.tar.gz
rpmtools-db2545e316e7d1293241a5cd94668234aa1afd51.tar.bz2
rpmtools-db2545e316e7d1293241a5cd94668234aa1afd51.tar.xz
rpmtools-db2545e316e7d1293241a5cd94668234aa1afd51.zip
*** empty log message ***
Diffstat (limited to 'parsehdlist.c')
-rw-r--r--parsehdlist.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/parsehdlist.c b/parsehdlist.c
index cb63c88..d92704d 100644
--- a/parsehdlist.c
+++ b/parsehdlist.c
@@ -306,14 +306,18 @@ int main(int argc, char **argv)
fprintf(stderr, "packdrake: unable to create pipe for packdrake\n");
}
}
- if (fdFileno(fd) < 0) fprintf(stderr, "parsehdlist: cannot open file %s\n", argv[i]);
- else {
+ if (fdFileno(fd) < 0) {
+ fprintf(stderr, "parsehdlist: cannot open file %s\n", argv[i]);
+ exit(1);
+ } else {
Header header;
+ long count = 0;
/* fprintf(stderr, "parsehdlist: reading %s\n", argv[i]); */
while ((header=headerRead(fd, HEADER_MAGIC_YES))) {
char *name = get_name(header, RPMTAG_NAME);
+ ++count;
if (interactive_mode) {
headers[count_headers].name = name;
headers[count_headers].hash_name = hash(name);
@@ -343,6 +347,7 @@ int main(int argc, char **argv)
headerFree(header);
}
}
+ if (!count) exit(3); /* no package is an error */
}
fdClose(fd);
if (pid) {