Browse code

version check, reverse update order

Nat! authored on 06-06-2016 23:05:34
Showing 5 changed files
... ...
@@ -37,7 +37,7 @@ find compiler flags, targets, sdks et.c.
37 37
 .bootstrap of the dependencies.
38 38
 * .bootstrap/config should not exist
39 39
 * Folders in `.bootstrap.auto/repos` are the settings inherited from
40
-.bootstrap.
40
+`.bootstrap`.
41 41
 
42 42
 
43 43
 
... ...
@@ -82,9 +82,7 @@ echo "YES" > .bootstrap/settings/{reponame}/proper_skip_install
82 82
 
83 83
 ### I changed something in .bootstrap but nothing happens ?
84 84
 
85
-This can happen, when a .bootstrap.auto was created. The easy solution
86
-is to say `mulle-bootstrap clean dist`.
87
-
85
+This shouldn't really happen. Say `mulle-bootstrap clean dist` and try again.
88 86
 
89 87
 
90 88
 ### My Xcode project's headers do not show up ?
... ...
@@ -116,7 +114,6 @@ MulleScion (iOS Framework)" > .bootstrap/settings/MulleScion/targets"
116 114
 ```
117 115
 
118 116
 
119
-
120 117
 ### mulle-bootstrap does not do what I want  ?
121 118
 
122 119
 Check out the SETTINGS.md file for help about tweaking mulle-bootstrap.
... ...
@@ -150,6 +147,13 @@ but mulle-allocator is also dependent on mulle-thread, then put
150 147
 mulle-thread ahead of mulle-allocator in the `repositories` file.
151 148
 
152 149
 
150
+### Is it a problem if a repository appears twice ?
151
+
152
+Sometimes yes. The dependency manager of mulle-bootstrap is not very
153
+sophisticated. If you have dependencies like A -> B -> C and  A -> C, it's
154
+better for mulle-bootstrap if you just specify A->B and B->C. If you also
155
+declare A->C, you may run into problems.
156
+
153 157
 
154 158
 ### It's not working as I expect now what ?
155 159
 
... ...
@@ -1,3 +1,12 @@
1
+0.26
2
+===
3
+
4
+* Check library scripts version vs. executable version (paranoia)
5
+* Skip Dirty Harry with -f flag.
6
+* improve FAQ a little
7
+* Reverse oder of repositories when updating, because this catches deep
8
+  renames.
9
+
1 10
 0.25
2 11
 ===
3 12
 
... ...
@@ -29,7 +29,8 @@
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.25
32
+VERSION=0.26
33
+export VERSION
33 34
 
34 35
 #
35 36
 # This is the main user interface to mulle-bootstrap
... ...
@@ -130,6 +131,7 @@ do
130 131
    break
131 132
 done
132 133
 
134
+
133 135
 usage()
134 136
 {
135 137
    cat <<EOF
... ...
@@ -319,5 +321,3 @@ main()
319 321
 }
320 322
 
321 323
 main "$@"
322
-
323
-
... ...
@@ -57,42 +57,54 @@ EOF
57 57
 }
58 58
 
59 59
 
60
-check_and_usage_and_help()
61
-{
62
-   case "$COMMAND" in
63
-      install)
64
-         ;;
65
-      nonrecursive)
66
-        COMMAND=install
67
-        DONT_RECURSE="YES"
68
-         ;;
69
-         update)
70
-         ;;
71
-      *)
72
-         usage >&2
73
-         exit 1
74
-         ;;
75
-   esac
76
-}
77 60
 
78
-
79
-if [ "$1" = "-h" -o "$1" = "--help" ]
80
-then
81
-   COMMAND=help
82
-else
83
-   if [ -z "${COMMAND}" ]
61
+while :
62
+do
63
+   if [ "$1" = "-h" -o "$1" = "--help" ]
84 64
    then
85
-      COMMAND=${1:-"install"}
86
-      [ $# -eq 0 ] || shift
65
+      usage >&2
66
+      exit 1
87 67
    fi
88 68
 
89
-   if [ "${MULLE_BOOTSTRAP}" = "mulle-bootstrap" ]
69
+   if [ "$1" = "-f" ]
90 70
    then
91
-      COMMAND="install"
71
+      FORCE="YES"
72
+      [ $# -eq 0 ] || shift
73
+      continue
92 74
    fi
75
+
76
+   break
77
+done
78
+
79
+
80
+
81
+if [ -z "${COMMAND}" ]
82
+then
83
+   COMMAND=${1:-"install"}
84
+   [ $# -eq 0 ] || shift
85
+fi
86
+
87
+if [ "${MULLE_BOOTSTRAP}" = "mulle-bootstrap" ]
88
+then
89
+   COMMAND="install"
93 90
 fi
94 91
 
95
-check_and_usage_and_help
92
+
93
+case "$COMMAND" in
94
+   install)
95
+      ;;
96
+   nonrecursive)
97
+     COMMAND=install
98
+     DONT_RECURSE="YES"
99
+      ;;
100
+   update)
101
+      ;;
102
+   *)
103
+      usage >&2
104
+      exit 1
105
+      ;;
106
+esac
107
+
96 108
 
97 109
 
98 110
 #
... ...
@@ -1022,6 +1034,8 @@ update_repositories()
1022 1034
       done
1023 1035
    else
1024 1036
       clones="`read_fetch_setting "repositories"`"
1037
+      clones="`echo "${clones}" | sed '1!G;h;$!d'`"  # reverse lines
1038
+
1025 1039
       if [ "${clones}" != "" ]
1026 1040
       then
1027 1041
          IFS="
... ...
@@ -1040,6 +1054,8 @@ update_repositories()
1040 1054
          IFS="
1041 1055
 "
1042 1056
          clones="`read_fetch_setting "repositories"`"
1057
+         clones="`echo "${clones}" | sed '1!G;h;$!d'`"  # reverse lines
1058
+
1043 1059
          for clone in ${clones}
1044 1060
          do
1045 1061
             IFS="${old}"
... ...
@@ -1075,6 +1091,8 @@ update_embedded_repositories()
1075 1091
    old="${IFS:-" "}"
1076 1092
 
1077 1093
    clones="`read_fetch_setting "embedded_repositories"`"
1094
+   clones="`echo "${clones}" | sed '1!G;h;$!d'`"  # reverse lines
1095
+
1078 1096
    if [ "${clones}" != "" ]
1079 1097
    then
1080 1098
       IFS="
... ...
@@ -1127,8 +1145,7 @@ main()
1127 1145
       fi
1128 1146
    fi
1129 1147
 
1130
-   ensure_consistency
1131
-   create_file_if_missing "${CLONESFETCH_SUBDIR}/.fetch_update_started"
1148
+   [ -z "${FORCE}" ] && ensure_consistency
1132 1149
 
1133 1150
    #
1134 1151
    # Run prepare scripts if present
... ...
@@ -1139,14 +1156,16 @@ main()
1139 1156
       install_gems
1140 1157
       install_pips
1141 1158
 
1142
-      clone_repositories
1159
+      create_file_if_missing "${CLONESFETCH_SUBDIR}/.fetch_update_started"
1143 1160
 
1161
+      clone_repositories
1144 1162
       install_embedded_repositories
1145 1163
 
1146 1164
       check_tars
1147 1165
    else
1148
-      update_repositories "$@"
1166
+      create_file_if_missing "${CLONESFETCH_SUBDIR}/.fetch_update_started"
1149 1167
 
1168
+      update_repositories "$@"
1150 1169
       update_embedded_repositories
1151 1170
    fi
1152 1171
 
... ...
@@ -29,6 +29,14 @@
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
+EXEC_VERSION=0.26
33
+
34
+if [ "${EXEC_VERSION}" != "${VERSION}" ]
35
+then
36
+   echo "mulle-bootstrap is misinstalled (${EXEC_VERSION} vs ${VERSION})" >&2
37
+   exit 1
38
+fi
39
+
32 40
 #
33 41
 # read local environment
34 42
 # source this file