pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/sysutils/mklivecd/files Extra bonus for 0.15.1: check ...
details: https://anonhg.NetBSD.org/pkgsrc/rev/f1ce0e42101a
branches: trunk
changeset: 527620:f1ce0e42101a
user: xtraeme <xtraeme%pkgsrc.org@localhost>
date: Wed Apr 11 14:22:26 2007 +0000
description:
Extra bonus for 0.15.1: check value in options accepting 'yes' or 'no'
values (case insensitive), show an error message if the value
is not accepted and exit.
diffstat:
sysutils/mklivecd/files/mklivecd.sh | 45 +++++++++++++++++++++++++++++++++---
1 files changed, 41 insertions(+), 4 deletions(-)
diffs (82 lines):
diff -r 5b6d6ef430a2 -r f1ce0e42101a sysutils/mklivecd/files/mklivecd.sh
--- a/sysutils/mklivecd/files/mklivecd.sh Wed Apr 11 13:31:52 2007 +0000
+++ b/sysutils/mklivecd/files/mklivecd.sh Wed Apr 11 14:22:26 2007 +0000
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# $NetBSD: mklivecd.sh,v 1.36 2007/04/11 11:51:35 xtraeme Exp $
+# $NetBSD: mklivecd.sh,v 1.37 2007/04/11 14:22:26 xtraeme Exp $
#
# Copyright (c) 2004-2007 Juan Romero Pardines.
# All rights reserved.
@@ -148,6 +148,37 @@
esac
}
+showmsg_optyesno()
+{
+ echo
+ echo "This option only accepts a value of 'yes' or 'no'"
+ echo "(case insensitive), please update your configuration."
+ echo "See mklivecd(8) for more details."
+
+ return 1
+}
+
+checkoptval()
+{
+ _opt="$1"
+ eval _val="\$$1"
+
+ if [ -z $_opt ]; then
+ echo "*** '$_opt' is not set ***"
+ showmsg_optyesno
+ fi
+
+ case $_val in
+ [Yy][Ee][Ss]|[Nn][Oo])
+ return 0
+ ;;
+ *)
+ echo "*** Invalid value for '$_opt' ***"
+ showmsg_optyesno
+ ;;
+ esac
+}
+
bye()
{
_exitarg="$1"
@@ -367,8 +398,6 @@
do_build_kernels()
{
- . $config_file
-
for K in ${MULTIPLE_KERNELS}
do
eval bootkern=\$KERNEL_CONFIG_${K}
@@ -447,6 +476,14 @@
{
. $config_file
+ YESNOVARS="FETCH_SETS ENABLE_X11 USE_GNU_GRUB \
+ VND_COMPRESSION BLANK_BEFORE_BURN"
+
+ for v in $YESNOVARS
+ do
+ ! checkoptval $v && bye 1
+ done
+
vars="$BASEDIR $ISODIR $WORKDIR"
for value in $vars
@@ -649,7 +686,7 @@
cat > $ISODIR/etc/rc.d/root <<_EOF_
#!/bin/sh
#
-# \$NetBSD: mklivecd.sh,v 1.36 2007/04/11 11:51:35 xtraeme Exp $
+# \$NetBSD: mklivecd.sh,v 1.37 2007/04/11 14:22:26 xtraeme Exp $
#
# PROVIDE: root
Home |
Main Index |
Thread Index |
Old Index