aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--parsehdlist.c9
-rw-r--r--rpmtools.pm5
-rw-r--r--rpmtools.spec6
3 files changed, 15 insertions, 5 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) {
diff --git a/rpmtools.pm b/rpmtools.pm
index 9e15baa..aa706c4 100644
--- a/rpmtools.pm
+++ b/rpmtools.pm
@@ -92,12 +92,13 @@ sub new {
#- read one or more hdlist files, use packdrake for decompression.
sub read_hdlists {
my ($params, @hdlists) = @_;
+ my @names;
local (*I, *O); pipe I, O;
if (my $pid = fork()) {
close O;
- rpmtools::_parse_(fileno *I, $params->{flags}, $params->{info}, $params->{provides});
+ push @names, rpmtools::_parse_(fileno *I, $params->{flags}, $params->{info}, $params->{provides});
close I;
waitpid $pid, 0;
@@ -111,7 +112,7 @@ sub read_hdlists {
close O;
exit 0;
}
- 1;
+ @names;
}
#- build an hdlist from a list of files.
diff --git a/rpmtools.spec b/rpmtools.spec
index 1134372..176959e 100644
--- a/rpmtools.spec
+++ b/rpmtools.spec
@@ -1,5 +1,5 @@
%define name rpmtools
-%define release 16mdk
+%define release 17mdk
# do not modify here, see Makefile in the CVS
%define version 2.3
@@ -51,6 +51,10 @@ rm -rf $RPM_BUILD_ROOT
%{_libdir}/perl5/man/*/*
%changelog
+* Tue Apr 3 2001 François Pons <fpons@mandrakesoft.com> 2.3-17mdk
+- fixed error code management for parsehdlist.
+- fixed read_hdlists return value.
+
* Mon Mar 26 2001 François Pons <fpons@mandrakesoft.com> 2.3-16mdk
- modified libtermcap to libtermcap2 for VIP.