summaryrefslogtreecommitdiff
path: root/mk/scripts/extract
diff options
context:
space:
mode:
Diffstat (limited to 'mk/scripts/extract')
-rwxr-xr-xmk/scripts/extract10
1 files changed, 7 insertions, 3 deletions
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