Browse code

Fix library-path for homebrew

Nat! authored on 21/03/2017 18:31:09
Showing 4 changed files
... ...
@@ -56,6 +56,7 @@ devbranch="`git rev-parse --abbrev-ref HEAD`"
56 56
 ./bin/generate-brew-formula.sh  > ../homebrew-$TAP/mulle-bootstrap.rb
57 57
 (
58 58
 	cd ../homebrew-$TAP ; \
59
+   git add mulle-bootstrap.rb ; \
59 60
  	git commit -m "${TAG} release of mulle-bootstrap" mulle-bootstrap.rb ; \
60 61
  	git push origin master
61 62
 )
... ...
@@ -30,7 +30,7 @@
30 30
 #   POSSIBILITY OF SUCH DAMAGE.
31 31
 MULLE_EXECUTABLE_VERSION_MAJOR=3
32 32
 MULLE_EXECUTABLE_VERSION_MINOR=0
33
-MULLE_EXECUTABLE_VERSION_PATCH=0
33
+MULLE_EXECUTABLE_VERSION_PATCH=1
34 34
 
35 35
 MULLE_EXECUTABLE_VERSION="${MULLE_EXECUTABLE_VERSION_MAJOR}.${MULLE_EXECUTABLE_VERSION_MINOR}.${MULLE_EXECUTABLE_VERSION_PATCH}"
36 36
 
... ...
@@ -139,15 +139,50 @@ _bootstrap_main()
139 139
 }
140 140
 
141 141
 
142
+#
143
+# stolen from:
144
+# http://stackoverflow.com/questions/1055671/how-can-i-get-the-behavior-of-gnus-readlink-f-on-a-mac
145
+# ----
146
+#
147
+_prepend_path_if_relative()
148
+{
149
+   case "$2" in
150
+      /*)
151
+         echo "$2"
152
+         ;;
153
+      *)
154
+         echo "$1/$2"
155
+         ;;
156
+   esac
157
+}
158
+
159
+
160
+resolve_symlinks()
161
+{
162
+   local dir_context
163
+   local linkpath
164
+
165
+   if linkpath="`readlink "$1"`"
166
+   then
167
+      dir_context=`dirname -- "$1"`
168
+      resolve_symlinks "`_prepend_path_if_relative "${dir_context}" "${linkpath}"`"
169
+   else
170
+      echo "$1"
171
+   fi
172
+}
173
+
174
+
142 175
 bootstrap_libexec_path()
143 176
 {
177
+   local path="$1"
178
+
144 179
    local exedir
145 180
    local exedirpath
146 181
    local prefix
147 182
    local libexecpath
148 183
 
149
-   exedir="`dirname "$1"`"
150
-   exedirpath="`( cd "${exedir}" ; pwd -P )`" || fail "failed to get pwd"
184
+   path="`resolve_symlinks "${path}"`"
185
+   exedirpath="`dirname "${path}"`"
151 186
    prefix="`dirname "${exedirpath}"`"
152 187
    libexecpath="${prefix}/libexec/mulle-bootstrap"
153 188
 
... ...
@@ -170,7 +205,7 @@ bootstrap_init()
170 170
    libexecpath="`bootstrap_libexec_path "$0"`"
171 171
    if [ -z "${libexecpath}" ]
172 172
    then
173
-      echo "could not find libexec for mulle-bootstrap" >&2
173
+      echo "Fatal Error: Could not find libexec for mulle-bootstrap" >&2
174 174
       exit 1
175 175
    fi
176 176
 
... ...
@@ -30,7 +30,7 @@
30 30
 #   POSSIBILITY OF SUCH DAMAGE.
31 31
 MULLE_EXECUTABLE_VERSION_MAJOR=3
32 32
 MULLE_EXECUTABLE_VERSION_MINOR=0
33
-MULLE_EXECUTABLE_VERSION_PATCH=0
33
+MULLE_EXECUTABLE_VERSION_PATCH=1
34 34
 
35 35
 MULLE_EXECUTABLE_VERSION="${MULLE_EXECUTABLE_VERSION_MAJOR}.${MULLE_EXECUTABLE_VERSION_MINOR}.${MULLE_EXECUTABLE_VERSION_PATCH}"
36 36
 
... ...
@@ -78,15 +78,45 @@ EOF
78 78
 }
79 79
 
80 80
 
81
+_prepend_path_if_relative()
82
+{
83
+   case "$2" in
84
+      /*)
85
+         echo "$2"
86
+         ;;
87
+      *)
88
+         echo "$1/$2"
89
+         ;;
90
+   esac
91
+}
92
+
93
+
94
+resolve_symlinks()
95
+{
96
+   local dir_context
97
+   local linkpath
98
+
99
+   if linkpath="`readlink "$1"`"
100
+   then
101
+      dir_context=`dirname -- "$1"`
102
+      resolve_symlinks "`_prepend_path_if_relative "${dir_context}" "${linkpath}"`"
103
+   else
104
+      echo "$1"
105
+   fi
106
+}
107
+
108
+
81 109
 bootstrap_libexec_path()
82 110
 {
111
+   local path="$1"
112
+
83 113
    local exedir
84 114
    local exedirpath
85 115
    local prefix
86 116
    local libexecpath
87 117
 
88
-   exedir="`dirname "$1"`"
89
-   exedirpath="`( cd "${exedir}" ; pwd -P )`" || fail "failed to get pwd"
118
+   path="`resolve_symlinks "${path}"`"
119
+   exedirpath="`dirname "${path}"`"
90 120
    prefix="`dirname "${exedirpath}"`"
91 121
    libexecpath="${prefix}/libexec/mulle-bootstrap"
92 122
 
... ...
@@ -404,39 +404,6 @@ path_concat()
404 404
 }
405 405
 
406 406
 
407
-#
408
-# stolen from:
409
-# http://stackoverflow.com/questions/1055671/how-can-i-get-the-behavior-of-gnus-readlink-f-on-a-mac
410
-# ----
411
-#
412
-_prepend_path_if_relative()
413
-{
414
-   case "$2" in
415
-      /*)
416
-         echo "$2"
417
-         ;;
418
-      *)
419
-         echo "$1/$2"
420
-         ;;
421
-   esac
422
-}
423
-
424
-
425
-resolve_symlinks()
426
-{
427
-   local dir_context
428
-   local linkpath
429
-
430
-   if linkpath="`readlink "$1"`"
431
-   then
432
-      dir_context=`dirname -- "$1"`
433
-      resolve_symlinks "`_prepend_path_if_relative "${dir_context}" "${linkpath}"`"
434
-   else
435
-      echo "$1"
436
-   fi
437
-}
438
-
439
-
440 407
 _canonicalize_dir_path()
441 408
 {
442 409
    (