From cf279729ab4169ee8022383fc7085025ace97394 Mon Sep 17 00:00:00 2001 From: tron Date: Sun, 5 Sep 2010 00:24:30 +0000 Subject: 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". --- pkgtools/rpm2pkg/Makefile | 4 ++-- pkgtools/rpm2pkg/files/rpm2pkg.c | 20 +++++++++++++++++--- 2 files changed, 19 insertions(+), 5 deletions(-) (limited to 'pkgtools/rpm2pkg') 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; } -- cgit v1.2.3