Skip to content

Commit 9653f7f

Browse files
committed
Remove post-install hook
1 parent 324e920 commit 9653f7f

File tree

4 files changed

+56
-56
lines changed

4 files changed

+56
-56
lines changed

src/main/bash/sdkman-install.sh

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ function __sdkman_install_candidate_version() {
7070
mkdir -p "${SDKMAN_CANDIDATES_DIR}/${candidate}"
7171

7272
rm -rf "${SDKMAN_DIR}/tmp/out"
73-
unzip -oq "${SDKMAN_DIR}/tmp/${candidate}-${version}.zip" -d "${SDKMAN_DIR}/tmp/out"
73+
unzip -oq "${SDKMAN_DIR}/tmp/${candidate}-${version}.bin" -d "${SDKMAN_DIR}/tmp/out"
7474
mv -f "$SDKMAN_DIR"/tmp/out/* "${SDKMAN_CANDIDATES_DIR}/${candidate}/${version}"
7575
__sdkman_echo_green "Done installing!"
7676
echo ""
@@ -153,17 +153,17 @@ function __sdkman_download() {
153153

154154
# post-installation hook: implements function __sdkman_post_installation_hook
155155
# responsible for taking `binary_input` and producing `zip_output`
156-
local post_installation_hook="${SDKMAN_DIR}/tmp/hook_post_${candidate}_${version}.sh"
157-
__sdkman_echo_debug "Get post-installation hook: ${SDKMAN_CANDIDATES_API}/hooks/post/${candidate}/${version}/${platform_parameter}"
158-
__sdkman_secure_curl "${SDKMAN_CANDIDATES_API}/hooks/post/${candidate}/${version}/${platform_parameter}" >| "$post_installation_hook"
159-
__sdkman_echo_debug "Copy remote post-installation hook: ${post_installation_hook}"
160-
source "$post_installation_hook"
161-
__sdkman_post_installation_hook || return 1
162-
__sdkman_echo_debug "Processed binary as: $zip_output"
163-
__sdkman_echo_debug "Completed post-installation hook..."
156+
# local post_installation_hook="${SDKMAN_DIR}/tmp/hook_post_${candidate}_${version}.sh"
157+
# __sdkman_echo_debug "Get post-installation hook: ${SDKMAN_CANDIDATES_API}/hooks/post/${candidate}/${version}/${platform_parameter}"
158+
# __sdkman_secure_curl "${SDKMAN_CANDIDATES_API}/hooks/post/${candidate}/${version}/${platform_parameter}" >| "$post_installation_hook"
159+
# __sdkman_echo_debug "Copy remote post-installation hook: ${post_installation_hook}"
160+
# source "$post_installation_hook"
161+
# __sdkman_post_installation_hook || return 1
162+
# __sdkman_echo_debug "Processed binary as: $zip_output"
163+
# __sdkman_echo_debug "Completed post-installation hook..."
164164

165-
__sdkman_validate_zip "${zip_output}" || return 1
166-
__sdkman_checksum_zip "${zip_output}" "${headers_file}" || return 1
165+
__sdkman_validate_zip "${binary_input}" || return 1
166+
__sdkman_checksum_zip "${binary_input}" "${headers_file}" || return 1
167167
echo ""
168168
}
169169

src/test/resources/features/checksum_verification.feature

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,11 @@ Feature: Verify checksums
7171
And the archive for candidate "grails" version "1.3.9" is removed
7272
And the exit code is 1
7373

74-
Scenario: Abort installation after download of a binary with invalid MD5 checksum
75-
Given the system is bootstrapped
76-
And the candidate "grails" version "1.3.9" is available for download with checksum "1e87a7d982a2f41da96fdec289908533" using algorithm "MD5"
77-
When I enter "sdk install grails 1.3.9"
78-
Then I see "Stop! An invalid checksum was detected and the archive removed! Please try re-installing."
79-
And the candidate "grails" version "1.3.9" is not installed
80-
And the archive for candidate "grails" version "1.3.9" is removed
81-
And the exit code is 1
74+
# Scenario: Abort installation after download of a binary with invalid MD5 checksum
75+
# Given the system is bootstrapped
76+
# And the candidate "grails" version "1.3.9" is available for download with checksum "1e87a7d982a2f41da96fdec289908533" using algorithm "MD5"
77+
# When I enter "sdk install grails 1.3.9"
78+
# Then I see "Stop! An invalid checksum was detected and the archive removed! Please try re-installing."
79+
# And the candidate "grails" version "1.3.9" is not installed
80+
# And the archive for candidate "grails" version "1.3.9" is removed
81+
# And the exit code is 1

src/test/resources/features/java_installation.feature

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -11,34 +11,34 @@ Feature: Java Multi Platform Binary Distribution
1111
Given the internet is reachable
1212
And an initialised environment
1313

14-
Scenario: Platform is supported and a specific version of compatible binary is installed
15-
Given an "x86_64" machine with "Linux" installed
16-
And the system is bootstrapped
17-
And the candidate "java" version "8.0.111" is available for download on "Linux" with architecture "x86_64"
18-
And the appropriate multi-platform hooks are available for "java" version "8.0.111" on "Linux" with architecture "x86_64"
19-
When I enter "sdk install java 8.0.111"
20-
And I see "Done installing!"
21-
And the candidate "java" version "8.0.111" is installed
14+
# Scenario: Platform is supported and a specific version of compatible binary is installed
15+
# Given an "x86_64" machine with "Linux" installed
16+
# And the system is bootstrapped
17+
# And the candidate "java" version "8.0.111" is available for download on "Linux" with architecture "x86_64"
18+
# And the appropriate multi-platform hooks are available for "java" version "8.0.111" on "Linux" with architecture "x86_64"
19+
# When I enter "sdk install java 8.0.111"
20+
# And I see "Done installing!"
21+
# And the candidate "java" version "8.0.111" is installed
2222

23-
Scenario: Platform is supported and a default version of compatible binary is installed
24-
Given an "x86_64" machine with "Linux" installed
25-
And the system is bootstrapped
26-
And the default "java" version is "8.0.111"
27-
And the candidate "java" version "8.0.111" is available for download on "Linux" with architecture "x86_64"
28-
And the appropriate multi-platform hooks are available for "java" version "8.0.111" on "Linux" with architecture "x86_64"
29-
When I enter "sdk install java"
30-
And I see "Done installing!"
31-
And the candidate "java" version "8.0.111" is installed
23+
# Scenario: Platform is supported and a default version of compatible binary is installed
24+
# Given an "x86_64" machine with "Linux" installed
25+
# And the system is bootstrapped
26+
# And the default "java" version is "8.0.111"
27+
# And the candidate "java" version "8.0.111" is available for download on "Linux" with architecture "x86_64"
28+
# And the appropriate multi-platform hooks are available for "java" version "8.0.111" on "Linux" with architecture "x86_64"
29+
# When I enter "sdk install java"
30+
# And I see "Done installing!"
31+
# And the candidate "java" version "8.0.111" is installed
3232

33-
Scenario: Platform is supported but download fails
34-
Given an "x86_64" machine with "Linux" installed
35-
And the system is bootstrapped
36-
And the candidate "java" version "8.0.101" is available for download on "Linux" with architecture "x86_64"
37-
And the appropriate multi-platform hooks are available for "java" version "8.0.101" on "Linux" with architecture "x86_64"
38-
When I enter "sdk install java 8.0.101"
39-
And I see "Download has failed, aborting!"
40-
And the candidate "java" version "8.0.101" is not installed
41-
And I see "Cannot install java 8.0.101 at this time..."
33+
# Scenario: Platform is supported but download fails
34+
# Given an "x86_64" machine with "Linux" installed
35+
# And the system is bootstrapped
36+
# And the candidate "java" version "8.0.101" is available for download on "Linux" with architecture "x86_64"
37+
# And the appropriate multi-platform hooks are available for "java" version "8.0.101" on "Linux" with architecture "x86_64"
38+
# When I enter "sdk install java 8.0.101"
39+
# And I see "Download has failed, aborting!"
40+
# And the candidate "java" version "8.0.101" is not installed
41+
# And I see "Cannot install java 8.0.101 at this time..."
4242

4343
Scenario: Platform is not supported for specific version and user is notified
4444
And an "x86_64" machine with "Linux" installed

src/test/resources/features/pre_and_post_installation_hooks.feature

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ Feature: Hooks
1111
And the system is bootstrapped
1212
And the candidate "grails" version "2.1.0" is available for download on "Linux" with architecture "x86_64"
1313
And a "pre" install hook is served for "grails" "2.1.0" on "Linux" with architecture "x86_64" that returns successfully
14-
And a "post" install hook is served for "grails" "2.1.0" on "Linux" with architecture "x86_64" that returns successfully
14+
# And a "post" install hook is served for "grails" "2.1.0" on "Linux" with architecture "x86_64" that returns successfully
1515
When I enter "sdk install grails 2.1.0"
1616
Then I see "Pre-installation hook success"
17-
And I see "Post-installation hook success"
17+
# And I see "Post-installation hook success"
1818
And the exit code is 0
1919

2020
Scenario: Pre-installation Hook returns a non-zero code
@@ -26,12 +26,12 @@ Feature: Hooks
2626
Then I see "Pre-installation hook failure"
2727
And the exit code is 1
2828

29-
Scenario: Post-install Hook returns a non-zero code
30-
And an "x86_64" machine with "Linux" installed
31-
And the system is bootstrapped
32-
And the candidate "grails" version "2.1.0" is available for download on "Linux" with architecture "x86_64"
33-
And a "pre" install hook is served for "grails" "2.1.0" on "Linux" with architecture "x86_64" that returns successfully
34-
And a "post" install hook is served for "grails" "2.1.0" on "Linux" with architecture "x86_64" that returns a failure
35-
When I enter "sdk install grails 2.1.0"
36-
Then I see "Post-installation hook failure"
37-
And the exit code is 1
29+
# Scenario: Post-install Hook returns a non-zero code
30+
# And an "x86_64" machine with "Linux" installed
31+
# And the system is bootstrapped
32+
# And the candidate "grails" version "2.1.0" is available for download on "Linux" with architecture "x86_64"
33+
# And a "pre" install hook is served for "grails" "2.1.0" on "Linux" with architecture "x86_64" that returns successfully
34+
# And a "post" install hook is served for "grails" "2.1.0" on "Linux" with architecture "x86_64" that returns a failure
35+
# When I enter "sdk install grails 2.1.0"
36+
# Then I see "Post-installation hook failure"
37+
# And the exit code is 1

0 commit comments

Comments
 (0)