# HG changeset patch # User Michael Spacefalcon # Date 1377461604 0 # Node ID 3641e44f044e4f2c1326304a6cd9eddbd92d1f21 # Parent 5c1e6b7b5bd10f80f6ff80d2ebaf092a4f123806 nuc-fw config: export_to_*(): catch multiple exports of the same setting diff -r 5c1e6b7b5bd1 -r 3641e44f044e nuc-fw/cfgmagic/functions --- a/nuc-fw/cfgmagic/functions Sun Aug 25 19:27:40 2013 +0000 +++ b/nuc-fw/cfgmagic/functions Sun Aug 25 20:13:24 2013 +0000 @@ -46,7 +46,13 @@ echo "export_to_c: wrong number of arguments" 1>&2 exit 1 fi - c_export_list="$c_export_list $1" + case "$c_export_list" in + *" $1 "* | *" $1") + ;; + *) + c_export_list="$c_export_list $1" + ;; + esac } export_to_mk() { @@ -55,7 +61,13 @@ echo "export_to_mk: wrong number of arguments" 1>&2 exit 1 fi - mk_export_list="$mk_export_list $1" + case "$mk_export_list" in + *" $1 "* | *" $1") + ;; + *) + mk_export_list="$mk_export_list $1" + ;; + esac } export_to_m4() { @@ -64,5 +76,11 @@ echo "export_to_m4: wrong number of arguments" 1>&2 exit 1 fi - m4_export_list="$m4_export_list $1" + case "$m4_export_list" in + *" $1 "* | *" $1") + ;; + *) + m4_export_list="$m4_export_list $1" + ;; + esac }