Browse code

some changes for building mulle-aba more conveniently on linux and more

Nat! authored on 08/03/2016 15:20:52
Showing 5 changed files
... ...
@@ -1,3 +1,13 @@
1
+0.19
2
+===
3
+   Forgot a -f on a ln -s , which could result in an irritating output.
4
+   Now also refresh before fetching. mulle-bootstrap will now be able to
5
+   pick up changes in recursive repositories. And fetch additional repos as
6
+   needed, so you don't need to clean dist.
7
+   Produce more helpful output if cmake is missing.
8
+   Experimental support for "mulle-bootstrap clone", which will clone and build
9
+   a remote repository.
10
+
1 11
 0.18
2 12
 ===
3 13
    Refixed: Fix old favorite bug build_ignore became a directory bug) again ...
... ...
@@ -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.18
32
+VERSION=0.19
33 33
 
34 34
 #
35 35
 # This is the main user interface to mulle-bootstrap
... ...
@@ -131,6 +131,7 @@ usage: mulle-bootstrap [-a|-y][-n][-v|-s|-t] [command] [--help]
131 131
                -t turns on shell tracing for development
132 132
 
133 133
  Common user commands:
134
+   clone     : git clone a remote repository and try to bootstrap and build it
134 135
    bootstrap : does fetch and build recursively [default]
135 136
    nomagic   : does fetch and build, but not recursively
136 137
    clean     : cleans mulle-bootstrap produced files.
... ...
@@ -193,6 +194,8 @@ bootstrap()
193 193
       mulle-bootstrap-warn-scripts.sh "${BOOTSTRAP_SUBDIR}" || exit 1
194 194
    fi
195 195
 
196
+   COMMAND="refresh" mulle-bootstrap-refresh.sh  || exit 1
197
+
196 198
    if [ "${DONT_RECURSE}" = "" ]
197 199
    then
198 200
       mulle-bootstrap-fetch.sh || exit 1
... ...
@@ -208,6 +211,7 @@ main()
208 208
 
209 209
    if [ ! -d "${BOOTSTRAP_SUBDIR}" -a \
210 210
       "${command}" != "init" -a \
211
+      "${command}" != "clone" -a \
211 212
       "${command}" != "version"  -a \
212 213
       "${command}" != "convert-pre-0.10" ]
213 214
    then
... ...
@@ -224,6 +228,19 @@ main()
224 224
          DONT_RECURSE=YES bootstrap "$@" || exit 1
225 225
          ;;
226 226
 
227
+      clone)
228
+         set -e
229
+         git clone "$1"
230
+         cd "`basename "$1"`"
231
+         mulle-bootstrap-fetch.sh || exit 1
232
+         if [ -x "./build.sh" ]
233
+         then
234
+            ./build.sh
235
+         else
236
+            COMMAND="install" mulle-bootstrap-build.sh || exit 1
237
+         fi
238
+         ;;
239
+
227 240
       build)
228 241
          COMMAND="refresh" mulle-bootstrap-refresh.sh  || exit 1
229 242
          COMMAND="${command}" mulle-bootstrap-build.sh "$@" || exit 1
... ...
@@ -249,6 +266,7 @@ main()
249 249
          ;;
250 250
 
251 251
       fetch)
252
+         COMMAND="refresh" mulle-bootstrap-refresh.sh  || exit 1
252 253
          DONT_ASK_AFTER_WARNING=YES mulle-bootstrap-fetch.sh "$@" || exit 1
253 254
          ;;
254 255
 
... ...
@@ -266,10 +284,12 @@ main()
266 266
          ;;
267 267
 
268 268
       setup-xcode|xcode)
269
+         COMMAND="refresh" mulle-bootstrap-refresh.sh  || exit 1
269 270
          mulle-bootstrap-xcode.sh "$@"|| exit 1
270 271
          ;;
271 272
 
272 273
       tag)
274
+         COMMAND="refresh" mulle-bootstrap-refresh.sh  || exit 1
273 275
          mulle-bootstrap-tag.sh "$@" || exit 1
274 276
          ;;
275 277
 
... ...
@@ -181,7 +181,7 @@ bootstrap_auto_update()
181 181
       # flatten other folders into our own settings
182 182
       # don't force though, keep first
183 183
       exekutor find "${directory}/.bootstrap/settings" -xdev -mindepth 1 -maxdepth 1 -type d -print0 | \
184
-         exekutor xargs -0 -I % ln -s "${relative}/../"% "${BOOTSTRAP_SUBDIR}.auto/settings"
184
+         exekutor xargs -0 -I % ln -s -f "${relative}/../"% "${BOOTSTRAP_SUBDIR}.auto/settings"
185 185
    fi
186 186
 
187 187
    return 0
... ...
@@ -42,7 +42,7 @@ usage: build [repos]*
42 42
    You can optionally specify the names of the repositories to build.
43 43
    Currently available names are:
44 44
 EOF
45
-   (cd "${CLONES_SUBDIR}" ; ls -1d ) 2> /dev/null
45
+   (cd "${CLONES_SUBDIR}" ; ls -1 ) 2> /dev/null
46 46
 }
47 47
 
48 48
 
... ...
@@ -1336,13 +1336,18 @@ Release"`"
1336 1336
                fi
1337 1337
             fi
1338 1338
 
1339
-            if [ "${preference}" = "cmake" -a -x "${cmake}" ]
1339
+            if [ "${preference}" = "cmake" ]
1340 1340
             then
1341 1341
                if [ -f "${srcdir}/CMakeLists.txt" ]
1342 1342
                then
1343
-                  build_cmake "${configuration}" "${srcdir}" "${builddir}" "${relative}" "${name}" "${sdk}"  || exit 1
1344
-                  hasbuilt=yes
1345
-                  break
1343
+                  if [ ! -x "${cmake}" ]
1344
+                  then
1345
+                     log_warning "Found a CMakeLists.txt, but cmake is not installed"
1346
+                  else
1347
+                     build_cmake "${configuration}" "${srcdir}" "${builddir}" "${relative}" "${name}" "${sdk}"  || exit 1
1348
+                     hasbuilt=yes
1349
+                     break
1350
+                  fi
1346 1351
                fi
1347 1352
             fi
1348 1353
          done
... ...
@@ -45,15 +45,15 @@
45 45
 usage()
46 46
 {
47 47
    cat <<EOF
48
-usage: fetch <install|nonrecursive|update> [repos]*
48
+usage: fetch <install|nonrecursive|update>
49 49
    install      : clone or symlink non-exisiting repositories and other resources
50 50
    nonrecursive : like above, but ignore .bootstrap folders of repositories
51
-   update       : pull repositories
51
+   update       : pull in fetched repositories
52 52
 
53
-   You can specify the names of the repositories to update or fetch.
53
+   You can specify the names of the repositories to update.
54 54
    Currently available names are:
55 55
 EOF
56
-   (cd "${CLONES_SUBDIR}" ; ls -1d ) 2> /dev/null
56
+   (cd "${CLONES_FETCH_SUBDIR}" ; ls -1 ) 2> /dev/null
57 57
 }
58 58
 
59 59
 
... ...
@@ -879,8 +879,8 @@ update_repository()
879 879
    tag="`read_repo_setting "${name}" "tag"`" #repo (sic)
880 880
 
881 881
    dstdir="${CLONES_FETCH_SUBDIR}/${name}"
882
-   exekutor [ -e "${dstdir}" ] || fail "You need to install first, before updating"
883
-   exekutor [ -x "${dstdir}" ] || fail "${name} is not anymore in \"repositories\""
882
+   exekutor [ -e "${dstdir}" ] || fail "You need to fetch \"${name}\" first, before updating"
883
+   exekutor [ -x "${dstdir}" ] || fail "\"${name}\" is not anymore in \"repositories\""
884 884
 
885 885
    log_fetch_action "${url}" "${dstdir}"
886 886
 
... ...
@@ -1050,14 +1050,6 @@ main()
1050 1050
          exit 1
1051 1051
       fi
1052 1052
 
1053
-      #
1054
-      # remove .auto because it's contents could be stale
1055
-      #
1056
-      if [ -d "${BOOTSTRAP_SUBDIR}.auto" ]
1057
-      then
1058
-         exekutor rm -rf "${BOOTSTRAP_SUBDIR}.auto"
1059
-      fi
1060
-
1061 1053
       clone_repositories
1062 1054
 
1063 1055
       install_embedded_repositories