Module Name: src
Committed By: apb
Date: Mon Nov 10 09:59:33 UTC 2014
Modified Files:
src: build.sh
Log Message:
Replace '.' and '-' in ${op} with '_', before setting d_${op}=true.
Also remove or simplify older code that did the same thing in a
different way. The old code handled most cases, but did not change
op=kernel.gdb to op=kernel_gdb.
To generate a diff of this commit:
cvs rdiff -u -r1.300 -r1.301 src/build.sh
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/build.sh
diff -u src/build.sh:1.300 src/build.sh:1.301
--- src/build.sh:1.300 Thu Nov 6 02:02:48 2014
+++ src/build.sh Mon Nov 10 09:59:33 2014
@@ -1,5 +1,5 @@
#! /usr/bin/env sh
-# $NetBSD: build.sh,v 1.300 2014/11/06 02:02:48 uebayasi Exp $
+# $NetBSD: build.sh,v 1.301 2014/11/10 09:59:33 apb Exp $
#
# Copyright (c) 2001-2011 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -1319,25 +1319,6 @@ parseoptions()
exit $?
;;
- makewrapper|cleandir|obj|tools|build|distribution|release|sets|sourcesets|syspkgs|params)
- ;;
-
- iso-image)
- op=iso_image # used as part of a variable name
- ;;
-
- iso-image-source)
- op=iso_image_source # used as part of a variable name
- ;;
-
- live-image)
- op=live_image # used as part of a variable name
- ;;
-
- install-image)
- op=install_image # used as part of a variable name
- ;;
-
kernel=*|releasekernel=*|kernel.gdb=*)
arg=${op#*=}
op=${op%%=*}
@@ -1345,10 +1326,6 @@ parseoptions()
bomb "Must supply a kernel name with \`${op}=...'"
;;
- kernels)
- op=kernels
- ;;
-
disk-image=*)
arg=${op#*=}
op=disk_image
@@ -1357,10 +1334,6 @@ parseoptions()
;;
- modules)
- op=modules
- ;;
-
install=*|installmodules=*)
arg=${op#*=}
op=${op%%=*}
@@ -1368,8 +1341,25 @@ parseoptions()
bomb "Must supply a directory with \`install=...'"
;;
- rump|rumptest)
- op=${op}
+ build|\
+ cleandir|\
+ distribution|\
+ install-image|\
+ iso-image-source|\
+ iso-image|\
+ kernels|\
+ live-image|\
+ makewrapper|\
+ modules|\
+ obj|\
+ params|\
+ release|\
+ rump|\
+ rumptest|\
+ sets|\
+ sourcesets|\
+ syspkgs|\
+ tools)
;;
*)
@@ -1377,6 +1367,9 @@ parseoptions()
;;
esac
+ # ${op} may contain chars that are not allowed in variable
+ # names. Replace them with '_' before setting do_${op}.
+ op="$( echo "$op" | tr -s '.-' '__')"
eval do_${op}=true
done
[ -n "${operations}" ] || usage "Missing operation to perform."
@@ -1876,7 +1869,7 @@ createmakewrapper()
eval cat <<EOF ${makewrapout}
#! ${HOST_SH}
# Set proper variables to allow easy "make" building of a NetBSD subtree.
-# Generated from: \$NetBSD: build.sh,v 1.300 2014/11/06 02:02:48 uebayasi Exp $
+# Generated from: \$NetBSD: build.sh,v 1.301 2014/11/10 09:59:33 apb Exp $
# with these arguments: ${_args}
#