Browse code

* deal with empty/bad repositories more gracefully

Nat! authored on 19-09-2017 14:00:33
Showing 4 changed files
... ...
@@ -1,3 +1,7 @@
1
+### 3.12.1
2
+
3
+* deal with empty/bad repositories more gracefully
4
+
1 5
 ## 3.12.0
2 6
 
3 7
 * Various improvements for mingw. New version number for mulle-tests
4 8
new file mode 100755
... ...
@@ -0,0 +1,9 @@
1
+# -- Post Release --
2
+# Push stuff into debian repository
3
+#
4
+
5
+post_release()
6
+{
7
+   mulle-homebrew-debian
8
+}
9
+
... ...
@@ -31,7 +31,7 @@
31 31
 #
32 32
 MULLE_EXECUTABLE_VERSION_MAJOR=3
33 33
 MULLE_EXECUTABLE_VERSION_MINOR=12
34
-MULLE_EXECUTABLE_VERSION_PATCH=0
34
+MULLE_EXECUTABLE_VERSION_PATCH=1
35 35
 
36 36
 MULLE_EXECUTABLE_VERSION="${MULLE_EXECUTABLE_VERSION_MAJOR}.${MULLE_EXECUTABLE_VERSION_MINOR}.${MULLE_EXECUTABLE_VERSION_PATCH}"
37 37
 
... ...
@@ -111,7 +111,7 @@ _stash_of_reposdir_file()
111 111
 {
112 112
    local clone
113 113
 
114
-   clone="`_clone_of_reposdir_file "$@"`"
114
+   clone="`_clone_of_reposdir_file "$@"`" || exit 1
115 115
    _dstdir_part_from_clone "${clone}"
116 116
 }
117 117
 
... ...
@@ -120,7 +120,7 @@ stash_of_repository()
120 120
 {
121 121
    local clone
122 122
 
123
-   clone="`clone_of_repository "$@"`"
123
+   clone="`clone_of_repository "$@"`" || exit 1
124 124
    _dstdir_part_from_clone "${clone}"
125 125
 }
126 126
 
... ...
@@ -167,7 +167,7 @@ _all_repository_stashes()
167 167
       IFS="${DEFAULT_IFS}"
168 168
 
169 169
       # somewhat a hack, since name is actually a subpath
170
-      stash="`stash_of_repository "${reposdir}" "${name}"`"
170
+      stash="`stash_of_repository "${reposdir}" "${name}"`" || exit 1
171 171
       if [ ! -z "${stash}" ]
172 172
       then
173 173
          if [ -d "${stash}" ]
... ...
@@ -200,7 +200,7 @@ _all_deep_embedded_repository_stashes()
200 200
          IFS="${DEFAULT_IFS}"
201 201
 
202 202
          # somewhat a hack, since name is actually a subpath
203
-         stash="`stash_of_repository "${reposdir}" "${name}"`"
203
+         stash="`stash_of_repository "${reposdir}" "${name}"`" || exit 1
204 204
          if [ ! -z "${stash}" ]
205 205
          then
206 206
            if [ -d "${stash}" ]
... ...
@@ -735,7 +735,7 @@ _canonical_clone_name()
735 735
       ;;
736 736
 
737 737
       .*)
738
-         fail "clone name can't start with a '.'"
738
+         fail "clone name \"${name}\" can't start with a '.'"
739 739
       ;;
740 740
    esac
741 741
 
... ...
@@ -848,7 +848,7 @@ parse_raw_clone()
848 848
 #   local name        # name of clone
849 849
 process_raw_clone()
850 850
 {
851
-   name="`_canonical_clone_name "${url}"`"
851
+   name="`_canonical_clone_name "${url}"`" || exit 1
852 852
 
853 853
    # memo this is done in .auto already
854 854
    # stashdir="`computed_stashdir "${name}" "${dstdir}"`"
... ...
@@ -972,6 +972,11 @@ read_repository_file()
972 972
    do
973 973
       IFS="${DEFAULT_IFS}"
974 974
 
975
+      if [ -z "${clone}" ]
976
+      then
977
+         continue
978
+      fi
979
+      
975 980
       parse_raw_clone "${clone}"
976 981
       process_raw_clone
977 982
 
... ...
@@ -1019,7 +1024,7 @@ ensure_reposdir_directory()
1019 1024
    then
1020 1025
       if [ "${COMMAND}" = "update" ]
1021 1026
       then
1022
-         fail "fetch first before updating"
1027
+         fail "You must fetch first before updating"
1023 1028
       fi
1024 1029
       mkdir_if_missing "${reposdir}"
1025 1030
    fi
... ...
@@ -1059,8 +1064,8 @@ merge_repository_contents()
1059 1064
    do
1060 1065
       IFS="${DEFAULT_IFS}"
1061 1066
 
1062
-      url="`_url_part_from_clone "${clone}"`"
1063
-      name="`_canonical_clone_name "${url}"`"
1067
+      url="`_url_part_from_clone "${clone}"`" || internal_fail "_url_part_from_clone \"${url}\""
1068
+      name="`_canonical_clone_name "${url}"`" || internal_fail "_canonical_clone_name \"${url}\""
1064 1069
 
1065 1070
       if [ "$MULLE_FLAG_LOG_SETTINGS" = "YES" -o "$MULLE_FLAG_LOG_MERGE" = "YES"  ]
1066 1071
       then
... ...
@@ -1076,8 +1081,8 @@ merge_repository_contents()
1076 1081
    do
1077 1082
       IFS="${DEFAULT_IFS}"
1078 1083
 
1079
-      url="`_url_part_from_clone "${clone}"`"
1080
-      name="`_canonical_clone_name "${url}"`"
1084
+      url="`_url_part_from_clone "${clone}"`" || internal_fail "_url_part_from_clone \"${clone}\""
1085
+      name="`_canonical_clone_name "${url}"`" || internal_fail "_canonical_clone_name \"${url}\""
1081 1086
 
1082 1087
       if [ "$MULLE_FLAG_LOG_SETTINGS" = "YES" -o "$MULLE_FLAG_LOG_MERGE" = "YES"  ]
1083 1088
       then
... ...
@@ -1115,7 +1120,7 @@ merge_repository_files()
1115 1120
    local additions
1116 1121
 
1117 1122
    contents="`cat "${dstfile}" 2> /dev/null || :`"
1118
-   additions="`read_repository_file "${srcfile}" "${delete_dstdir}"`" || fail "read"
1123
+   additions="`read_repository_file "${srcfile}" "${delete_dstdir}"`" || fail "Failed to read repository file \"${srcfile}\""
1119 1124
    additions="`echo "${additions}"| sed 's/;*$//'`"
1120 1125
    additions="`merge_repository_contents "${contents}" "${additions}"`"
1121 1126
 
... ...
@@ -1153,10 +1158,13 @@ unique_repository_contents()
1153 1158
    for clone in ${another}
1154 1159
    do
1155 1160
       IFS="${DEFAULT_IFS}"
1156
-
1157
-      url="`_url_part_from_clone "${clone}"`"
1158
-      name="`_canonical_clone_name "${url}"`"
1159
-      map="`assoc_array_set  "${map}" "${name}" "${clone}"`"
1161
+ 
1162
+      if [ ! -z "${clone}" ]
1163
+      then
1164
+         url="`_url_part_from_clone "${clone}"`" || internal_fail "_url_part_from_clone \"${clone}\""
1165
+         name="`_canonical_clone_name "${url}"`" || internal_fail "_canonical_clone_name \"${url}\""
1166
+         map="`assoc_array_set  "${map}" "${name}" "${clone}"`"
1167
+      fi
1160 1168
    done
1161 1169
 
1162 1170
    output=""
... ...
@@ -1166,10 +1174,13 @@ unique_repository_contents()
1166 1174
    do
1167 1175
       IFS="${DEFAULT_IFS}"
1168 1176
 
1169
-      url="`_url_part_from_clone "${clone}"`"
1170
-      name="`_canonical_clone_name "${url}"`"
1171
-      uniqued="`assoc_array_get "${map}" "${name}"`"
1172
-      output="`add_line "${output}" "${uniqued:-${clone}}"`"
1177
+      if [ ! -z "${clone}" ]
1178
+      then
1179
+         url="`_url_part_from_clone "${clone}"`" || internal_fail "_url_part_from_clone \"${clone}\""
1180
+         name="`_canonical_clone_name "${url}"`" || internal_fail "_canonical_clone_name \"${url}\""
1181
+         uniqued="`assoc_array_get "${map}" "${name}"`"
1182
+         output="`add_line "${output}" "${uniqued:-${clone}}"`"
1183
+      fi
1173 1184
    done
1174 1185
    IFS="${DEFAULT_IFS}"
1175 1186
 
... ...
@@ -1324,15 +1335,15 @@ ${clone}"
1324 1335
 
1325 1336
 mulle_repositories_initialize()
1326 1337
 {
1327
-   [ -z "${MULLE_BOOTSTRAP_LOGGING_SH}" ]         && . mulle-bootstrap-logging.sh
1338
+   [ -z "${MULLE_BOOTSTRAP_LOGGING_SH}" ] && . mulle-bootstrap-logging.sh
1328 1339
 
1329 1340
    log_debug ":mulle_repositories_initialize:"
1330 1341
 
1331
-   [ -z "${MULLE_BOOTSTRAP_LOCAL_ENVIRONMENT_SH}" ]  && . mulle-bootstrap-local-environment.sh
1332
-   [ -z "${MULLE_BOOTSTRAP_ARRAY_SH}" ]           && . mulle-bootstrap-array.sh
1333
-   [ -z "${MULLE_BOOTSTRAP_SETTINGS_SH}" ]        && . mulle-bootstrap-settings.sh
1334
-   [ -z "${MULLE_BOOTSTRAP_FUNCTIONS_SH}" ]       && . mulle-bootstrap-functions.sh
1335
-   [ -z "${MULLE_BOOTSTRAP_COMMON_SETTINGS_SH}" ] && . mulle-bootstrap-common-settings.sh
1342
+   [ -z "${MULLE_BOOTSTRAP_LOCAL_ENVIRONMENT_SH}" ] && . mulle-bootstrap-local-environment.sh
1343
+   [ -z "${MULLE_BOOTSTRAP_ARRAY_SH}" ]             && . mulle-bootstrap-array.sh
1344
+   [ -z "${MULLE_BOOTSTRAP_SETTINGS_SH}" ]          && . mulle-bootstrap-settings.sh
1345
+   [ -z "${MULLE_BOOTSTRAP_FUNCTIONS_SH}" ]         && . mulle-bootstrap-functions.sh
1346
+   [ -z "${MULLE_BOOTSTRAP_COMMON_SETTINGS_SH}" ]   && . mulle-bootstrap-common-settings.sh
1336 1347
    :
1337 1348
 }
1338 1349