From 495ea6f630fdead3a6fbb47b794ca97d0afcd75f Mon Sep 17 00:00:00 2001 From: jlam Date: Sat, 21 Jan 2006 18:21:08 +0000 Subject: Fix the case where -X excludefile is used so that we don't error out trying to remove "". --- mk/scripts/extract | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'mk/scripts/extract') diff --git a/mk/scripts/extract b/mk/scripts/extract index ff7411b373f..578cc268f51 100755 --- a/mk/scripts/extract +++ b/mk/scripts/extract @@ -1,6 +1,6 @@ #!/bin/sh # -# $NetBSD: extract,v 1.12 2006/01/21 18:01:26 jlam Exp $ +# $NetBSD: extract,v 1.13 2006/01/21 18:21:08 jlam Exp $ # # Copyright (c) 2006 The NetBSD Foundation, Inc. # All rights reserved. @@ -113,6 +113,7 @@ usage() { ${ECHO} 1>&2 "usage: $self [-d dir] [-f format] [-t tarprog] [-X excludefile | -x] distfile [file ...]" } +exitcode=0 decompress_cat="${CAT}" exclude=no exclude_file= @@ -218,8 +219,9 @@ tar) set -- dummy; shift fi $decompress_cat "$distfile" | - $tarprog ${EXTRACT_OPTS_TAR} $exclude_flag -xf - "$@" \ - && ${RM} -f $tmpfile + $tarprog ${EXTRACT_OPTS_TAR} $exclude_flag -xf - "$@" + exitcode=$? + ${TEST} "$exclude" = "no" || ${RM} -f "$tmpfile" ;; *) ${ECHO} 1>&2 "$self: unknown tar program: $extract_using" @@ -273,3 +275,5 @@ none) exit 1 ;; esac + +exit $exitcode -- cgit v1.2.3