FreeCalypso > hg > freecalypso-sw
diff nuc-fw/cfgmagic/functions @ 91:3641e44f044e
nuc-fw config: export_to_*(): catch multiple exports of the same setting
author | Michael Spacefalcon <msokolov@ivan.Harhan.ORG> |
---|---|
date | Sun, 25 Aug 2013 20:13:24 +0000 |
parents | ccde45a06737 |
children |
line wrap: on
line diff
--- 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 }