Browse code

Improve show to make minions less confusing. Fix cache search for archives Redo mulle-bootstrap settings/config/expansion Added --no-defer flag Fix fetch_needed detection

Nat! authored on 24-02-2017 15:19:56
Showing 6 changed files
... ...
@@ -108,9 +108,10 @@ usage: mulle-bootstrap [flags] [command] [options]
108 108
                -a (clone preferred) -y (local copy/symlink preferred)
109 109
    -f        : force operation
110 110
    -n        : do nothing creative or destructive
111
+   --no-defer: do not defer to master, if project is a minion
111 112
    -v        : -v to be more verbose (-vv or -vvv for more verbosity)
112 113
    -V        : verbose build
113
-   -DKEY=VAL : define local key/value C style
114
+   -DKEY=VAL : define local expansion key/value C style
114 115
 EOF
115 116
 
116 117
    bootstrap_technical_option_usage
... ...
@@ -499,13 +500,21 @@ bootstrap_should_defer_to_master()
499 500
    # and some commands (like fetch and clean) are executed locally AND in the
500 501
    # master
501 502
    #
503
+
502 504
    if ! is_minion_bootstrap_project
503 505
    then
504 506
       return 1
505 507
    fi
506 508
 
509
+   if [ "${MULLE_FLAG_DONT_DEFER}" = "YES" ]
510
+   then
511
+      log_verbose "Minion executes locally by request"
512
+      return 1
513
+   fi
514
+
507 515
    if [ "${MULLE_BOOTSTRAP_DONT_DEFER}" = "YES" ]
508 516
    then
517
+      log_fluff "Minion executes locally by environment"
509 518
       return 1
510 519
    fi
511 520
 
... ...
@@ -520,6 +529,23 @@ bootstrap_should_defer_to_master()
520 529
          log_verbose "Minion executes locally"
521 530
       ;;
522 531
 
532
+      show)
533
+         log_verbose "Minion executes partially locally"
534
+
535
+         [ -z "${MULLE_BOOTSTRAP_SHOW_SH}" ] && . mulle-bootstrap-show.sh
536
+
537
+         (
538
+            [ $# -eq 0 ] || shift
539
+            show_main_header_only "$@"
540
+         ) || exit 1
541
+
542
+         log_info "Minion defers to master \"$masterpath\""
543
+         log_info ""
544
+
545
+         cd "${masterpath}" || fail "master is missing"
546
+         return 0  # this leads to  main deferring later on (but cd is set!)
547
+      ;;
548
+
523 549
       refer|dist-clean)
524 550
          fail "This is a minion bootstrap project.\n \
525 551
 ${MULLE_BOOTSTRAP_EXECUTABLE} ${command}t is not possible."
... ...
@@ -554,6 +580,7 @@ bootstrap_main()
554 580
    local MULLE_FLAG_LOG_EXECUTOR="NO"
555 581
    local MULLE_FLAG_LOG_EXECUTOR="NO"
556 582
    local MULLE_FLAG_LOG_FLUFF="NO"
583
+   local MULLE_FLAG_DONT_DEFER="NO"
557 584
    local MULLE_FLAG_LOG_SCRIPTS="NO"
558 585
    local MULLE_FLAG_LOG_SETTINGS="NO"
559 586
    local MULLE_FLAG_LOG_VERBOSE="NO"
... ...
@@ -583,6 +610,10 @@ bootstrap_main()
583 610
             MULLE_FLAG_ANSWER="YES"
584 611
          ;;
585 612
 
613
+         --no-defer)
614
+            MULLE_FLAG_DONT_DEFER="YES"
615
+         ;;
616
+
586 617
          # used persistently throughout so it's global
587 618
          --follow-symlinks)
588 619
             MULLE_FLAG_FOLLOW_SYMLINKS="YES"
... ...
@@ -592,7 +623,7 @@ bootstrap_main()
592 623
             MULLE_FLAG_MAGNUM_FORCE="YES"
593 624
          ;;
594 625
 
595
-         -ig|--ignore-graveyard)
626
+         --ignore-graveyard)
596 627
             MULLE_FLAG_IGNORE_GRAVEYARD="YES"
597 628
          ;;
598 629
 
... ...
@@ -771,7 +802,7 @@ bootstrap_main()
771 802
       ;;
772 803
 
773 804
       show)
774
-         . mulle-bootstrap-show.sh
805
+         [ -z "${MULLE_BOOTSTRAP_SHOW_SH}" ] && . mulle-bootstrap-show.sh
775 806
 
776 807
          show_main "$@" || exit 1
777 808
       ;;
... ...
@@ -351,7 +351,7 @@ _search_for_archive_in_caches()
351 351
 
352 352
    found="${directory}/${name}-${filename}"
353 353
    log_fluff "Looking for \"${found}\""
354
-   if [ -d "${found}" ]
354
+   if [ -f "${found}" ]
355 355
    then
356 356
       log_fluff "Found \"${name}\" in \"${directory}\" as \"${found}\""
357 357
 
... ...
@@ -361,7 +361,7 @@ _search_for_archive_in_caches()
361 361
 
362 362
    found="${directory}/${filename}"
363 363
    log_fluff "Looking for \"${found}\""
364
-   if [ -d "${found}" ]
364
+   if [ -f "${found}" ]
365 365
    then
366 366
       log_fluff "Found \"${name}\" in \"${directory}\" as \"${found}\""
367 367
 
... ...
@@ -911,20 +911,13 @@ required_action_for_clone()
911 911
 
912 912
    if [ "${scm}" != "${newscm}" ]
913 913
    then
914
-      log_fluff "SCM has changed from \"${scm}\" to \"${newscm}\", need to refetch"
915
-      echo "remove
916
-clone"
917
-      return
918
-   fi
919
-
920
-   #
921
-   # if scm is not git, don't try to be clever
922
-   #
923
-   if [ ! -z "${scm}" ] && [ "${scm}" != "git" -a "${scm}" != "symlink" ]
924
-   then
925
-      echo "remove
914
+      if ! [ "${scm}" = "symlink" -a "${newscm}" = "git" ]
915
+      then
916
+         log_fluff "SCM has changed from \"${scm}\" to \"${newscm}\", need to refetch"
917
+         echo "remove
926 918
 clone"
927
-      return
919
+         return
920
+      fi
928 921
    fi
929 922
 
930 923
    if [ "${stashdir}" != "${newstashdir}" ]
... ...
@@ -958,6 +951,9 @@ clone"
958 951
       fi
959 952
    fi
960 953
 
954
+   #
955
+   # if scm is not git, don't try to be clever
956
+   #
961 957
    if [ "${scm}" = "symlink" ]
962 958
    then
963 959
       if [ -e "${newstashdir}" ]
... ...
@@ -207,11 +207,9 @@ add_cmake_path_if_exists()
207 207
 
208 208
 add_cmake_path()
209 209
 {
210
-   local line
211
-   local path
210
+   local line="$1"
211
+   local path="$2"
212 212
 
213
-   line="$1"
214
-   path="$2"
215 213
 
216 214
    if [ -z "${line}" ]
217 215
    then
... ...
@@ -271,9 +269,7 @@ unescape_linefeeds()
271 269
 #
272 270
 expand_environment_variables()
273 271
 {
274
-    local string
275
-
276
-    string="$1"
272
+    local string="$1"
277 273
 
278 274
     local key
279 275
     local value
... ...
@@ -299,7 +295,8 @@ expand_environment_variables()
299 295
           return
300 296
        fi
301 297
     fi
302
-    echo "$1"
298
+
299
+    echo "${string}"
303 300
 }
304 301
 
305 302
 
... ...
@@ -314,10 +311,10 @@ expand_environment_variables()
314 311
 #
315 312
 path_depth()
316 313
 {
317
-   local name
314
+   local name="$1"
315
+
318 316
    local depth
319 317
 
320
-   name="$1"
321 318
    depth=0
322 319
 
323 320
    if [ ! -z "${name}" ]
... ...
@@ -339,10 +336,10 @@ path_depth()
339 336
 #
340 337
 extension_less_basename()
341 338
 {
342
-   local  file
339
+   local  filename
343 340
 
344
-   file="`basename -- "$1"`"
345
-   echo "${file%.*}"
341
+   filename="`basename -- "$1"`"
342
+   echo "${filename%.*}"
346 343
 }
347 344
 
348 345
 
... ...
@@ -390,10 +387,10 @@ path_concat()
390 387
 _prepend_path_if_relative()
391 388
 {
392 389
    case "$2" in
393
-      /* )
390
+      /*)
394 391
          echo "$2"
395 392
          ;;
396
-      * )
393
+      *)
397 394
          echo "$1/$2"
398 395
          ;;
399 396
    esac
... ...
@@ -539,11 +536,8 @@ _relative_path_between()
539 536
 #
540 537
 relative_path_between()
541 538
 {
542
-   local  a
543
-   local  b
544
-
545
-   a="$1"
546
-   b="$2"
539
+   local  a="$1"
540
+   local  b="$2"
547 541
 
548 542
    # the function can't do mixed paths
549 543
 
... ...
@@ -607,11 +601,10 @@ relative_path_between()
607 601
 #
608 602
 compute_relative()
609 603
 {
604
+   local name="$1"
605
+
610 606
    local depth
611 607
    local relative
612
-   local name
613
-
614
-   name="$1"
615 608
 
616 609
    depth="`path_depth "${name}"`"
617 610
    if [ "${depth}" -gt 1 ]
... ...
@@ -635,11 +628,8 @@ compute_relative()
635 628
 
636 629
 remove_absolute_path_prefix_up_to()
637 630
 {
638
-   local s
639
-   local prefix
640
-
641
-   s="$1"
642
-   prefix="$2"
631
+   local s="$1"
632
+   local prefix="$2"
643 633
 
644 634
    if [ "`basename -- "${s}"`" = "${prefix}" ]
645 635
    then
... ...
@@ -1075,28 +1065,14 @@ prepend_to_search_path_if_missing()
1075 1065
 }
1076 1066
 
1077 1067
 
1078
-make_executable_search_path()
1079
-{
1080
-   if [ "${MULLE_TRACE_PATHS_FLIP_X}" = "YES" ]
1081
-   then
1082
-      set +x
1083
-   fi
1084
-
1085
-   _make_executable_search_path "$@"
1086
-
1087
-   if [ "${MULLE_TRACE_PATHS_FLIP_X}" = "YES" ]
1088
-   then
1089
-      set -x
1090
-   fi
1091
-}
1092
-
1093
-
1094 1068
 # ####################################################################
1095 1069
 #                        Files and Directories
1096 1070
 # ####################################################################
1097 1071
 #
1098 1072
 mkdir_if_missing()
1099 1073
 {
1074
+   [ -z "$1" ] && internal_fail "empty path"
1075
+
1100 1076
    if [ ! -d "$1" ]
1101 1077
    then
1102 1078
       log_fluff "Creating \"$1\" ($PWD)"
... ...
@@ -1107,13 +1083,15 @@ mkdir_if_missing()
1107 1083
 
1108 1084
 dir_is_empty()
1109 1085
 {
1110
-   local empty
1086
+   [ -z "$1" ] && internal_fail "empty path"
1111 1087
 
1112 1088
    if [ ! -d "$1" ]
1113 1089
    then
1114 1090
       return 2
1115 1091
    fi
1116 1092
 
1093
+   local empty
1094
+
1117 1095
    empty="`ls -A "$1" 2> /dev/null`"
1118 1096
    [ "$empty" = "" ]
1119 1097
 }
... ...
@@ -1121,6 +1099,8 @@ dir_is_empty()
1121 1099
 
1122 1100
 rmdir_safer()
1123 1101
 {
1102
+   [ -z "$1" ] && internal_fail "empty path"
1103
+
1124 1104
    if [ -d "$1" ]
1125 1105
    then
1126 1106
       assert_sane_path "$1"
... ...
@@ -1132,6 +1112,8 @@ rmdir_safer()
1132 1112
 
1133 1113
 rmdir_if_empty()
1134 1114
 {
1115
+   [ -z "$1" ] && internal_fail "empty path"
1116
+
1135 1117
    if dir_is_empty "$1"
1136 1118
    then
1137 1119
       exekutor rmdir "$1"  >&2 || fail "failed to remove $1"
... ...
@@ -1141,10 +1123,12 @@ rmdir_if_empty()
1141 1123
 
1142 1124
 create_file_if_missing()
1143 1125
 {
1144
-   local dir
1126
+   [ -z "$1" ] && internal_fail "empty path"
1145 1127
 
1146 1128
    if [ ! -f "$1" ]
1147 1129
    then
1130
+      local dir
1131
+
1148 1132
       dir="`dirname "$1"`"
1149 1133
       if [ ! -z "${dir}" ]
1150 1134
       then
... ...
@@ -1157,6 +1141,18 @@ create_file_if_missing()
1157 1141
 }
1158 1142
 
1159 1143
 
1144
+remove_file_if_present()
1145
+{
1146
+   [ -z "$1" ] && internal_fail "empty path"
1147
+
1148
+   if [ -e "$1" ]
1149
+   then
1150
+      log_fluff "Removing \"$1\""
1151
+      exekutor chmod u+w "$1"  >&2 || fail "Failed to make $1 writable"
1152
+      exekutor rm -f "$1"  >&2 || fail "failed to remove \"$1\""
1153
+   fi
1154
+}
1155
+
1160 1156
 #
1161 1157
 # the target of the symlink must exist
1162 1158
 #
... ...
@@ -1196,17 +1192,6 @@ create_symlink()
1196 1192
 }
1197 1193
 
1198 1194
 
1199
-remove_file_if_present()
1200
-{
1201
-   if [ -e "$1" ]
1202
-   then
1203
-      log_fluff "Removing \"$1\""
1204
-      exekutor chmod u+w "$1"  >&2 || fail "Failed to make $1 writable"
1205
-      exekutor rm -f "$1"  >&2 || fail "failed to remove \"$1\""
1206
-   fi
1207
-}
1208
-
1209
-
1210 1195
 modification_timestamp()
1211 1196
 {
1212 1197
    case "${UNAME}" in
... ...
@@ -198,9 +198,12 @@ fetch_needed()
198 198
 
199 199
    [ -z "${REPOS_DIR}" ] && internal_fail "REPOS_DIR undefined"
200 200
 
201
-   if [ ! -f "${REPOS_DIR}/.bootstrap_fetch_done" ]
201
+   local  referencefile
202
+
203
+   referencefile="${REPOS_DIR}/.bootstrap_fetch_done"
204
+   if [ ! -f "${referencefile}" ]
202 205
    then
203
-      log_fluff "Need fetch because \"${REPOS_DIR}/.bootstrap_fetch_done\" does not exist."
206
+      log_fluff "Need fetch because \"${referencefile}\" does not exist."
204 207
       return 0
205 208
    fi
206 209
 
... ...
@@ -213,7 +216,7 @@ fetch_needed()
213 216
       bootstrapdir="${BOOTSTRAP_DIR}.local"
214 217
    fi
215 218
 
216
-   if [ "${REPOS_DIR}/.bootstrap_fetch_done" -ot "${bootstrapdir}" ]
219
+   if [ "${referencefile}" -ot "${bootstrapdir}" ]
217 220
    then
218 221
       log_fluff "Need fetch because \"${bootstrapdir}\" is modified"
219 222
       return 0
... ...
@@ -229,7 +232,7 @@ fetch_needed()
229 232
    do
230 233
       IFS="${DEFAULT_IFS}"
231 234
 
232
-      if [ "${bootstrapdir}" -ot "${stashdir}/${BOOTSTRAP_DIR}" ]
235
+      if [ "${referencefile}" -ot "${stashdir}/${BOOTSTRAP_DIR}" ]
233 236
       then
234 237
          log_fluff "Need fetch because \"${stashdir}/${BOOTSTRAP_DIR}\" is modified"
235 238
          return 0
... ...
@@ -35,24 +35,33 @@ config_usage()
35 35
 {
36 36
     cat <<EOF >&2
37 37
 usage:
38
-   mulle-bootstrap config [options] [name] [value]
38
+   mulle-bootstrap config [options] [key] [value]
39 39
 
40 40
    Options:
41
-      -l   : list config values
42 41
       -d   : delete config setting
42
+      -l   : list config values
43 43
 
44 44
    Use:
45
-      mulle-bootstrap config <name> to read
46
-      mulle-bootstrap config <name> <value> to write
45
+      mulle-bootstrap config <key> to read
46
+      mulle-bootstrap config <key> <value> to write
47 47
 EOF
48 48
   exit 1
49 49
 }
50 50
 
51
+
51 52
 expansion_usage()
52 53
 {
53 54
     cat <<EOF >&2
54 55
 usage:
55
-   mulle-bootstrap expansion <name> [value]
56
+   mulle-bootstrap expansion [options] <key> [value]
57
+
58
+   Options:
59
+      -d   : delete setting
60
+      -g   : use global .bootstrap folder instead of local
61
+
62
+   Use:
63
+      mulle-bootstrap expansion <key> to read
64
+      mulle-bootstrap expansion <key> <value> to write
56 65
 EOF
57 66
   exit 1
58 67
 }
... ...
@@ -62,7 +71,18 @@ setting_usage()
62 71
 {
63 72
     cat <<EOF >&2
64 73
 usage:
65
-   mulle-bootstrap setting [-r <repository>] <name>
74
+   mulle-bootstrap setting [options] <key> [value]
75
+
76
+   Options:
77
+      -a   : append value to setting
78
+      -d   : delete setting
79
+      -g   : use global .bootstrap folder instead of local
80
+      -p   : show current setting value
81
+      -r   : specify repository for build setting
82
+
83
+   Use:
84
+      mulle-bootstrap setting <key> to read settings
85
+      mulle-bootstrap setting <key> <value> to write settings
66 86
 EOF
67 87
   exit 1
68 88
 }
... ...
@@ -80,20 +100,93 @@ warn_user_setting()
80 100
    fi
81 101
 }
82 102
 
103
+KNOWN_CONFIG_KEYS="\
104
+absolute_symlinks
105
+addictions_dir
106
+brew_permissions
107
+build_dir
108
+build_log_dir
109
+build_preferences
110
+caches_path
111
+check_usr_local_include
112
+clean_before_build
113
+clean_dependencies_before_build
114
+clean_empty_parent_folders
115
+clean_folders
116
+configurations
117
+create_default_files
118
+create_example_files
119
+dependencies_dir
120
+dist_clean_folders
121
+dont_warn_scripts
122
+editor
123
+embedded_symlinks
124
+framework_dir_name
125
+header_dir_name
126
+install_clean_folders
127
+install_symlinks
128
+library_dir_name
129
+mangle_minwg_compiler
130
+no_warn_local_setting
131
+open_${mainfile}_file
132
+output_clean_folders
133
+override_branch
134
+stashes_dir
135
+symlinks
136
+warn_environment_setting
137
+warn_user_setting
138
+xcodebuild
139
+"
140
+
141
+KNOWN_ROOT_SETTING_KEYS="\
142
+brews
143
+embedded_repositories
144
+repositories
145
+version
146
+"
147
+
148
+KNOWN_BUILD_SETTING_KEYS="\
149
+WARNING_CFLAGS
150
+CMAKEFLAGS
151
+GCC_PREPROCESSOR_DEFINITIONS
152
+LD
153
+OTHER_CFLAGS
154
+OTHER_CXXFLAGS
155
+OTHER_LDFLAGS
156
+build_preferences
157
+cmake
158
+cmake_generator
159
+cmake_keep_builddir
160
+configurations
161
+configure_flags
162
+dispense_headers_path
163
+dispense_other_path
164
+fallback-configuration
165
+final
166
+make
167
+sdks
168
+xcconfig
169
+xcode_project
170
+xcode_proper_skip_install
171
+xcode_schemes
172
+xcode_targets
173
+xcodebuild
174
+"
175
+
83 176
 
84 177
 warn_environment_setting()
85 178
 {
86
-   local name
179
+   local key
87 180
 
88
-   name="$1"
181
+   key="$1"
89 182
    if [ "$MULLE_BOOTSTRAP_WARN_ENVIRONMENT_SETTINGS" = "YES" ]
90 183
    then
91 184
       # don't trace some boring ones
92
-      if [ "${name}" != "MULLE_FLAG_ANSWER" -a \
93
-           "${name}" != "MULLE_FLAG_LOG_VERBOSE" -a \
94
-           "${name}" != "MULLE_TRACE" ]
185
+      if [ "${key}" != "MULLE_FLAG_ANSWER" -a \
186
+           "${key}" != "MULLE_FLAG_LOG_VERBOSE" -a \
187
+           "${key}" != "MULLE_TRACE" ]
95 188
       then
96
-         log_warning "Using environment variable \"${name}\""
189
+         log_warning "Using environment variable \"${key}\""
97 190
       fi
98 191
    fi
99 192
 }
... ...
@@ -152,7 +245,7 @@ _read_setting()
152 245
          yesno="not "
153 246
       fi
154 247
 
155
-      log_trace2 "Looking for setting in \"${apath}\" (pwd=$PWD) : ${yesno}found"
248
+      log_trace2 "Looking for setting-file \"${apath}\" (pwd=$PWD) : ${yesno}found"
156 249
    fi
157 250
 
158 251
    if [ "${READ_SETTING_RETURNS_PATH}" = "YES" ]
... ...
@@ -164,10 +257,10 @@ _read_setting()
164 257
 
165 258
       if [ "$MULLE_FLAG_LOG_VERBOSE" = "YES"  ]
166 259
       then
167
-         local name
260
+         local key
168 261
 
169
-         name="`basename -- "${apath}"`"
170
-         log_setting "${C_MAGENTA}${name}${C_SETTING} found as \"${apath}\""
262
+         key="`basename -- "${apath}"`"
263
+         log_setting "${C_MAGENTA}${key}${C_SETTING} found as \"${apath}\""
171 264
       fi
172 265
 
173 266
       echo "${apath}"
... ...
@@ -186,23 +279,23 @@ _read_setting()
186 279
 
187 280
    if [ "${MULLE_FLAG_LOG_VERBOSE}" = "YES" -o "$MULLE_FLAG_LOG_SETTINGS" = "YES" ]
188 281
    then
189
-      local name
282
+      local key
190 283
 
191
-      name="`basename -- "${apath}"`"
284
+      key="`basename -- "${apath}"`"
192 285
       apath="`absolutepath "${apath}"`"
193 286
 
194 287
       # make some boring names less prominent
195 288
       if [ "$MULLE_FLAG_LOG_SETTINGS" = "YES" ] ||
196
-         [ "${name}" != "repositories" -a \
197
-           "${name}" != "repositories.tmp" -a \
198
-           "${name}" != "build_order" -a \
199
-           "${name}" != "versions" -a \
200
-           "${name}" != "embedded_repositories" -a \
201
-           "${name}" != "MULLE_REPOSITORIES" -a \
202
-           "${name}" != "MULLE_NAT_REPOSITORIES" \
289
+         [ "${key}" != "repositories" -a \
290
+           "${key}" != "repositories.tmp" -a \
291
+           "${key}" != "build_order" -a \
292
+           "${key}" != "versions" -a \
293
+           "${key}" != "embedded_repositories" -a \
294
+           "${key}" != "MULLE_REPOSITORIES" -a \
295
+           "${key}" != "MULLE_NAT_REPOSITORIES" \
203 296
          ]
204 297
       then
205
-         log_printf "${C_SETTING}%b${C_RESET}\n" "Setting ${C_MAGENTA}${name}${C_SETTING} found in \"${apath}\" as ${C_MAGENTA}${C_BOLD}${value}${C_SETTING}"
298
+         log_printf "${C_SETTING}%b${C_RESET}\n" "Setting ${C_MAGENTA}${key}${C_SETTING} found in \"${apath}\" as ${C_MAGENTA}${C_BOLD}${value}${C_SETTING}"
206 299
       fi
207 300
    fi
208 301
 
... ...
@@ -218,16 +311,16 @@ read_setting()
218 311
 
219 312
 read_raw_setting()
220 313
 {
221
-   local name="$1"
314
+   local key="$1"
222 315
 
223 316
    [ $# -ne 1 ]     && internal_fail "parameterization error"
224
-   [ -z "${name}" ] && internal_fail "empty name in read_raw_setting"
317
+   [ -z "${key}" ] && internal_fail "empty key in read_raw_setting"
225 318
 
226
-   if _read_setting "${BOOTSTRAP_DIR}.local/${name}"
319
+   if _read_setting "${BOOTSTRAP_DIR}.local/${key}"
227 320
    then
228 321
       return
229 322
    fi
230
-   _read_setting "${BOOTSTRAP_DIR}/${name}"
323
+   _read_setting "${BOOTSTRAP_DIR}/${key}"
231 324
 }
232 325
 
233 326
 #
... ...
@@ -235,10 +328,10 @@ read_raw_setting()
235 328
 #
236 329
 _read_bootstrap_setting()
237 330
 {
238
-   local name="$1"
331
+   local key="$1"
239 332
 
240 333
    [ $# -ne 1 ]     && internal_fail "parameterization error"
241
-   [ -z "${name}" ] && internal_fail "empty name in _read_bootstrap_setting"
334
+   [ -z "${key}" ] && internal_fail "empty key in _read_bootstrap_setting"
242 335
 
243 336
    local value
244 337
 
... ...
@@ -252,7 +345,7 @@ _read_bootstrap_setting()
252 345
       suffix=".auto"
253 346
    fi
254 347
 
255
-   _read_setting "${BOOTSTRAP_DIR}${suffix}/${name}"
348
+   _read_setting "${BOOTSTRAP_DIR}${suffix}/${key}"
256 349
 }
257 350
 
258 351
 
... ...
@@ -262,21 +355,21 @@ _read_bootstrap_setting()
262 355
 #
263 356
 _read_environment_setting()
264 357
 {
265
-   local name
358
+   local key
266 359
    local value
267 360
    local envname
268 361
 
269 362
    [ $# -ne 1  ] && internal_fail "parameterization error"
270 363
 
271
-   name="$1"
364
+   key="$1"
272 365
 
273
-   [ -z "$name" ] && internal_fail "empty name in _read_environment_setting"
366
+   [ -z "${key}" ] && internal_fail "empty key in _read_environment_setting"
274 367
 
275
-   envname="MULLE_BOOTSTRAP_`echo "${name}" | tr '[:lower:]' '[:upper:]'`"
368
+   envname="MULLE_BOOTSTRAP_`echo "${key}" | tr '[:lower:]' '[:upper:]'`"
276 369
 
277 370
    if [ "$MULLE_FLAG_LOG_SETTINGS" = "YES" ]
278 371
    then
279
-      log_trace2 "Looking for setting \"${name}\" as environment variable \"${envname}\""
372
+      log_trace2 "Looking for setting \"${key}\" as environment variable \"${envname}\""
280 373
    fi
281 374
 
282 375
    value="`printenv "${envname}"`"
... ...
@@ -287,7 +380,7 @@ _read_environment_setting()
287 380
 
288 381
    if [ "${MULLE_FLAG_LOG_SETTINGS}" = "YES" ]
289 382
    then
290
-      log_trace "Setting ${C_MAGENTA}${C_BOLD}${name}${C_TRACE} found in environment variable \"${envname}\" as ${C_MAGENTA}${C_BOLD}${value}${C_TRACE}"
383
+      log_trace "Setting ${C_MAGENTA}${C_BOLD}${key}${C_TRACE} found in environment variable \"${envname}\" as ${C_MAGENTA}${C_BOLD}${value}${C_TRACE}"
291 384
    fi
292 385
 
293 386
    warn_environment_setting "${envname}"
... ...
@@ -325,22 +418,22 @@ list_environment_settings()
325 418
 
326 419
 _read_home_setting()
327 420
 {
328
-   local name
421
+   local key
329 422
    local value
330 423
    local default
331 424
 
332 425
    [ $# -ne 1  ] && internal_fail "parameterization error"
333 426
 
334
-   name="$1"
427
+   key="$1"
335 428
 
336
-   [ -z "$name" ] && internal_fail "empty name in _read_home_setting"
429
+   [ -z "${key}" ] && internal_fail "empty key in _read_home_setting"
337 430
 
338
-   if ! value="`_read_setting "${HOME}/.mulle-bootstrap/${name}"`"
431
+   if ! value="`_read_setting "${HOME}/.mulle-bootstrap/${key}"`"
339 432
    then
340 433
       return 2
341 434
    fi
342 435
 
343
-   warn_user_setting "${HOME}/.mulle-bootstrap/${name}"
436
+   warn_user_setting "${HOME}/.mulle-bootstrap/${key}"
344 437
 
345 438
    echo "$value"
346 439
 }
... ...
@@ -395,32 +488,32 @@ read_config_setting()
395 488
       set +x
396 489
    fi
397 490
 
398
-   local name
491
+   local key
399 492
    local default
400 493
 
401 494
    [ $# -lt 1 -o $# -gt 2 ] && internal_fail "parameterization error"
402 495
 
403
-   name="$1"
496
+   key="$1"
404 497
    default="$2"
405 498
 
406
-   [ -z "$name" ] && internal_fail "empty name in read_config_setting"
499
+   [ -z "${key}" ] && internal_fail "empty key in read_config_setting"
407 500
 
408 501
    #
409
-   # always lowercase config names
502
+   # always lowercase config keys
410 503
    #
411
-   name=`echo "${name}" | tr '[:upper:]' '[:lower:]'`
504
+   key=`echo "${key}" | tr '[:upper:]' '[:lower:]'`
412 505
 
413 506
    local value
414 507
 
415
-   if ! value="`_read_environment_setting "${name}"`"
508
+   if ! value="`_read_environment_setting "${key}"`"
416 509
    then
417
-      if ! value="`_read_setting "${BOOTSTRAP_DIR}.local/config/${name}"`"
510
+      if ! value="`_read_setting "${BOOTSTRAP_DIR}.local/config/${key}"`"
418 511
       then
419
-         if ! value="`_read_home_setting "${name}"`"
512
+         if ! value="`_read_home_setting "${key}"`"
420 513
          then
421 514
             if [ ! -z "${default}" ]
422 515
             then
423
-               log_setting "Setting ${C_MAGENTA}${name}${C_SETTING} set to default ${C_MAGENTA}${default}${C_SETTING}"
516
+               log_setting "Setting ${C_MAGENTA}${key}${C_SETTING} set to default ${C_MAGENTA}${default}${C_SETTING}"
424 517
                value="${default}"
425 518
             fi
426 519
          fi
... ...
@@ -447,27 +540,27 @@ read_build_setting()
447 540
       set +x
448 541
    fi
449 542
 
450
-   local name
543
+   local key
451 544
    local default
452 545
    local package
453 546
 
454 547
    [ $# -lt 2 -o $# -gt 3 ] && internal_fail "parameterization error"
455 548
 
456 549
    package="$1"
457
-   name="$2"
550
+   key="$2"
458 551
    default="$3"
459 552
 
460
-   [ -z "$name" ] && internal_fail "empty parameter in read_config_setting"
553
+   [ -z "${key}" ] && internal_fail "empty parameter in read_config_setting"
461 554
 
462 555
    local value
463 556
 
464
-   value="`_read_bootstrap_setting "${package}.build/${name}"`"
557
+   value="`_read_bootstrap_setting "${package}.build/${key}"`"
465 558
    if [ $? -ne 0 ]
466 559
    then
467 560
       if [ ! -z "${default}" ]
468 561
       then
469 562
          log_setting "Build Setting ${C_MAGENTA}${package}${C_SETTING} \
470
-for ${C_MAGENTA}${name}${C_SETTING} \
563
+for ${C_MAGENTA}${key}${C_SETTING} \
471 564
 set to default ${C_MAGENTA}${default}${C_SETTING}"
472 565
       fi
473 566
       value="${default}"
... ...
@@ -493,22 +586,22 @@ read_root_setting()
493 586
    fi
494 587
 
495 588
    local default
496
-   local name
589
+   local key
497 590
 
498
-   name="$1"
591
+   key="$1"
499 592
    default="$2"
500 593
 
501
-   [ -z "$name" ] && internal_fail "empty name in read_root_setting"
594
+   [ -z "${key}" ] && internal_fail "empty key in read_root_setting"
502 595
 
503 596
    local value
504 597
    local rval
505 598
 
506
-   value="`_read_bootstrap_setting "${name}"`"
599
+   value="`_read_bootstrap_setting "${key}"`"
507 600
    if [ $? -ne 0 ]
508 601
    then
509 602
       if [ ! -z "${default}" ]
510 603
       then
511
-         log_setting "Root setting for ${C_MAGENTA}${name}${C_SETTING} set to default ${C_MAGENTA}${default}${C_SETTING}"
604
+         log_setting "Root setting for ${C_MAGENTA}${key}${C_SETTING} set to default ${C_MAGENTA}${default}${C_SETTING}"
512 605
       fi
513 606
       value="${default}"
514 607
    fi
... ...
@@ -525,7 +618,6 @@ read_root_setting()
525 618
 }
526 619
 
527 620
 
528
-
529 621
 ####
530 622
 # Used for finding script files
531 623
 #
... ...
@@ -564,14 +656,14 @@ read_yes_no_config_setting()
564 656
 
565 657
 read_sane_config_path_setting()
566 658
 {
567
-   local name
659
+   local key
568 660
    local value
569 661
    local default
570 662
 
571
-   name="$1"
663
+   key="$1"
572 664
    default="$2"
573 665
 
574
-   value="`read_config_setting "${name}" "${default}"`"
666
+   value="`read_config_setting "${key}" "${default}"`"
575 667
    if [ $? -eq 0 ]
576 668
    then
577 669
       assert_sane_subdir_path "${value}"
... ...
@@ -620,7 +712,7 @@ _merge_settings_in_front()
620 712
 {
621 713
    local settings1="$1"
622 714
    local settings2="$2"
623
-   local name="$3"
715
+   local key="$3"
624 716
 
625 717
    local result
626 718
 
... ...
@@ -673,7 +765,6 @@ merge_settings_in_front()
673 765
 ###
674 766
 #
675 767
 #
676
-
677 768
 all_build_flag_keys()
678 769
 {
679 770
    local package
... ...
@@ -697,9 +788,145 @@ ${keys3}
697 788
    return 0
698 789
 }
699 790
 
791
+
700 792
 #
701
-# "config" interface sorta like git config
702
-# obviously need to "vet" the keys sometime
793
+# setting ops
794
+#
795
+_setting_list()
796
+{
797
+   fail "Not yet implemented"
798
+}
799
+
800
+
801
+_chosen_bootstrapdir()
802
+{
803
+   local option="$1"
804
+
805
+   if [ "${option}" = "YES" ]
806
+   then
807
+      echo "${BOOTSTRAP_DIR}"
808
+   else
809
+      echo "${BOOTSTRAP_DIR}.local"
810
+   fi
811
+}
812
+
813
+
814
+_chosen_setting_directory()
815
+{
816
+   local repository="$1"
817
+   local option="$2"
818
+
819
+   local bootstrapdir
820
+
821
+   if [ "${option}" = "YES" ]
822
+   then
823
+      bootstrapdir="${BOOTSTRAP_DIR}"
824
+      if [ ! -z "${repository}" ]
825
+      then
826
+         echo "${bootstrapdir}/${repository}.build"
827
+      else
828
+         echo "${bootstrapdir}"
829
+      fi
830
+   else
831
+      bootstrapdir="${BOOTSTRAP_DIR}.local"
832
+      if [ ! -z "${3}" ]
833
+      then
834
+         echo "${bootstrapdir}/${repository}.build"
835
+      else
836
+         echo "${bootstrapdir}/settings/"
837
+      fi
838
+   fi
839
+}
840
+
841
+
842
+_setting_read()
843
+{
844
+   local key="$1"
845
+   local repository="$2"
846
+
847
+   local bootstrapdir
848
+   local directory
849
+
850
+   if [ "${OPTION_PROCESSED_READ}" = "NO" ]
851
+   then
852
+      bootstrapdir="`_chosen_bootstrapdir "${OPTION_GLOBAL}"`"
853
+      directory="`_chosen_setting_directory "${repository}" "${OPTION_GLOBAL}"`"
854
+      _read_setting "${directory}/${name}"
855
+
856
+      return
857
+   fi
858
+
859
+   if [ -z "${repository}" ]
860
+   then
861
+      read_root_setting "$1"
862
+   else
863
+      read_build_setting "${repository}" "{key}"
864
+   fi
865
+}
866
+
867
+
868
+_setting_write()
869
+{
870
+   local key="$1"
871
+   local value="$2"
872
+   local repository="$3"
873
+
874
+   local bootstrapdir
875
+   local directory
876
+
877
+   bootstrapdir="`_chosen_bootstrapdir "${OPTION_GLOBAL}"`"
878
+   directory="`_chosen_setting_directory "${repository}" "${OPTION_GLOBAL}"`"
879
+
880
+   mkdir_if_missing "${directory}"
881
+
882
+   local filename
883
+
884
+   filename="${directory}/${key}"
885
+   redirect_exekutor "${filename}" echo "${value}"
886
+   exekutor touch "${bootstrapdir}"
887
+}
888
+
889
+
890
+_setting_append()
891
+{
892
+   local key="$1"
893
+   local value="$2"
894
+   local repository="$3"
895
+
896
+   local bootstrapdir
897
+   local directory
898
+
899
+   bootstrapdir="`_chosen_bootstrapdir "${OPTION_GLOBAL}"`"
900
+   directory="`_chosen_setting_directory "${repository}" "${OPTION_GLOBAL}"`"
901
+
902
+   mkdir_if_missing "${directory}"
903
+
904
+   local filename
905
+
906
+   filename="${directory}/${key}"
907
+   redirect_append_exekutor "${filename}" echo "${value}"
908
+   exekutor touch "${bootstrapdir}"
909
+}
910
+
911
+
912
+_setting_delete()
913
+{
914
+   local bootstrapdir
915
+   local directory
916
+
917
+   bootstrapdir="`_chosen_bootstrapdir "${OPTION_GLOBAL}"`"
918
+   directory="`_chosen_setting_directory "${repository}" "${OPTION_GLOBAL}"`"
919
+
920
+   local filename
921
+
922
+   filename="${directory}/${key}"
923
+   remove_file_if_present "${filename}"
924
+   exekutor touch "${bootstrapdir}" 2> /dev/null
925
+}
926
+
927
+
928
+#
929
+# config ops
703 930
 #
704 931
 _config_list()
705 932
 {
... ...
@@ -716,7 +943,15 @@ _config_list()
716 943
 
717 944
 _config_read()
718 945
 {
719
-   read_config_setting "$1"
946
+   local key="$1"
947
+
948
+   read_config_setting "${key}"
949
+}
950
+
951
+
952
+_config_append()
953
+{
954
+   fail "Not yet implemented"
720 955
 }
721 956
 
722 957
 
... ...
@@ -739,43 +974,120 @@ _config_delete()
739 974
 }
740 975
 
741 976
 
977
+#
978
+# expansion ops
979
+#
742 980
 _expansion_read()
743 981
 {
744
-   read_root_setting "$1"
982
+   local key="$1"
983
+
984
+   local bootstrapdir
985
+
986
+   if [ "${OPTION_PROCESSED_READ}" = "NO" ]
987
+   then
988
+      bootstrapdir="`_chosen_bootstrapdir "${OPTION_GLOBAL}"`"
989
+      _read_setting "${bootstrapdir}/${key}"
990
+
991
+      return
992
+   fi
993
+
994
+   read_root_setting "${key}"
745 995
 }
746 996
 
747 997
 
748 998
 _expansion_write()
749 999
 {
750
-   mkdir_if_missing "${BOOTSTRAP_DIR}.local"
1000
+   local bootstrapdir
1001
+
1002
+   bootstrapdir="`_chosen_bootstrapdir "${OPTION_GLOBAL}"`"
1003
+   mkdir_if_missing "${bootstrapdir}"
751 1004
 
752
-   exekutor echo "$2" > "${BOOTSTRAP_DIR}.local/$1"
1005
+   redirect_exekutor "${bootstrapdir}/$1" echo "$2"
1006
+   exekutor touch "${bootstrapdir}"
1007
+}
1008
+
1009
+
1010
+_expansion_append()
1011
+{
1012
+   fail "Not yet implemented"
753 1013
 }
754 1014
 
755 1015
 
756 1016
 _expansion_delete()
757 1017
 {
758
-   if [ -f "${BOOTSTRAP_DIR}.local/$1" ]
759
-   then
760
-      exekutor rm "${BOOTSTRAP_DIR}.local/$1"  >&2
761
-   fi
1018
+   local bootstrapdir
1019
+
1020
+   bootstrapdir="`_chosen_bootstrapdir "${OPTION_GLOBAL}"`"
1021
+
1022
+   remove_file_if_present "${bootstrapdir}/$1"
1023
+   exekutor touch "${bootstrapdir}"
762 1024
 }
763 1025
 
764 1026
 
1027
+_expansion_list()
1028
+{
1029
+   fail "Not yet implemented"
1030
+}
765 1031
 
766
-config_main()
1032
+
1033
+_generic_main()
767 1034
 {
768
-   local name
1035
+   local type="$1" ; shift
1036
+   local known_keys_1="$1"; shift
1037
+   local known_keys_2="$1"; shift
1038
+
1039
+   local OPTION_APPEND="NO"
1040
+   local OPTION_GLOBAL="NO"
1041
+   local OPTION_PROCESSED_READ="NO"
1042
+   local key
769 1043
    local value
770 1044
    local command
1045
+   local repository
771 1046
 
772 1047
    command="read"
773 1048
 
774 1049
    while [ $# -ne 0 ]
775 1050
    do
1051
+      case "${type}" in
1052
+         setting|expansion)
1053
+            case "$1" in
1054
+               -g|--global)
1055
+                  OPTION_GLOBAL="YES"
1056
+                  shift
1057
+                  continue
1058
+               ;;
1059
+
1060
+               -p|--processed)
1061
+                  OPTION_PROCESSED_READ="YES"
1062
+                  shift
1063
+                  continue
1064
+               ;;
1065
+            esac
1066
+         ;;
1067
+      esac
1068
+
1069
+      case "${type}" in
1070
+         setting)
1071
+            case "$1" in
1072
+               -r|--repository)
1073
+                  [ $# -ne 0 ] || fail "repository name missing"
1074
+                  repository="$1"
1075
+                  shift
1076
+                  continue
1077
+               ;;
1078
+            esac
1079
+         ;;
1080
+      esac
1081
+
776 1082
       case "$1" in
777 1083
          -h|-help|--help)
778
-            config_usage
1084
+            ${type}_usage
1085
+         ;;
1086
+
1087
+         -a|--append)
1088
+            OPTION_APPEND="YES"
1089
+            shift
1090
+            continue
779 1091
          ;;
780 1092
 
781 1093
          -d|--delete)
... ...
@@ -788,7 +1100,7 @@ config_main()
788 1100
 
789 1101
          -n|--off|--no|--NO)
790 1102
             command="write"
791
-            value=
1103
+            value="NO"
792 1104
          ;;
793 1105
 
794 1106
          -y|--on|--yes|--YES)
... ...
@@ -811,13 +1123,27 @@ config_main()
811 1123
 
812 1124
    case "${command}" in
813 1125
       read|write|delete)
814
-         name="$1"
815
-         [ -z "${name}" ] && config_usage
1126
+         key="$1"
1127
+         [ -z "${key}" ] && ${type}_usage
816 1128
          shift
1129
+
1130
+         if [ ! -z "${known_keys_1}" ]
1131
+         then
1132
+            local match
1133
+
1134
+            match="`echo "${known_keys_1}" | fgrep -s -x "${key}"`"
1135
+            if [ -z "${match}" ]
1136
+            then
1137
+               match="`echo "${known_keys_2}" | fgrep -s -x "${key}"`"
1138
+               if [ -z "${match}" ]
1139
+               then
1140
+                  log_warning "${key} is not a known key. Maybe OK, maybe not."
1141
+               fi
1142
+            fi
1143
+         fi
817 1144
       ;;
818 1145
    esac
819 1146
 
820
-
821 1147
    case "${command}" in
822 1148
       read)
823 1149
          if [ $# -ne 0 ]
... ...
@@ -825,190 +1151,62 @@ config_main()
825 1151
             command="write"
826 1152
             value="$1"
827 1153
             shift
1154
+
1155
+            if [ "${value}" = "-" ]
1156
+            then
1157
+               value="`cat`"
1158
+            fi
828 1159
          fi
829 1160
       ;;
830 1161
    esac
831 1162
 
832 1163
    if [ $# -ne 0 ]
833 1164
    then
834
-      config_usage
1165
+      ${type}_usage
835 1166
    fi
836 1167
 
837 1168
    case "${command}" in
838 1169
       read)
839
-         value="`"_config_read" "${name}"`"
840
-         if [ -z "${value}" ]
841
-         then
842
-            value="`eval echo "$"${name}`"
843
-         fi
844
-         if [ ! -z "${value}" ]
845
-         then
846
-            echo "${value}"
847
-         fi
1170
+         _${type}_read "${key}" "${repository}"
848 1171
       ;;
849 1172
 
850 1173
       list)
851
-         _config_list
1174
+         _${type}_list "${repository}"
852 1175
       ;;
853 1176
 
854 1177
       delete)
855
-         _config_delete "${name}"
1178
+         _${type}_delete "${key}" "${repository}"
856 1179
       ;;
857 1180
 
858 1181
       write)
859
-         _config_write "${name}" "${value}"
1182
+         if [ "${OPTION_APPEND}" = "YES" ]
1183
+         then
1184
+            _${type}_append "${key}" "${value}" "${repository}"
1185
+         else
1186
+            _${type}_write "${key}" "${value}" "${repository}"
1187
+         fi
860 1188
       ;;
861 1189
    esac
862 1190
 }
863 1191
 
864 1192
 
865
-expansion_main()
1193
+config_main()
866 1194
 {
867
-   local name
868
-   local value
869
-   local command
870
-
871
-   command="read"
872
-
873
-   while [ $# -ne 0 ]
874
-   do
875
-      case "$1" in
876
-         -h|-help|--help)
877
-            expansion_usage
878
-         ;;
879
-
880
-         -d|--delete)
881
-            command="delete"
882
-         ;;
883
-
884
-         -n|--off|--no|--NO)
885
-            command="write"
886
-            value=
887
-         ;;
888
-
889
-         -y|--on|--yes|--YES)
890
-            command="write"
891
-            value="YES"
892
-         ;;
893
-
894
-         -*)
895
-            log_error "${MULLE_EXECUTABLE_FAIL_PREFIX}: Unknown option $1"
896
-            expansion_usage
897
-         ;;
898
-
899
-         *)
900
-            break
901
-         ;;
902
-      esac
903
-
904
-      shift
905
-   done
906
-
907
-   name="`echo "${1}" | tr '[a-z]' '[A-Z]'`"
908
-   [ -z "${name}" ] && expansion_usage
909
-   shift
910
-
911
-   if [ $# -ne 0 ]
912
-   then
913
-      [ "${command}" != "read" ] && "${prefix}_usage"
914
-
915
-      command="write"
916
-      value="$1"
917
-      shift
918
-   fi
919
-
920
-   case "${command}" in
921
-      read)
922
-         value="`"_expansion_read" "${name}"`"
923
-         if [ -z "${value}" ]
924
-         then
925
-            value="`eval echo "$"${name}`"
926
-         fi
927
-         if [ ! -z "${value}" ]
928
-         then
929
-            echo "${value}"
930
-         fi
931
-      ;;
1195
+   _generic_main "config" "${KNOWN_CONFIG_KEYS}" "" "$@"
1196
+}
932 1197
 
933
-      delete)
934
-         _expansion_delete "${name}"
935
-      ;;
936 1198
 
937
-      write)
938
-         _expansion_write "${name}" "${value}"
939
-      ;;
940
-   esac
1199
+expansion_main()
1200
+{
1201
+   _generic_main "expansion" "${KNOWN_EXPANSION_KEYS}" "" "$@"
941 1202
 }
942 1203
 
943 1204
 
944
-
945 1205
 setting_main()
946 1206
 {
947
-   local name
948
-   local value
949
-   local command
950
-   local repository
951
-   local expansion
952
-
953
-   command="read"
954
-
955
-   while [ $# -ne 0 ]
956
-   do
957
-      case "$1" in
958
-         -h|-help|--help)
959
-            config_usage
960
-         ;;
961
-
962
-         -r|--repository)
963
-            shift
964
-            [ $# -ne 0 ] || fail "repository name missing"
965
-            repository="$1"
966
-         ;;
967
-
968
-         -*)
969
-            log_error "${MULLE_EXECUTABLE_FAIL_PREFIX}: Unknown option $1"
970
-            config_usage
971
-         ;;
972
-
973
-         *)
974
-            break
975
-         ;;
976
-      esac
977
-
978
-      shift
979
-   done
980
-
981
-   name="$1"
982
-   [ $# -ne 0 ] && shift
983
-
984
-   if [ -z "${name}" -o $# -ne 0 ]
985
-   then
986
-      setting_usage
987
-   fi
988
-
989
-   case "${command}" in
990
-      read)
991
-         if [ -z "${repository}" ]
992
-         then
993
-            value="`read_root_setting "$name"`"
994
-         else
995
-            value="`read_build_setting "${repository}" "$name"`"
996
-         fi
997
-
998
-         if [ -z "${value}" ]
999
-         then
1000
-            value="`eval echo "$"${name}`"
1001
-         fi
1002
-
1003
-         if [ ! -z "${value}" ]
1004
-         then
1005
-            echo "${value}"
1006
-         fi
1007
-      ;;
1008
-   esac
1207
+   _generic_main "setting" "${KNOWN_ROOT_SETTING_KEYS}" "${KNOWN_BUILD_SETTING_KEYS}" "$@"
1009 1208
 }
1010 1209
 
1011
-
1012 1210
 #
1013 1211
 # read some config stuff now
1014 1212
 #
... ...
@@ -67,10 +67,10 @@ _show_path()
67 67
          :
68 68
       fi
69 69
    else
70
-      printf "${C_FAINT}"
70
+      printf "%b" "${