rc.d standardization patch

Simon 'corecode' Schubert corecode at fs.ei.tum.de
Fri Jul 28 09:53:18 PDT 2006


Kevin L. Kane wrote:
respect configs that use old names with _enable but output a warning
saying _enable is deprecated.
[..]
@@ -219,6 +220,26 @@
 #
 checkyesno()
 {
+	# this is added for compatibility purposes will 
+	# be removed when _enable is deprecated for real
+	eval _value=\$${1}_enable
+	debug "checkyesno: $1 is set to $_value."
+	case $_value in
+
+		#	"yes", "true", "on", or "1"
+	[Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1)
+		warn "\$${1}_enable is deprecated, use: \$${1} instead."
+		return 0
+		;;
+
+		#	"no", "false", "off", or "0"
+	[Nn][Oo]|[Ff][Aa][Ll][Ss][Ee]|[Oo][Ff][Ff]|0)
+		warn "\$${1}_enable is deprecated, use: \$${1} instead."
+		return 1
+		;;
+	esac
+	# end compatibility section for _enable
+
how about making this
if [ -n "$_value" ]
then
	warn "\$${1}_enable is deprecated, use: \$${1} instead."
	eval \$${1}=\$${1}_enable
fi
cheers
 simon
--
Serve - BSD     +++  RENT this banner advert  +++    ASCII Ribbon   /"\
Work - Mac      +++  space for low €€€ NOW!1  +++      Campaign     \ /
Party Enjoy Relax   |   http://dragonflybsd.org      Against  HTML   \
Dude 2c 2 the max   !   http://golden-apple.biz       Mail + News   / \
Attachment:
signature.asc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pgp00001.pgp
Type: application/octet-stream
Size: 252 bytes
Desc: "Description: OpenPGP digital signature"
URL: <http://lists.dragonflybsd.org/pipermail/submit/attachments/20060728/7c06d3b3/attachment-0017.obj>


More information about the Submit mailing list