summaryrefslogtreecommitdiff
path: root/bootstrap
diff options
context:
space:
mode:
authorrillig <rillig>2005-05-25 07:06:54 +0000
committerrillig <rillig>2005-05-25 07:06:54 +0000
commit6cb4a17e55df9ff97d0f37890f95b7c433125d1f (patch)
tree7ef8d75e35333c6e766717e5f5a504a24f6c8c44 /bootstrap
parented6452c1dab94e6f037d2b866c997e27fb3c5058 (diff)
downloadpkgsrc-6cb4a17e55df9ff97d0f37890f95b7c433125d1f.tar.gz
Added a function get_optarg that avoids code duplication in the option
parsing code. For maximum portability it uses the expr(1) command instead of sed(1), the same way as it is done in the core of the latest GNU configure scripts.
Diffstat (limited to 'bootstrap')
-rwxr-xr-xbootstrap/bootstrap15
1 files changed, 10 insertions, 5 deletions
diff --git a/bootstrap/bootstrap b/bootstrap/bootstrap
index f989c101c0e..a2843ab8831 100755
--- a/bootstrap/bootstrap
+++ b/bootstrap/bootstrap
@@ -1,6 +1,6 @@
#! /bin/sh
-# $NetBSD: bootstrap,v 1.37 2005/05/14 02:12:48 rillig Exp $
+# $NetBSD: bootstrap,v 1.38 2005/05/25 07:06:54 rillig Exp $
#
#
# Copyright (c) 2001-2002 Alistair G. Crooks. All rights reserved.
@@ -225,21 +225,26 @@ copy_src()
$cpprog -R $_src/* $wrkdir/$_dst
}
+get_optarg()
+{
+ expr "x$1" : "x[^=]*=\\(.*\\)"
+}
+
build_start=`date`
echo_msg "bootstrap command: $0 $@"
echo_msg "bootstrap started: $build_start"
while [ $# -gt 0 ]; do
case $1 in
- --workdir=*) wrkdir=`echo x"$1" | sed 's,^[^=]*=,,'` ;;
+ --workdir=*) wrkdir=`get_optarg "$1"` ;;
--workdir) wrkdir="$2"; shift ;;
- --prefix=*) prefix=`echo x"$1" | sed 's,^[^=]*=,,'`;
+ --prefix=*) prefix=`get_optarg "$1"`;
sysconfdir=${prefix}/etc ;;
--prefix) prefix="$2"; shift;
sysconfdir=${prefix}/etc ;;
- --pkgdbdir=*) pkgdbdir=`echo x"$1" | sed 's,^[^=]*=,,'` ;;
+ --pkgdbdir=*) pkgdbdir=`get_optarg "$1"` ;;
--pkgdbdir) pkgdbdir="$2"; shift ;;
- --sysconfdir=*) sysconfdir=`echo x"$1" | sed 's,^[^=]*=,,'` ;;
+ --sysconfdir=*) sysconfdir=`get_optarg "$1"` ;;
--sysconfdir) sysconfdir="$2"; shift ;;
--ignore-case-check) ignorecasecheck=yes ;;
--ignore-user-check) ignoreusercheck=yes ;;