-
-
Notifications
You must be signed in to change notification settings - Fork 72
add auto-update for the d-keyring #457
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,8 @@ | |
# Authors: Martin Nowak | ||
# Documentation: https://dlang.org/install.html | ||
|
||
# set -x | ||
|
||
_() { | ||
|
||
# Returns false if the script is invoked from a Windows command prompt. | ||
|
@@ -80,7 +82,7 @@ retry() { | |
for i in {0..4}; do | ||
if "$@"; then | ||
break | ||
elif [ $i -lt 4 ]; then | ||
elif [ "$i" -lt 4 ]; then | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. correct. |
||
sleep $((1 << i)) | ||
else | ||
fatal "Failed to download '$url'" | ||
|
@@ -407,6 +409,14 @@ parse_args() { | |
|
||
# run_command command [compiler] | ||
run_command() { | ||
# check if tools where installed already and update d-keyring.gpg if necessary | ||
local tmp | ||
tmp=$(mkdtemp) | ||
if [ -f "$ROOT/d-keyring.gpg" ] && [ "$(command curl https://dlang.org/d-keyring.gpg -z "$ROOT/d-keyring.gpg" -o "$tmp/d-keyring.gpg" -s -L -w "%{http_code}")" == "200" ] ; then | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the real problem:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this all together is far beyond my bash foo and also the time I can / want spend on this topic, sorry...
|
||
mv "$tmp/d-keyring.gpg" "$ROOT/d-keyring.gpg" | ||
log "auto-updated $ROOT/d-keyring.gpg" | ||
fi | ||
|
||
case $1 in | ||
install) | ||
check_tools curl | ||
|
@@ -494,13 +504,13 @@ Run \`$(display_path "$ROOT/$2/activate.bat")\` to add $2 to your PATH." | |
} | ||
|
||
install_dlang_installer() { | ||
local tmp mirrors | ||
local tmp mirrors keyring_mirrors | ||
tmp=$(mkdtemp) | ||
local mirrors=( | ||
mirrors=( | ||
"https://dlang.org/install.sh" | ||
"https://s3-us-west-2.amazonaws.com/downloads.dlang.org/other/install.sh" | ||
) | ||
local keyring_mirrors=( | ||
keyring_mirrors=( | ||
"https://dlang.org/d-keyring.gpg" | ||
"https://s3-us-west-2.amazonaws.com/downloads.dlang.org/other/d-keyring.gpg" | ||
) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't have been committed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
forgot this after "debugging", but then again, it is commented out and shouldn't harm, that's why I finally decided to not delete it again. anyhow, feel free to remove it...