Skip to content
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

allow upgrading a platform from local custom platform file #385

Merged
merged 4 commits into from Feb 3, 2019

Conversation

@YanChii
Copy link
Contributor

commented Jan 21, 2019

No description provided.

@YanChii YanChii added this to the 3.1.0 milestone Jan 21, 2019

@YanChii YanChii self-assigned this Jan 21, 2019

@YanChii YanChii requested a review from dn0 Jan 21, 2019

# shellcheck disable=SC2086
if ! ${CURL} ${CURL_QUIET} ${CURL_DEFAULT_OPTS} -o "${PLATFORM_FILE}" "${PLATFORM_DOWNLOAD_URL}"; then
die 5 "Cannot download new platform archive. Please check your internet connection."
if [[ ! -f "${PLATFORM_FILE}" ]]; then

This comment has been minimized.

Copy link
@dn0

dn0 Jan 22, 2019

Member

Should we also check some checksum? .e.g. to protect from situation where the file was not fully downloaded...

This comment has been minimized.

Copy link
@YanChii

YanChii Jan 22, 2019

Author Contributor

We don't always have a checksum. How about downloading to temporary file first?
See newest commit.

PLATFORM_TMPFILE="${PLATFORM_FILE}.part"
rm -f "${PLATFORM_TMPFILE}"
# shellcheck disable=SC2086
if ! ${CURL} ${CURL_QUIET} ${CURL_DEFAULT_OPTS} -o "${PLATFORM_FILE}" "${PLATFORM_DOWNLOAD_URL}"; then

This comment has been minimized.

Copy link
@dn0

dn0 Jan 23, 2019

Member

Still downloads to original file, no?
Also, now the if is inverted - does not need ! (i.e. harder to read)

This comment has been minimized.

Copy link
@YanChii

YanChii Jan 23, 2019

Author Contributor

The point is that now it does not leave unfinished downloads. The final file is created only when the curl returns success.
I'll revert the if.

@YanChii YanChii merged commit 79463e6 into erigones:master Feb 3, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@YanChii YanChii deleted the YanChii:upg-platform-local branch Feb 3, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants
You can’t perform that action at this time.