Browse code

use uname to find platform specific fetch settings

Nat! authored on 17-10-2015 11:46:18
Showing 6 changed files
... ...
@@ -1,3 +1,13 @@
1
+0.9.9
2
+===
3
+   Fetch settings can be platform specific by using the `uname` as a file
4
+   extension. e.g. gits.Darwin. Other settings may follow, if the need arises.
5
+   So far it hasn't.
6
+
7
+0.9.8
8
+===
9
+   Brings more Linux fixes
10
+
1 11
 0.9.7
2 12
 ===
3 13
    Allow mulle-bootstrap version to work everywhere.
... ...
@@ -2,7 +2,3 @@
2 2
 git://git.savannah.gnu.org/readline.git
3 3
 # A cmake project
4 4
 https://github.com/madler/zlib
5
-# An Xcode project
6
-https://github.com/mulle-nat/Finch.git
7
-# git@github.com:mulle-nat/Finch.git
8
-
9 5
new file mode 100644
... ...
@@ -0,0 +1,8 @@
1
+# A configure project
2
+git://git.savannah.gnu.org/readline.git
3
+# A cmake project
4
+https://github.com/madler/zlib
5
+# An Xcode project
6
+https://github.com/mulle-nat/Finch.git
7
+# git@github.com:mulle-nat/Finch.git
8
+
... ...
@@ -29,7 +29,7 @@
29 29
 #   ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 30
 #   POSSIBILITY OF SUCH DAMAGE.
31 31
 
32
-VERSION=0.9.8
32
+VERSION=0.9.9
33 33
 
34 34
 #
35 35
 # This is the main user interface to mulle-bootstrap
... ...
@@ -109,6 +109,7 @@ else
109 109
             MULLE_BOOTSTRAP_TRACE=
110 110
             MULLE_BOOTSTRAP_TERSE="YES"
111 111
             export MULLE_BOOTSTRAP_TERSE
112
+
112 113
             GITFLAGS="-q"
113 114
             export GITFLAGS
114 115
             [ $# -eq 0 ] || shift
... ...
@@ -1164,8 +1164,6 @@ build_script()
1164 1164
 
1165 1165
    suffix="`determine_suffix "${configuration}" "${sdk}"`"
1166 1166
    collect_and_dispense_product "${name}" "${suffix}" || internal_fail "collect failed silently"
1167
-
1168
-   return $rval
1169 1167
 }
1170 1168
 
1171 1169
 
... ...
@@ -109,13 +109,17 @@ _read_setting()
109 109
       value="${file}"
110 110
       if [ "$MULLE_BOOTSTRAP_VERBOSE" = "YES"  ]
111 111
       then
112
-         log_fluff "${C_MAGENTA}`basename "${file}"`${C_FLUFF} found as ${C_RESET}${file}${C_FLUFF}${C_FLUFF}"
112
+         local os
113
+         os="`uname`"
114
+         log_fluff "${C_MAGENTA}`basename "${file}" ".${os}"`${C_FLUFF} found as ${C_RESET}${file}${C_FLUFF}${C_FLUFF}"
113 115
       fi
114 116
    else
115 117
       value=`egrep -v '^#|^[ ]*$' "${file}"`
116 118
       if [ "$MULLE_BOOTSTRAP_VERBOSE" = "YES"  ]
117 119
       then
118
-         log_fluff "Setting ${C_MAGENTA}`basename "${file}"`${C_FLUFF} found in ${C_RESET}${file}${C_FLUFF} as ${C_MAGENTA}\"${value}\"${C_FLUFF}"
120
+         local os
121
+         os="`uname`"
122
+         log_fluff "Setting ${C_MAGENTA}`basename "${file}" ".${os}"`${C_FLUFF} found in ${C_RESET}${file}${C_FLUFF} as ${C_MAGENTA}${value}${C_FLUFF}"
119 123
       fi
120 124
    fi
121 125
 
... ...
@@ -160,7 +164,7 @@ _read_environment_setting()
160 164
 
161 165
    if [ "${MULLE_BOOTSTRAP_VERBOSE}" = "YES" ]
162 166
    then
163
-      log_trace "setting ${name} found in environment variable ${envname} as \"${value}\""
167
+      log_trace "Setting ${C_MAGENTA}${name}${C_TRACE} found in environment variable ${C_RESET}${envname}${C_TRACE} as ${C_MAGENTA}${value}${C_TRACE}"
164 168
    fi
165 169
 
166 170
    warn_environment_setting "${envname}"
... ...
@@ -195,7 +199,7 @@ _read_local_setting()
195 199
 
196 200
    if [ "${MULLE_BOOTSTRAP_VERBOSE}" = "YES" ]
197 201
    then
198
-      log_trace "setting ${name} found in ~/.mulle-bootstrap as \"${value}\""
202
+      log_trace "Setting ${C_MAGENTA}${name}${C_TRACE} found in ${C_RESET}~/.mulle-bootstrap${C_TRACE} as ${C_MAGENTA}${value}${C_TRACE}"
199 203
    fi
200 204
    warn_user_setting "${HOME}/.mulle-bootstrap/${name}"
201 205
 
... ...
@@ -210,33 +214,28 @@ _read_bootstrap_setting()
210 214
 {
211 215
    local name
212 216
    local value
213
-   local suffix1
214
-   local suffix2
215
-   local suffix3
217
+   local suffix
216 218
 
217 219
    name="$1"
218
-   suffix1="$2"
219
-   suffix2="$3"
220
-   suffix3="$4"
220
+   shift
221 221
 
222
-   [ $# -ne 4 ] && internal_fail "parameterization error"
223
-   [ "$name" = "" ] && internal_fail "missing parameters in _read_bootstrap_setting"
222
+   [ $# -gt 0 ]      || internal_fail "parameterization error"
223
+   [ ! -z "${name}" ] || internal_fail "missing parameters in _read_bootstrap_setting"
224 224
 
225
-   value="`_read_setting "${BOOTSTRAP_SUBDIR}${suffix1}/${name}"`"
226
-   if [ $? -ne 0 ]
227
-   then
228
-      value="`_read_setting "${BOOTSTRAP_SUBDIR}${suffix2}/${name}"`"
229
-      if [ $? -ne 0 ]
225
+   while [ $# -gt 0 ]
226
+   do
227
+      suffix="${1}"
228
+      shift
229
+
230
+      value="`_read_setting "${BOOTSTRAP_SUBDIR}${suffix}/${name}"`"
231
+      if [ $? -eq 0 ]
230 232
       then
231
-         value="`_read_setting "${BOOTSTRAP_SUBDIR}${suffix3}/${name}"`"
232
-         if [ $? -ne 0 ]
233
-         then
234
-            return 2
235
-         fi
233
+         echo "${value}"
234
+         return 0
236 235
       fi
237
-   fi
236
+   done
238 237
 
239
-   echo "$value"
238
+   return 2
240 239
 }
241 240
 
242 241
 
... ...
@@ -434,10 +433,21 @@ read_fetch_setting()
434 433
    name="$1"
435 434
    default="$2"
436 435
 
437
-   value="`_read_bootstrap_setting "${name}" ".auto" ".local" ""`"
436
+   local os
437
+
438
+   value="`_read_bootstrap_setting "${name}" ".auto" ".local"`"
438 439
    if [ $? -ne 0 ]
439 440
    then
440
-      value="${default}"
441
+      os="`uname`"
442
+      value="`_read_bootstrap_setting "${name}.${os}" ""`"
443
+      if [ $? -ne 0 ]
444
+      then
445
+         value="`_read_bootstrap_setting "${name}" ""`"
446
+         if [ $? -ne 0 ]
447
+         then
448
+           value="${default}"
449
+         fi
450
+      fi
441 451
    fi
442 452
 
443 453
    echo "$value"