Browse code

fix dispense setting bug and setting listing bug

Nat! authored on 26-06-2017 01:10:41
Showing 5 changed files
... ...
@@ -1,6 +1,13 @@
1
+### 3.8.2
2
+
3
+* fix setting listings for os specific settings and build settings
4
+in general
5
+* fix reading of dispense settings
6
+
7
+
1 8
 ### 3.8.1
2 9
 
3
-* fix archive extraction on linux 
10
+* fix archive extraction on linux
4 11
 
5 12
 ### 3.8.0
6 13
 
... ...
@@ -31,7 +31,7 @@
31 31
 #
32 32
 MULLE_EXECUTABLE_VERSION_MAJOR=3
33 33
 MULLE_EXECUTABLE_VERSION_MINOR=8
34
-MULLE_EXECUTABLE_VERSION_PATCH=1
34
+MULLE_EXECUTABLE_VERSION_PATCH=2
35 35
 
36 36
 MULLE_EXECUTABLE_VERSION="${MULLE_EXECUTABLE_VERSION_MAJOR}.${MULLE_EXECUTABLE_VERSION_MINOR}.${MULLE_EXECUTABLE_VERSION_PATCH}"
37 37
 
... ...
@@ -259,7 +259,7 @@ dispense_files()
259 259
       if dir_has_files "${src}"
260 260
       then
261 261
 
262
-         dst="${REFERENCE_DEPENDENCIES_DIR}${dirpath}"
262
+         dst="`add_component "${REFERENCE_DEPENDENCIES_DIR}" "${dirpath}"`"
263 263
          mkdir_if_missing "${dst}"
264 264
 
265 265
          # this fails with more nested header set ups, need to fix!
... ...
@@ -284,7 +284,7 @@ dispense_headers()
284 284
 
285 285
    local headerpath
286 286
 
287
-   headerpath="`read_build_setting "$1" "dispense_headers_path" "/${HEADER_DIR_NAME}"`"
287
+   headerpath="`read_build_setting "${name}" "dispense_headers_path" "${HEADER_DIR_NAME}"`"
288 288
 
289 289
    local src
290 290
    IFS="
... ...
@@ -306,7 +306,7 @@ dispense_resources()
306 306
 
307 307
    local resourcepath
308 308
 
309
-   resourcepath="`read_build_setting "$1" "dispense_resources_path" "/${RESOURCE_DIR_NAME}"`"
309
+   resourcepath="`read_build_setting "$1" "dispense_resources_path" "${RESOURCE_DIR_NAME}"`"
310 310
 
311 311
    local src
312 312
    IFS="
... ...
@@ -2066,7 +2066,7 @@ build()
2066 2066
 
2067 2067
    local preferences
2068 2068
    local directory
2069
-   
2069
+
2070 2070
    #
2071 2071
    # repo may override how it wants to be build
2072 2072
    #
... ...
@@ -475,13 +475,13 @@ add_component()
475 475
    local filepath="$1"
476 476
    local component="$2"
477 477
 
478
-   [ -z "${COMPONENT_SEPARATOR}" ] && fail "COMPONENT_SEPARATOR is undefined"
478
+   [ -z "${COMPONENT_SEPARATOR}" ] && internal_fail "COMPONENT_SEPARATOR is undefined"
479 479
 
480 480
    if [ -z "${filepath}" ]
481 481
    then
482 482
       echo "${component}"
483 483
    else
484
-      if [ -z "${component}" ]
484
+      if [ -z "${component}" -o "${component}" = "${COMPONENT_SEPARATOR}" ]
485 485
       then
486 486
          echo "${filepath}"
487 487
       else
... ...
@@ -475,18 +475,30 @@ _read_home_setting()
475 475
 list_build_directories()
476 476
 {
477 477
    local directory="$1"
478
+   local flags="$2"
479
+
480
+   [ -z "${directory}" ] && internal_fail "empty directory path"
478 481
 
479 482
    local filename
480 483
    local name
481 484
 
485
+   log_info "$PWD"
482 486
    IFS="
483 487
 "
484
-   for filename in `ls -1 "${directory}/*.build" 2> /dev/null`
488
+   for filename in `ls -1 "${directory}"` 
485 489
    do
486
-      IFS="${DEFAULT_IFS}"
487
-
488
-      name="`basename -- "${filename}" ".build"`"
489
-      echo "# ${MULLE_EXECUTABLE} setting -r '${name}' -l"
490
+      path="${directory}/${filename}"
491
+      if [ -d "${path}" ]
492
+      then
493
+         case "${path}" in
494
+            *.build)
495
+               IFS="${DEFAULT_IFS}"
496
+
497
+               name="`basename -- "${path}" ".build"`"
498
+               echo "# ${MULLE_EXECUTABLE} setting ${flags} -b '${name}' -l"
499
+            ;;
500
+         esac
501
+      fi
490 502
    done
491 503
 
492 504
    IFS="${DEFAULT_IFS}"
... ...
@@ -720,12 +732,10 @@ read_yes_no_config_setting()
720 732
 
721 733
 read_sane_config_path_setting()
722 734
 {
723
-   local key
724
-   local value
725
-   local default
735
+   local key="$1"
736
+   local default="$2"
726 737
 
727
-   key="$1"
728
-   default="$2"
738
+   local value
729 739
 
730 740
    value="`read_config_setting "${key}" "${default}"`"
731 741
    if [ $? -eq 0 ]
... ...
@@ -888,9 +898,7 @@ merge_settings_in_front()
888 898
 #
889 899
 all_build_flag_keys()
890 900
 {
891
-   local package
892
-
893
-   package="$1"
901
+   local package="$1"
894 902
 
895 903
    local keys1
896 904
    local keys2
... ...
@@ -960,7 +968,7 @@ _chosen_setting_directory()
960 968
 }
961 969
 
962 970
 
963
-SETTING_KEY_REGEXP='^[a-z_][a-z_0-9]*$'
971
+SETTING_KEY_REGEXP='^[A-Za-z_][A-Za-z_0-9.]*$'
964 972
 
965 973
 
966 974
 list_local_settings()
... ...
@@ -993,7 +1001,8 @@ _setting_list()
993 1001
                         _unescape_linefeeds
994 1002
 
995 1003
       log_info "Available repository settings:"
996
-      list_build_directories
1004
+      list_build_directories "${BOOTSTRAP_DIR}.local" ""
1005
+      list_build_directories "${BOOTSTRAP_DIR}" "-g"
997 1006
 
998 1007
       return
999 1008
    fi
... ...
@@ -1483,14 +1492,16 @@ _generic_main()
1483 1492
          if [ ! -z "${known_keys_1}" ]
1484 1493
          then
1485 1494
             local match
1495
+            local keypart
1486 1496
 
1487
-            match="`echo "${known_keys_1}" | fgrep -s -x "${key}"`"
1497
+            keypart="`cut -d. -f1 <<< "${key}"`"
1498
+            match="`echo "${known_keys_1}" | fgrep -s -x "${keypart}"`"
1488 1499
             if [ -z "${match}" ]
1489 1500
             then
1490
-               match="`echo "${known_keys_2}" | fgrep -s -x "${key}"`"
1501
+               match="`echo "${known_keys_2}" | fgrep -s -x "${keypart}"`"
1491 1502
                if [ -z "${match}" ]
1492 1503
                then
1493
-                  log_warning "${key} is not a known key. Maybe OK, maybe not."
1504
+                  log_warning "${keypart} is not a known key. Maybe OK, maybe not."
1494 1505
                fi
1495 1506
             fi
1496 1507
          fi