summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2006-01-21 15:33:05 +0000
committerjlam <jlam@pkgsrc.org>2006-01-21 15:33:05 +0000
commite5ae84bc32353a368f602c86b4e1ffdc4fbac713 (patch)
tree3a27ab628ec19b7aae0bf4ccd89cbba004421c81 /mk
parent91a276733eebc876abc3009a2de63d8560591cc0 (diff)
downloadpkgsrc-e5ae84bc32353a368f602c86b4e1ffdc4fbac713.tar.gz
Fix up the comments, and add a fall-through for unrecognized archive
formats.
Diffstat (limited to 'mk')
-rwxr-xr-xmk/scripts/extract15
1 files changed, 10 insertions, 5 deletions
diff --git a/mk/scripts/extract b/mk/scripts/extract
index 8dd4f891e38..9cddbaadd4f 100755
--- a/mk/scripts/extract
+++ b/mk/scripts/extract
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# $NetBSD: extract,v 1.8 2006/01/21 14:31:56 jlam Exp $
+# $NetBSD: extract,v 1.9 2006/01/21 15:33:05 jlam Exp $
#
# Copyright (c) 2006 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -150,9 +150,7 @@ case "$distfile" in
*.Z) decompress_cat="${GZCAT}" ;;
esac
-# Main extraction section -- this maps the suffix on the specified distfile
-# the correct tool and extraction procedure to perform the extraction.
-#
+# Derive the format of the archive based on the file extension.
case "$distfile" in
*.tar.gz|*.tgz|*_tar.gz|*.tar.bz2|*.tbz|*.tbz2|*.tar.Z|*.tar)
_format=tar ;;
@@ -166,9 +164,11 @@ case "$distfile" in
*.bin) _format=jre-bin ;;
*) _format=none ;;
esac
-
${TEST} -n "$format" || format="$_format"
+# Use the correct tool and extraction procedure to perform the extraction
+# based on the archive format.
+#
case "$format" in
tar)
case "$extract_using" in
@@ -243,4 +243,9 @@ none)
# By default, copy the distfile over to the current working directory.
${CP} "$distfile" .
;;
+
+*)
+ ${ECHO} 1>&2 "$self: archive format not recognized -- $format"
+ exit 1
+ ;;
esac