summaryrefslogtreecommitdiff
path: root/pkgtools/rpm2pkg
diff options
context:
space:
mode:
authortron <tron>2010-09-05 00:24:30 +0000
committertron <tron>2010-09-05 00:24:30 +0000
commitcf279729ab4169ee8022383fc7085025ace97394 (patch)
tree155fd45a04a008549cd5801bead3693d69a2c6a1 /pkgtools/rpm2pkg
parent0c35f2bc79cbff342be4872063f848cde6b4228d (diff)
downloadpkgsrc-cf279729ab4169ee8022383fc7085025ace97394.tar.gz
Update "rpm2pkg" package to version 3.1.1:
- Fix start of "lzcat" if "LZCAT" is not defined as a full pathname. - Handle short reads on the pipe to "lzcat".
Diffstat (limited to 'pkgtools/rpm2pkg')
-rw-r--r--pkgtools/rpm2pkg/Makefile4
-rw-r--r--pkgtools/rpm2pkg/files/rpm2pkg.c20
2 files changed, 19 insertions, 5 deletions
diff --git a/pkgtools/rpm2pkg/Makefile b/pkgtools/rpm2pkg/Makefile
index e94cf323482..4afd9b52fa3 100644
--- a/pkgtools/rpm2pkg/Makefile
+++ b/pkgtools/rpm2pkg/Makefile
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.47 2010/09/04 19:23:00 tron Exp $
+# $NetBSD: Makefile,v 1.48 2010/09/05 00:24:30 tron Exp $
-DISTNAME= rpm2pkg-3.1
+DISTNAME= rpm2pkg-3.1.1
CATEGORIES= pkgtools
MASTER_SITES= # empty
DISTFILES= # empty
diff --git a/pkgtools/rpm2pkg/files/rpm2pkg.c b/pkgtools/rpm2pkg/files/rpm2pkg.c
index fa729331671..223d4a58898 100644
--- a/pkgtools/rpm2pkg/files/rpm2pkg.c
+++ b/pkgtools/rpm2pkg/files/rpm2pkg.c
@@ -1,4 +1,4 @@
-/* $NetBSD: rpm2pkg.c,v 1.12 2010/09/04 19:23:00 tron Exp $ */
+/* $NetBSD: rpm2pkg.c,v 1.13 2010/09/05 00:24:30 tron Exp $ */
/*-
* Copyright (c) 2001-2010 The NetBSD Foundation, Inc.
@@ -332,7 +332,7 @@ Open(int fd)
(void)close(fd);
(void)close(pfds[1]);
- (void)execl(LZCAT, LZCAT, "-f", NULL);
+ (void)execlp(LZCAT, LZCAT, "-f", NULL);
exit(EXIT_FAILURE);
default:
@@ -360,7 +360,21 @@ Read(FileHandle *fh, void *buffer, size_t length)
} else if (fh->fh_GZFile != NULL) {
bytes = gzread(fh->fh_GZFile, buffer, length);
} else if (fh->fh_Pipe >= 0) {
- bytes = read(fh->fh_Pipe, buffer, length);
+ bytes = 0;
+ while (length > 0) {
+ ssize_t chunk = read(fh->fh_Pipe, buffer, length);
+ if (chunk < 0) {
+ bytes = -1;
+ break;
+ } else if (chunk == 0) {
+ break;
+ }
+
+ buffer += chunk;
+ length -= chunk;
+
+ bytes += chunk;
+ }
} else {
bytes = -1;
}