Skip to content

Commit 9da84a9

Browse files
committed
fallback for https protocol
1 parent bad24f3 commit 9da84a9

4 files changed

Lines changed: 27 additions & 19 deletions

File tree

scripts/source_sync_4.6.1.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -318,10 +318,12 @@ for ((i=0; i < NSOURCES; i++)); do
318318
DNLOAD=$(echo "${SOURCE_INFO_PROCESSED[i]}" | cut -f 5 -d ':')
319319

320320
if [ $DALL -eq 1 -o "x${DNLOAD}" == "xy" ]; then
321-
if ! DownloadAndSync "$WHAT" "${LDK_DIR}/${WHAT}" "https://${REPO}" "${TAG}" "${OPT}"; then
321+
if DownloadAndSync "$WHAT" "${LDK_DIR}/${WHAT}" "git://${REPO}" "${TAG}" "${OPT}"; then
322+
true
323+
else
322324
if [[ $? == 1 ]]; then
323-
echo "Trying git protocol"
324-
DownloadAndSync "$WHAT" "${LDK_DIR}/${WHAT}" "git://${REPO}" "${TAG}" "${OPT}"
325+
echo "Trying https protocol"
326+
DownloadAndSync "$WHAT" "${LDK_DIR}/${WHAT}" "https://${REPO}" "${TAG}" "${OPT}"
325327
fi
326328
fi
327329
fi

scripts/source_sync_5.0.2.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -328,11 +328,13 @@ for ((i=0; i < NSOURCES; i++)); do
328328
DNLOAD=$(echo "${SOURCE_INFO_PROCESSED[i]}" | cut -f 5 -d ':')
329329

330330
if [ $DALL -eq 1 -o "x${DNLOAD}" == "xy" ]; then
331-
DownloadAndSync "$WHAT" "${LDK_DIR}/${WHAT}" "git://${REPO}" "${TAG}" "${OPT}"
332-
tRET=$?
333-
let GRET=GRET+tRET
334-
if [ $tRET -ne 0 -a $EOE -eq 1 ]; then
335-
exit $tRET
331+
if DownloadAndSync "$WHAT" "${LDK_DIR}/${WHAT}" "git://${REPO}" "${TAG}" "${OPT}"; then
332+
true
333+
else
334+
if [[ $? == 1 ]]; then
335+
echo "Trying https protocol"
336+
DownloadAndSync "$WHAT" "${LDK_DIR}/${WHAT}" "https://${REPO}" "${TAG}" "${OPT}"
337+
fi
336338
fi
337339
fi
338340
done

scripts/source_sync_5.1.2.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -341,11 +341,13 @@ for ((i=0; i < NSOURCES; i++)); do
341341
DNLOAD=$(echo "${SOURCE_INFO_PROCESSED[i]}" | cut -f 5 -d ':')
342342

343343
if [ $DALL -eq 1 -o "x${DNLOAD}" == "xy" ]; then
344-
DownloadAndSync "$WHAT" "${LDK_DIR}/${WHAT}" "git://${REPO}" "${TAG}" "${OPT}"
345-
tRET=$?
346-
let GRET=GRET+tRET
347-
if [ $tRET -ne 0 -a $EOE -eq 1 ]; then
348-
exit $tRET
344+
if DownloadAndSync "$WHAT" "${LDK_DIR}/${WHAT}" "git://${REPO}" "${TAG}" "${OPT}"; then
345+
true
346+
else
347+
if [[ $? == 1 ]]; then
348+
echo "Trying https protocol"
349+
DownloadAndSync "$WHAT" "${LDK_DIR}/${WHAT}" "https://${REPO}" "${TAG}" "${OPT}"
350+
fi
349351
fi
350352
fi
351353
done

scripts/source_sync_6.x.sh

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ function DownloadAndSync {
188188
git fetch --all 2>&1 >/dev/null
189189
popd > /dev/null
190190
else
191-
echo "Downloading default $WHAT source3..."
191+
echo "Downloading default $WHAT source..."
192192

193193
if ! git clone "$REPO_URL" -n ${LDK_SOURCE_DIR} >/dev/null; then
194194
echo "$2 source sync failed"
@@ -318,11 +318,13 @@ for ((i=0; i < NSOURCES; i++)); do
318318
DNLOAD=$(echo "${SOURCE_INFO_PROCESSED[i]}" | cut -f 5 -d ':')
319319

320320
if [ $DALL -eq 1 -o "x${DNLOAD}" == "xy" ]; then
321-
DownloadAndSync "$WHAT" "${LDK_DIR}/${WHAT}" "git://${REPO}" "${TAG}" "${OPT}"
322-
tRET=$?
323-
let GRET=GRET+tRET
324-
if [ $tRET -ne 0 -a $EOE -eq 1 ]; then
325-
exit $tRET
321+
if DownloadAndSync "$WHAT" "${LDK_DIR}/${WHAT}" "git://${REPO}" "${TAG}" "${OPT}"; then
322+
true
323+
else
324+
if [[ $? == 1 ]]; then
325+
echo "Trying https protocol"
326+
DownloadAndSync "$WHAT" "${LDK_DIR}/${WHAT}" "https://${REPO}" "${TAG}" "${OPT}"
327+
fi
326328
fi
327329
fi
328330
done

0 commit comments

Comments
 (0)