Browse code

* fix some problems with tar archives * mulle-bootstrap shell is moved to mulle-sde, a new project

Nat! authored on 28-07-2017 17:37:53 • Nat! committed on 29-07-2017 16:58:29
Showing 12 changed files
... ...
@@ -56,7 +56,6 @@ src/mulle-bootstrap-repositories.sh
56 56
 src/mulle-bootstrap-scm.sh
57 57
 src/mulle-bootstrap-scripts.sh
58 58
 src/mulle-bootstrap-settings.sh
59
-src/mulle-bootstrap-shell.sh
60 59
 src/mulle-bootstrap-show.sh
61 60
 src/mulle-bootstrap-snip.sh
62 61
 src/mulle-bootstrap-status.sh
... ...
@@ -75,9 +75,6 @@ dependencies with **cmake**. It will place the headers and the produced
75 75
 libraries into the `dependencies/lib`  and `dependencies/include` folders.
76 76
 
77 77
 
78
-Now you can enter your new "virtual environment" with `mulle-bootstrap shell`.
79
-
80
-
81 78
 ## Tell me more
82 79
 
83 80
 * [How to install](dox/INSTALL.md)
... ...
@@ -1,3 +1,8 @@
1
+### 3.9.3
2
+
3
+* fix some problems with tar archives
4
+* subcommand !!! `mulle-bootstrap shell` has been moved to mulle-sde, a new project
5
+
1 6
 ### 3.9.2
2 7
 
3 8
 * fix for github tar archives having the same name
... ...
@@ -9,7 +9,6 @@ in it and you are all set:
9 9
 
10 10
 ```console
11 11
 mulle-bootstrap
12
-mulle-bootstrap shell
13 12
 ```
14 13
 
15 14
 `mulle-bootstrap` is the shortened command of `mulle-bootstrap bootstrap`, which
... ...
@@ -24,12 +23,6 @@ in turn executes
24 23
 Upgrade all dependencies. You need to build afterwards again.
25 24
 
26 25
 
27
-#### mulle-bootstrap shell
28
-
29
-Start a shell with the environment set up, asto execute binaries from
30
-`dependencies/bin`.
31
-
32
-
33 26
 #### mulle-bootstrap clean dist
34 27
 
35 28
 If mulle-bootstrap painted itself in the corner and produces errors, you can't
... ...
@@ -31,7 +31,7 @@
31 31
 #
32 32
 MULLE_EXECUTABLE_VERSION_MAJOR=3
33 33
 MULLE_EXECUTABLE_VERSION_MINOR=9
34
-MULLE_EXECUTABLE_VERSION_PATCH=2
34
+MULLE_EXECUTABLE_VERSION_PATCH=3
35 35
 
36 36
 MULLE_EXECUTABLE_VERSION="${MULLE_EXECUTABLE_VERSION_MAJOR}.${MULLE_EXECUTABLE_VERSION_MINOR}.${MULLE_EXECUTABLE_VERSION_PATCH}"
37 37
 
... ...
@@ -57,7 +57,6 @@ SHOWN_COMMANDS="\
57 57
    clean         : cleans mulle-bootstrap produced files.
58 58
    defer         : join a master mulle-bootstrap project
59 59
    emancipate    : emancipate from a master mulle-bootstrap project
60
-   shell         : create a shell based on SHELL with PATH set
61 60
    paths         : get include and library paths
62 61
    init          : initializes a bootstrap project
63 62
    update        : updates repositories (fetch).
... ...
@@ -171,11 +170,25 @@ _bootstrap_main()
171 170
    if build_needed
172 171
    then
173 172
       MULLE_EXECUTABLE_FAIL_PREFIX="mulle-bootstrap build"
173
+      MULLE_BOOTSTRAP_DID_BUILD="YES"
174 174
       build_main "$@" || exit 1
175 175
    else
176 176
       log_verbose "No build needed"
177 177
    fi
178 178
 
179
+   #
180
+   # only show for default "bootstrap" action
181
+   #
182
+   if [ "${MULLE_BOOTSTRAP_DID_FETCH}" = "YES" ]
183
+   then
184
+      if [ -f "${BOOTSTRAP_DIR}.auto/motd" ]
185
+      then
186
+         log_fluff "Show motd"
187
+
188
+         cat "${BOOTSTRAP_DIR}.auto/motd" >&2
189
+      fi
190
+   fi
191
+
179 192
    log_debug "::: bootstrap end :::"
180 193
 }
181 194
 
... ...
@@ -190,10 +203,10 @@ _prepend_path_if_relative()
190 203
    case "$2" in
191 204
       /*)
192 205
          echo "$2"
193
-         ;;
206
+      ;;
194 207
       *)
195 208
          echo "$1/$2"
196
-         ;;
209
+      ;;
197 210
    esac
198 211
 }
199 212
 
... ...
@@ -222,6 +235,15 @@ bootstrap_libexec_path()
222 235
    local prefix
223 236
    local libexecpath
224 237
 
238
+   case "${path}" in
239
+      \.*|/*|~*)
240
+      ;;
241
+
242
+      *)
243
+         path="`command -v "${path}"`"
244
+      ;;
245
+   esac
246
+
225 247
    path="`resolve_symlinks "${path}"`"
226 248
    exedirpath="`dirname "${path}"`"
227 249
    prefix="`dirname "${exedirpath}"`"
... ...
@@ -246,7 +268,7 @@ bootstrap_init()
246 268
    libexecpath="`bootstrap_libexec_path "$0"`"
247 269
    if [ -z "${libexecpath}" ]
248 270
    then
249
-      echo "Fatal Error: Could not find libexec for ${MULLE_EXECUTABLE}" >&2
271
+      echo "Fatal Error: Could not find libexec for ${MULLE_EXECUTABLE} ($PWD)" >&2
250 272
       exit 1
251 273
    fi
252 274
 
... ...
@@ -272,6 +294,10 @@ bootstrap_init()
272 294
          echo "${MULLE_EXECUTABLE_VERSION}"
273 295
          exit 0
274 296
       ;;
297
+
298
+      shell)
299
+         fail "shell has moved to mulle-sde"
300
+      ;;
275 301
    esac
276 302
 
277 303
    #  set -e # more pain then gain in the end
... ...
@@ -552,6 +578,11 @@ bootstrap_main()
552 578
          return 0
553 579
       ;;
554 580
 
581
+      master-path)
582
+         echo "${PWD}"
583
+         return 0
584
+      ;;
585
+
555 586
       run)
556 587
          . mulle-bootstrap-paths.sh
557 588
 
... ...
@@ -564,12 +595,6 @@ bootstrap_main()
564 595
          setting_main "$@" || exit 1
565 596
       ;;
566 597
 
567
-      shell)
568
-         . mulle-bootstrap-shell.sh
569
-
570
-         shell_main "$@" || exit 1
571
-      ;;
572
-
573 598
       systeminstall)
574 599
          . mulle-bootstrap-systeminstall.sh
575 600
 
... ...
@@ -480,11 +480,11 @@ clone_or_symlink()
480 480
    local scmflagsdefault
481 481
 
482 482
    case "${scm}" in
483
-      git)
483
+      git*)
484 484
          operation="git_clone"
485 485
       ;;
486 486
 
487
-      svn)
487
+      svn*)
488 488
          operation="svn_checkout"
489 489
       ;;
490 490
 
... ...
@@ -501,19 +501,6 @@ clone_or_symlink()
501 501
       ;;
502 502
    esac
503 503
 
504
-   local SCM_OPTIONS
505
-
506
-   #
507
-   # later: make it so tar?shasum256=djhdjhdfdh
508
-   # and check that the archive is correct
509
-   #
510
-   extra="`echo "${scm}" | sed -n 's/^[^?]*\?\(.*\)/\1/p'`"
511
-   if [ ! -z "${extra}" ]
512
-   then
513
-      log_fluff "Parsed SCM_OPTIONS as \"${extra}\""
514
-      SCM_OPTIONS="${extra}"
515
-   fi
516
-
517 504
    local stashparent
518 505
 
519 506
    stashparent="`mkdir_stashparent_if_missing "${stashdir}"`"
... ...
@@ -558,7 +545,7 @@ clone_or_symlink()
558 545
             url="${found}"
559 546
 
560 547
             case "${scm}" in
561
-               git)
548
+               git*)
562 549
                   if can_symlink_it "${url}"
563 550
                   then
564 551
                      operation=link_command
... ...
@@ -679,10 +666,10 @@ checkout_repository()
679 666
    local operation
680 667
 
681 668
    case "${scm}" in
682
-      git)
669
+      git*)
683 670
          operation="git_checkout"
684 671
       ;;
685
-      svn)
672
+      svn*)
686 673
          operation="svn_checkout"
687 674
       ;;
688 675
       zip*|tar*)
... ...
@@ -723,10 +710,10 @@ update_repository()
723 710
    local operation
724 711
 
725 712
    case "${scm}" in
726
-      git)
713
+      git*)
727 714
          operation="git_fetch"
728 715
       ;;
729
-      svn|zip*|tar*)
716
+      svn*|zip*|tar*)
730 717
          log_info "No update for \"${scm}\""
731 718
          return
732 719
       ;;
... ...
@@ -998,18 +985,28 @@ required_action_for_clone()
998 985
    #
999 986
    # if scm is not git, don't try to be clever
1000 987
    #
1001
-   if [ "${scm}" != "git" ]
1002
-   then
1003
-      if [ "${scm}" != "sylimk" ] && [ -e "${newstashdir}" ]
1004
-      then
1005
-         log_fluff "\"${stashdir}\" is symlink. Ignoring possible differences."
988
+   case "${scm}" in
989
+      git*)
990
+      ;;
991
+
992
+      symlink*)
993
+         if [ -e "${newstashdir}" ]
994
+         then
995
+            log_fluff "\"${stashdir}\" is symlink. Ignoring possible differences."
996
+            return
997
+         fi
998
+
999
+         log_fluff "\"${newstashdir}\" is missing, reget."
1000
+         echo "clone"
1006 1001
          return
1007
-      fi
1002
+      ;;
1008 1003
 
1009
-      log_fluff "\"${newstashdir}\" is missing, reget."
1010
-      echo "clone"
1011
-      return
1012
-   fi
1004
+      *)
1005
+         log_fluff "Reget because scm is \"${scm}\"."
1006
+         echo "clone"
1007
+         return
1008
+      ;;
1009
+   esac
1013 1010
 
1014 1011
    if [ "${branch}" != "${newbranch}" ]
1015 1012
    then
... ...
@@ -326,7 +326,7 @@ bootstrap_should_defer_to_master()
326 326
    assert_sane_master_bootstrap_project "${masterpath}"
327 327
 
328 328
    case "${command}" in
329
-      git|defer|emancipate|library-path|setup-xcode|tag|type|uname|version|xcode)
329
+      git|defer|emancipate|library-path|setup-xcode|shell|tag|type|uname|version|xcode)
330 330
          log_verbose "Minion executes locally"
331 331
       ;;
332 332
 
... ...
@@ -340,8 +340,8 @@ bootstrap_should_defer_to_master()
340 340
             show_main_header_only "$@"
341 341
          ) || exit 1
342 342
 
343
-         log_info "Minion defers to master \"$masterpath\""
344
-         log_info ""
343
+         log_verbose "Minion defers to master \"$masterpath\""
344
+         log_verbose ""
345 345
 
346 346
          cd "${masterpath}" || fail "master is missing"
347 347
          return 0  # this leads to  main deferring later on (but cd is set!)
... ...
@@ -407,7 +407,13 @@ _flags_do_path()
407 407
    local line
408 408
    local tmppath
409 409
 
410
-   values="`_flags_expanded_binpath_value`"
410
+   if [ "${OPTION_INHERIT}" = "YES" ]
411
+   then
412
+      values="`_flags_expanded_binpath_value`"
413
+   else
414
+      values="`_flags_binpath_value`"
415
+   fi
416
+
411 417
    if [ ! -z "${values}" ]
412 418
    then
413 419
       line="PATH=${OPTION_QUOTE}${values}${OPTION_QUOTE}"
... ...
@@ -546,11 +552,21 @@ _flags_do_run_environment()
546 552
    then
547 553
       case "${UNAME}" in
548 554
          darwin)
549
-            line="DYLD_LIBRARY_PATH=${OPTION_QUOTE}${values}${OPTION_QUOTE}"
555
+            if [ "${OPTION_INHERIT}" = "YES" -a ! -z "${DYLD_LIBRARY_PATH}" ]
556
+            then
557
+               line="DYLD_LIBRARY_PATH=${OPTION_QUOTE}${values}:${DYLD_LIBRARY_PATH}${OPTION_QUOTE}"
558
+            else
559
+               line="DYLD_LIBRARY_PATH=${OPTION_QUOTE}${values}${OPTION_QUOTE}"
560
+            fi
550 561
          ;;
551 562
 
552 563
          linux|*)
553
-            line="LD_LIBRARY_PATH=${OPTION_QUOTE}${values}:${LD_LIBRARY_PATH}${OPTION_QUOTE}"
564
+            if [ "${OPTION_INHERIT}" = "YES" -a ! -z "${LD_LIBRARY_PATH}" ]
565
+            then
566
+               line="LD_LIBRARY_PATH=${OPTION_QUOTE}${values}:${LD_LIBRARY_PATH}${OPTION_QUOTE}"
567
+            else
568
+               line="LD_LIBRARY_PATH=${OPTION_QUOTE}${values}${OPTION_QUOTE}"
569
+            fi
554 570
          ;;
555 571
       esac
556 572
       result="`add_line "${result}" "${line}"`"
... ...
@@ -561,7 +577,12 @@ _flags_do_run_environment()
561 577
    then
562 578
       case "${UNAME}" in
563 579
          darwin)
564
-            line="DYLD_FRAMEWORK_PATH=${OPTION_QUOTE}${values}${OPTION_QUOTE}"
580
+            if [ "${OPTION_INHERIT}" = "YES" -a ! -z "${DYLD_FRAMEWORK_PATH}" ]
581
+            then
582
+               line="DYLD_FRAMEWORK_PATH=${OPTION_QUOTE}${values}:${DYLD_FRAMEWORK_PATH}${OPTION_QUOTE}"
583
+            else
584
+               line="DYLD_FRAMEWORK_PATH=${OPTION_QUOTE}${values}${OPTION_QUOTE}"
585
+            fi
565 586
             result="`add_line "${result}" "${line}"`"
566 587
          ;;
567 588
       esac
... ...
@@ -608,6 +629,7 @@ paths_main()
608 629
    local OPTION_SUPPRESS_FRAMEWORK_CFLAGS="NO"
609 630
    local OPTION_SUPPRESS_FRAMEWORK_LDFLAGS="NO"
610 631
    local OPTION_USE_ABSOLUTE_PATHS="YES"
632
+   local OPTION_INHERIT="YES"
611 633
    local OPTION_WITH_ADDICTIONS="YES"
612 634
    local OPTION_WITH_DEPENDENCIES="NO"
613 635
    local OPTION_WITH_FRAMEWORKPATHS="NO"
... ...
@@ -699,6 +721,10 @@ paths_main()
699 721
             OPTION_WITH_HEADERPATHS="NO"
700 722
          ;;
701 723
 
724
+         -ni|--no-inherit)
725
+            OPTION_INHERIT="NO"
726
+         ;;
727
+
702 728
          -nl|--no-library-paths)
703 729
             OPTION_WITH_LIBRARYPATHS="NO"
704 730
          ;;
... ...
@@ -982,7 +982,7 @@ read_repository_file()
982 982
       esac
983 983
 
984 984
       case "${scm}" in
985
-         symlink)
985
+         symlink*)
986 986
             fail "You can't specify symlink in the repositories file yourself. Use -y flag"
987 987
          ;;
988 988
       esac
... ...
@@ -700,14 +700,116 @@ git_main()
700 700
 }
701 701
 
702 702
 
703
+_archive_test()
704
+{
705
+   local archive="$1"
706
+
707
+   log_fluff "Testing ${C_MAGENTA}${C_BOLD}${archive}${C_INFO} ..."
708
+
709
+   case "${archive}" in
710
+      *.zip)
711
+         redirect_exekutor /dev/null unzip -t "${archive}" || return 1
712
+      ;;
713
+   esac
714
+
715
+   local tarcommand
716
+
717
+   tarcommand="tf"
718
+
719
+   case "${UNAME}" in
720
+      darwin)
721
+         # don't need it
722
+      ;;
723
+
724
+      *)
725
+         case "${url}" in
726
+            *.gz)
727
+               tarcommand="tfz"
728
+            ;;
729
+
730
+            *.bz2)
731
+               tarcommand="tfj"
732
+            ;;
733
+
734
+            *.x)
735
+               tarcommand="tfJ"
736
+            ;;
737
+         esac
738
+      ;;
739
+   esac
740
+
741
+
742
+   redirect_exekutor /dev/null tar ${tarcommand} ${TAROPTIONS} ${options} "${archive}" || return 1
743
+}
744
+
745
+
746
+_archive_unpack()
747
+{
748
+   local archive="$1"
749
+
750
+   log_verbose "Extracting ${C_MAGENTA}${C_BOLD}${archive}${C_INFO} ..."
751
+
752
+   case "${archive}" in
753
+      *.zip)
754
+         exekutor unzip "${archive}" || return 1
755
+      ;;
756
+   esac
757
+
758
+   local tarcommand
759
+
760
+   tarcommand="xf"
761
+
762
+   case "${UNAME}" in
763
+      darwin)
764
+         # don't need it
765
+      ;;
766
+
767
+      *)
768
+         case "${url}" in
769
+            *.gz)
770
+               tarcommand="xfz"
771
+            ;;
772
+
773
+            *.bz2)
774
+               tarcommand="xfj"
775
+            ;;
776
+
777
+            *.x)
778
+               tarcommand="xfJ"
779
+            ;;
780
+         esac
781
+      ;;
782
+   esac
783
+
784
+   exekutor tar ${tarcommand} ${TAROPTIONS} ${options} "${archive}" || return 1
785
+}
786
+
787
+
703 788
 _validate_download()
704 789
 {
705 790
    local filename="$1"
706
-   local options="$2"
791
+   local scm="$2"
707 792
 
708 793
    local checksum
709 794
    local expected
710 795
 
796
+   if ! _archive_test "${filename}"
797
+   then
798
+      return 1
799
+   fi
800
+
801
+   local options
802
+
803
+   #
804
+   # later: make it so tar?shasum256=djhdjhdfdh
805
+   # and check that the archive is correct
806
+   #
807
+   options="`echo "${scm}" | sed -n 's/^[^?]*\?\(.*\)/\1/p'`"
808
+   if [ ! -z "${extra}" ]
809
+   then
810
+      log_fluff "Parsed scm options as \"${options}\""
811
+   fi
812
+
711 813
    case "${options}" in
712 814
       *shasum256*)
713 815
          case "${UNAME}" in
... ...
@@ -716,14 +818,14 @@ _validate_download()
716 818
             ;;
717 819
 
718 820
             *)
719
-               log_verbose "Validating ${C_MAGENTA}${C_BOLD}${filename}${C_INFO} ..."
720
-
821
+               log_fluff "Validating ${C_MAGENTA}${C_BOLD}${filename}${C_INFO} ..."
721 822
 
722 823
                expected="`echo "${options}" | sed -n 's/shasum256=\([a-f0-9]*\).*/\1/p'`"
723 824
                checksum="`shasum -a 256 -p "${filename}" | awk '{ print $1 }'`"
724 825
                if [ "${expected}" != "${checksum}" ]
725 826
                then
726
-                  fail "${filename} sha256 is ${checksum}, not ${expected} as expected"
827
+                  log_error "${filename} sha256 is ${checksum}, not ${expected} as expected"
828
+                  return 1
727 829
                fi
728 830
             ;;
729 831
          esac
... ...
@@ -783,6 +885,7 @@ _move_stuff()
783 885
    fi
784 886
 }
785 887
 
888
+
786 889
 #
787 890
 # What we do is
788 891
 # a) download the package using curl
... ...
@@ -794,6 +897,7 @@ _tar_download()
794 897
 {
795 898
    local download="$1"
796 899
    local url="$2"
900
+   local scm="$3"
797 901
 
798 902
    local archive_cache
799 903
    local cachable_path
... ...
@@ -830,13 +934,26 @@ _tar_download()
830 934
    then
831 935
       log_info "Using cached \"${cached_archive}\" for ${C_MAGENTA}${C_BOLD}${url}${C_INFO} ..."
832 936
       # we are in a tmp dir
833
-      exekutor ln -s "${cached_archive}" "${download}" || fail "failed to symlink \"${cached_archive}\""
834 937
       cachable_path=""
835
-   else
938
+      if ! _validate_download "${cached_archive}" "${scm}"
939
+      then
940
+         remove_file_if_present "${cached_archive}"
941
+         cached_archive=""
942
+      fi
943
+      exekutor ln -s "${cached_archive}" "${download}" || fail "failed to symlink \"${cached_archive}\""
944
+   fi
945
+
946
+   if [ -z "${cached_archive}" ]
947
+   then
836 948
       exekutor curl -O -L ${CURLOPTIONS} "${url}" || fail "failed to download \"${url}\""
949
+      if ! _validate_download "${download}" "${scm}"
950
+      then
951
+         remove_file_if_present "${download}"
952
+         fail "Can't download archive from \"${url}\""
953
+      fi
837 954
    fi
838 955
 
839
-   _validate_download "${download}" "${SCM_OPTIONS}" || exit 1
956
+   [ -f "${download}" ] || internal_fail "expected file \"${download}\" is mising"
840 957
 
841 958
    if [ -z "${cached_archive}" -a ! -z "${cachable_path}" ]
842 959
    then
... ...
@@ -855,7 +972,7 @@ tar_unpack()
855 972
    local name="$2"
856 973
    local url="$3"
857 974
 #   local branch="$4"
858
-#   local scm="$5"
975
+   local scm="$5"
859 976
 #   local tag="$6"
860 977
    local stashdir="$7"
861 978
 
... ...
@@ -883,46 +1000,10 @@ tar_unpack()
883 1000
    (
884 1001
       exekutor cd "${tmpdir}" || return 1
885 1002
 
886
-      _tar_download "${download}" "${url}" || return 1
887
-
888
-      case "${url}" in
889
-         *.zip)
890
-            exekutor unzip "${download}" || return 1
891
-            archive="`basename "${download}" .zip`"
892
-            exekutor rm "${download}" || return 1
893
-         ;;
894
-      esac
1003
+      _tar_download "${download}" "${url}" "${scm}" || return 1
895 1004
 
896
-      local tarcommand
897
-
898
-      tarcommand="xf"
899
-
900
-      case "${UNAME}" in
901
-         darwin)
902
-            # don't need it
903
-         ;;
904
-
905
-         *)
906
-            case "${url}" in
907
-               *.gz)
908
-                  tarcommand="xfz"
909
-               ;;
910
-
911
-               *.bz2)
912
-                  tarcommand="xfj"
913
-               ;;
914
-
915
-               *.x)
916
-                  tarcommand="xfJ"
917
-               ;;
918
-            esac
919
-         ;;
920
-      esac
921
-
922
-      log_verbose "Extracting ${C_MAGENTA}${C_BOLD}${archive}${C_INFO} ..."
923
-
924
-      exekutor tar xf ${TAROPTIONS} ${options} "${archive}" || return 1
925
-      exekutor rm "${archive}"
1005
+      _archive_unpack "${download}" || return 1
1006
+      exekutor rm "${download}" || return 1
926 1007
    ) || return 1
927 1008
 
928 1009
    _move_stuff "${tmpdir}" "${stashdir}" "${archivename}" "${name}"
... ...
@@ -937,7 +1018,7 @@ zip_unpack()
937 1018
    local name="$2"
938 1019
    local url="$3"
939 1020
 #   local branch="$4"
940
-#   local scm="$5"
1021
+   local scm="$5"
941 1022
 #   local tag="$6"
942 1023
    local stashdir="$7"
943 1024
 
... ...
@@ -956,7 +1037,7 @@ zip_unpack()
956 1037
       log_info "Downloading ${C_MAGENTA}${C_BOLD}${url}${C_INFO} ..."
957 1038
 
958 1039
       exekutor curl -O -L ${CURLOPTIONS} "${url}" || return 1
959
-      _validate_download "${download}" "${SCM_OPTIONS}" || return 1
1040
+      _validate_download "${download}" "${scm}" || return 1
960 1041
 
961 1042
       log_verbose "Extracting ${C_MAGENTA}${C_BOLD}${download}${C_INFO} ..."
962 1043
 
963 1044
deleted file mode 100644
... ...
@@ -1,120 +0,0 @@
1
-#! /usr/bin/env bash
2
-#
3
-#   Copyright (c) 2015 Nat! - Mulle kybernetiK
4
-#   All rights reserved.
5
-#
6
-#   Redistribution and use in source and binary forms, with or without
7
-#   modification, are permitted provided that the following conditions are met:
8
-#
9
-#   Redistributions of source code must retain the above copyright notice, this
10
-#   list of conditions and the following disclaimer.
11
-#
12
-#   Redistributions in binary form must reproduce the above copyright notice,
13
-#   this list of conditions and the following disclaimer in the documentation
14
-#   and/or other materials provided with the distribution.
15
-#
16
-#   Neither the name of Mulle kybernetiK nor the names of its contributors
17
-#   may be used to endorse or promote products derived from this software
18
-#   without specific prior written permission.
19
-#
20
-#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21
-#   AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22
-#   IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23
-#   ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
24
-#   LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25
-#   CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26
-#   SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27
-#   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28
-#   CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29
-#   ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30
-#   POSSIBILITY OF SUCH DAMAGE.
31
-#
32
-MULLE_BOOTSTRAP_SHELL_SH="included"
33
-
34
-
35
-setting_usage()
36
-{
37
-    cat <<EOF >&2
38
-Usage:
39
-   ${MULLE_EXECUTABLE} shell [options]
40
-
41
-Options:
42
-   -m   : set CPPFLAGS and LDFLAGS in environment for make
43
-
44
-EOF
45
-  exit 1
46
-}
47
-
48
-
49
-shell_main()
50
-{
51
-   local env_string
52
-   local cmd_string
53
-   local prompt_string
54
-
55
-   local OPTION_MAKE_FLAGS="NO"
56
-
57
-   while [ $# -ne 0 ]
58
-   do
59
-      case "$1" in
60
-         -h|--help)
61
-            shell_usage
62
-         ;;
63
-
64
-         -m|--make)
65
-            OPTION_MAKE_FLAGS="YES"
66
-         ;;
67
-
68
-
69
-         # argument gitflags
70
-         -*)
71
-            fail "unknown option $1"
72
-         ;;
73
-
74
-         *)
75
-            break
76
-         ;;
77
-      esac
78
-
79
-      shift
80
-   done
81
-
82
-
83
-   #
84
-   # could pimp this up with CPPFLAGS and LDFLAGS too
85
-   # but do I want this ?
86
-   #
87
-   local options
88
-
89
-   options="run"
90
-   if [ "${OPTION_MAKE_FLAGS}" = "YES" ]
91
-   then
92
-      options="${options} make"
93
-   fi
94
-
95
-   env_string="`mulle-bootstrap paths -m -1 -q "'" ${options}`"
96
-   cmd_string="${SHELL:-/usr/bin/env bash}"
97
-
98
-   case "${cmd_string}" in
99
-      *bash|*dash)
100
-         prompt_string="`mulle-bootstrap project-path`"
101
-         prompt_string="PS1='\u@\h[`basename -- "${prompt_string}"`] \W$ '"
102
-      ;;
103
-   esac
104
-
105
-   eval_exekutor ${env_string} "${prompt_string}" "'${cmd_string}'"
106
-}
107
-
108
-
109
-#
110
-# read some config stuff now
111
-#
112
-shell_initialize()
113
-{
114
-   log_debug ":shell_initialize:"
115
-
116
-   [ -z "${MULLE_BOOTSTRAP_FUNCTIONS_SH}" ] && . mulle-bootstrap-functions.sh
117
-}
118
-
119
-
120
-shell_initialize
... ...
@@ -68,11 +68,11 @@ _status_repository()
68 68
    if [ "${STATUS_SCM}" = "YES" ]
69 69
    then
70 70
       case "${scm}" in
71
-      git)
71
+      git*)
72 72
          git_status "$@" >&2
73 73
       ;;
74 74
 
75
-      svn)
75
+      svn*)
76 76
          svn_status "$@" >&2
77 77
       ;;
78 78