Browse code

remove python dependency

Nat! authored on 20-05-2016 14:06:38
Showing 3 changed files
... ...
@@ -11,6 +11,8 @@ Here is an example, that installs **mulle-bootstrap** into /tmp:
11 11
 ```console
12 12
 ./mulle-bootstrap bootstrap /tmp
13 13
 ```
14
+
15
+
14 16
 ## What now ?
15 17
 
16 18
 Make sure /usr/local/bin is in your PATH, and try the examples contained in
... ...
@@ -3,6 +3,7 @@
3 3
 
4 4
 *  Fix releasenotes underscores
5 5
 *  Fix xcodebuild path
6
+*  Remove python dependency
6 7
 
7 8
 
8 9
 0.23
... ...
@@ -300,10 +300,33 @@ realpath()
300 300
 }
301 301
 
302 302
 # ----
303
-
303
+# stolen from: https://stackoverflow.com/questions/2564634/convert-absolute-path-into-relative-path-given-a-current-directory-using-bash
304
+# because the python dependency irked me
305
+#
304 306
 relative_path_between()
305 307
 {
306
-   python -c "import os.path; print os.path.relpath( '$1', '$2')"
308
+    [ $# -ge 1 ] && [ $# -le 2 ] || return 1
309
+    current="${2:+"$1"}"
310
+    target="${2:-"$1"}"
311
+    [ "$target" != . ] || target=/
312
+    target="/${target##/}"
313
+    [ "$current" != . ] || current=/
314
+    current="${current:="/"}"
315
+    current="/${current##/}"
316
+    appendix="${target##/}"
317
+    relative=''
318
+    while appendix="${target#"$current"/}"
319
+        [ "$current" != '/' ] && [ "$appendix" = "$target" ]; do
320
+        if [ "$current" = "$appendix" ]; then
321
+            relative="${relative:-.}"
322
+            echo "${relative#/}"
323
+            return 0
324
+        fi
325
+        current="${current%/*}"
326
+        relative="$relative${relative:+/}.."
327
+    done
328
+    relative="$relative${relative:+${appendix:+/}}${appendix#/}"
329
+    echo "$relative"
307 330
 }
308 331
 
309 332
 
... ...
@@ -788,7 +811,7 @@ ensure_consistency()
788 811
    if [ -f "${CLONESFETCH_SUBDIR}/.fetch_update_started" ]
789 812
    then
790 813
       log_error "A previous fetch or update was incomplete.
791
-Suggested resolution:
814
+Suggested resolution (in $PWD):
792 815
     ${C_RESET_BOLD}mulle-bootstrap clean dist${C_ERROR}
793 816
     ${C_RESET_BOLD}mulle-bootstrap${C_ERROR}
794 817