comparison 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
comparison
equal deleted inserted replaced
90:5c1e6b7b5bd1 91:3641e44f044e
44 if [ $# != 1 ] 44 if [ $# != 1 ]
45 then 45 then
46 echo "export_to_c: wrong number of arguments" 1>&2 46 echo "export_to_c: wrong number of arguments" 1>&2
47 exit 1 47 exit 1
48 fi 48 fi
49 c_export_list="$c_export_list $1" 49 case "$c_export_list" in
50 *" $1 "* | *" $1")
51 ;;
52 *)
53 c_export_list="$c_export_list $1"
54 ;;
55 esac
50 } 56 }
51 57
52 export_to_mk() { 58 export_to_mk() {
53 if [ $# != 1 ] 59 if [ $# != 1 ]
54 then 60 then
55 echo "export_to_mk: wrong number of arguments" 1>&2 61 echo "export_to_mk: wrong number of arguments" 1>&2
56 exit 1 62 exit 1
57 fi 63 fi
58 mk_export_list="$mk_export_list $1" 64 case "$mk_export_list" in
65 *" $1 "* | *" $1")
66 ;;
67 *)
68 mk_export_list="$mk_export_list $1"
69 ;;
70 esac
59 } 71 }
60 72
61 export_to_m4() { 73 export_to_m4() {
62 if [ $# != 1 ] 74 if [ $# != 1 ]
63 then 75 then
64 echo "export_to_m4: wrong number of arguments" 1>&2 76 echo "export_to_m4: wrong number of arguments" 1>&2
65 exit 1 77 exit 1
66 fi 78 fi
67 m4_export_list="$m4_export_list $1" 79 case "$m4_export_list" in
80 *" $1 "* | *" $1")
81 ;;
82 *)
83 m4_export_list="$m4_export_list $1"
84 ;;
85 esac
68 } 86 }