Browse code

Fix bug with ${FOO:-xx} expansion Fix bug with fetch_needed returning falsely true Avoid default setting log output duplication Fix run command. Fix problem listing root settings.

Nat! authored on 29-04-2017 01:09:04
Showing 5 changed files
... ...
@@ -1,4 +1,3 @@
1
-* Try to use different build dir than just build.
2 1
 * Write "doctor" command to find common problems.
3
-* XCodebuild somehow resolves the symbolic link, which makes it use the wrong
4
-  dependency library. MUST use absolute paths.
2
+* Make -u option to append .darwin and .linux to settings. In raw mode,
3
+list non-OS settings ?
5 4
\ No newline at end of file
... ...
@@ -31,7 +31,7 @@
31 31
 #
32 32
 MULLE_EXECUTABLE_VERSION_MAJOR=3
33 33
 MULLE_EXECUTABLE_VERSION_MINOR=5
34
-MULLE_EXECUTABLE_VERSION_PATCH=2
34
+MULLE_EXECUTABLE_VERSION_PATCH=3
35 35
 
36 36
 MULLE_EXECUTABLE_VERSION="${MULLE_EXECUTABLE_VERSION_MAJOR}.${MULLE_EXECUTABLE_VERSION_MINOR}.${MULLE_EXECUTABLE_VERSION_PATCH}"
37 37
 
... ...
@@ -591,11 +591,11 @@ fetch_needed()
591 591
    local creator
592 592
 
593 593
    creator="`cat "${BOOTSTRAP_DIR}.auto/.creator" 2> /dev/null`"
594
-   if [ "${creator}" != "${MULLE_EXECUTABLE}" ]
594
+   if [ ! -z "${creator}" -a "${creator}" != "${MULLE_EXECUTABLE}" ]
595 595
    then
596 596
       if [ -d "${BOOTSTRAP_DIR}.auto" ]
597 597
       then
598
-         log_verbose "Need fetch because ${BOOTSTRAP_DIR}.auto was created by ${creator}."
598
+         log_verbose "Need fetch because ${BOOTSTRAP_DIR}.auto was created by \"${creator}\"."
599 599
       else
600 600
          log_verbose "Need fetch because ${BOOTSTRAP_DIR}.auto does not exist."
601 601
       fi
... ...
@@ -711,15 +711,15 @@ _expanded_variables()
711 711
    local rval
712 712
 
713 713
    rval=0
714
-   key="`echo "${string}" | sed -n 's/^\(.*\)\${\([A-Za-z_][A-Za-z0-9_:-]*\)}\(.*\)$/\2/p'`"
714
+   key="`echo "${string}" | sed -n 's/^\(.*\)\${\([A-Za-z_][A-Za-z0-9_:.\/&;#@-]*\)}\(.*\)$/\2/p'`"
715 715
    if [ -z "${key}" ]
716 716
    then
717 717
       echo "${string}"
718 718
       return $rval
719 719
    fi
720 720
 
721
-   prefix="`echo "${string}" | sed 's/^\(.*\)\${\([A-Za-z_][A-Za-z0-9_:-]*\)}\(.*\)$/\1/'`"
722
-   suffix="`echo "${string}" | sed 's/^\(.*\)\${\([A-Za-z_][A-Za-z0-9_:-]*\)}\(.*\)$/\3/'`"
721
+   prefix="`echo "${string}" | sed -n 's/^\(.*\)\${\([A-Za-z_][A-Za-z0-9_:.\/&;#@-]*\)}\(.*\)$/\1/p'`"
722
+   suffix="`echo "${string}" | sed -n 's/^\(.*\)\${\([A-Za-z_][A-Za-z0-9_:.\/&;#@-]*\)}\(.*\)$/\3/p'`"
723 723
 
724 724
    default="" # crazy linux bug, where local vars are reused ?
725 725
    tmp="`echo "${key}" | sed -n 's/^\([A-Za-z_][A-Za-z0-9_]*\)[:][-]\(.*\)$/\1/p'`"
... ...
@@ -731,12 +731,16 @@ _expanded_variables()
731 731
 
732 732
    if [ ! -z "${altbootstrap}" ]
733 733
    then
734
-      default="`(
734
+      local xdefault
735
+
736
+      xdefault="`(
735 737
          BOOTSTRAP_DIR="${altbootstrap}"
736 738
          MULLE_BOOTSTRAP_SETTINGS_NO_AUTO="YES"
737 739
 
738
-         read_root_setting "${key}" "${default}"
740
+         read_root_setting "${key}"
739 741
       )`"
742
+
743
+      default="${xdefault:-${default}}"
740 744
    fi
741 745
 
742 746
    value="`read_root_setting "${key}"`"
... ...
@@ -578,7 +578,7 @@ run_main()
578 578
    # use mulle-bootstrap this way to get properly deferred
579 579
    # paths
580 580
    #
581
-   commandline="`${MULLE_EXECUTABLE} -s paths -1 -q "'" run addictions `"
581
+   commandline="`${MULLE_EXECUTABLE} -s paths -1 -q "'" run`"
582 582
    while [ $# -ne 0 ]
583 583
    do
584 584
       value="$1"
... ...
@@ -469,7 +469,6 @@ _read_home_setting()
469 469
 }
470 470
 
471 471
 
472
-
473 472
 list_build_directories()
474 473
 {
475 474
    local directory="$1"
... ...
@@ -491,7 +490,6 @@ list_build_directories()
491 490
 }
492 491
 
493 492
 
494
-
495 493
 list_dir_settings()
496 494
 {
497 495
    local directory="$1"
... ...
@@ -828,7 +826,6 @@ ${result}"
828 826
 }
829 827
 
830 828
 
831
-
832 829
 _merge_settings_in_front()
833 830
 {
834 831
    local settings1="$1"
... ...
@@ -1069,15 +1066,12 @@ _setting_read()
1069 1066
    local key="$1"
1070 1067
    local repository="$2"
1071 1068
 
1072
-   local bootstrapdir
1073 1069
    local directory
1074 1070
 
1075 1071
    if [ "${OPTION_PROCESSED_READ}" = "NO" ]
1076 1072
    then
1077
-      bootstrapdir="`_chosen_bootstrapdir`"
1078 1073
       directory="`_chosen_setting_directory "${repository}"`"
1079
-      _read_setting "${directory}/${name}"
1080
-
1074
+      _read_setting "${directory}/${key}"
1081 1075
       return
1082 1076
    fi
1083 1077