Browse files

Strip out isolated_mode configuration.

  • Loading branch information...
1 parent 314f6b4 commit b8c279fe16a212f8f730dbcff6e77a81f539801f @marc0der marc0der committed Jan 22, 2013
View
11 src/main/resources/scripts/gvm-common.sh
@@ -84,15 +84,10 @@ function __gvmtool_build_version_csv {
}
function __gvmtool_determine_current_version {
- unset CURRENT
CANDIDATE="$1"
-
- if [[ -n ${isolated_mode} && ${isolated_mode} == 1 ]]; then
- CURRENT=$(echo $PATH | sed -E "s|.gvm/${CANDIDATE}/([^/]+)/bin|!!\1!!|1" | sed -E "s|^.*!!(.+)!!.*$|\1|g")
-
- if [[ "${CURRENT}" == "current" ]]; then
- unset CURRENT
- fi
+ CURRENT=$(echo $PATH | sed -E "s|.gvm/${CANDIDATE}/([^/]+)/bin|!!\1!!|1" | sed -E "s|^.*!!(.+)!!.*$|\1|g")
+ if [[ "${CURRENT}" == "current" ]]; then
+ unset CURRENT
fi
if [[ -z ${CURRENT} ]]; then
View
14 src/main/resources/scripts/gvm-use.sh
@@ -33,16 +33,12 @@ function __gvmtool_use {
fi
fi
- if [[ -n ${isolated_mode} && ${isolated_mode} == 1 ]]; then
- # Just update the *_HOME and PATH for this shell.
- UPPER_CANDIDATE=`echo "${CANDIDATE}" | tr '[:lower:]' '[:upper:]'`
- export "${UPPER_CANDIDATE}_HOME"="${GVM_DIR}/${CANDIDATE}/${VERSION}"
+ # Just update the *_HOME and PATH for this shell.
+ UPPER_CANDIDATE=`echo "${CANDIDATE}" | tr '[:lower:]' '[:upper:]'`
+ export "${UPPER_CANDIDATE}_HOME"="${GVM_DIR}/${CANDIDATE}/${VERSION}"
- # Replace the current path for the candidate with the selected version.
- export PATH=`echo $PATH | sed -E "s!${GVM_DIR}/${CANDIDATE}/([^/]+)!${GVM_DIR}/${CANDIDATE}/${VERSION}!g"`
- else
- __gvmtool_link_candidate_version "${CANDIDATE}" "${VERSION}"
- fi
+ # Replace the current path for the candidate with the selected version.
+ export PATH=`echo $PATH | sed -E "s!${GVM_DIR}/${CANDIDATE}/([^/]+)!${GVM_DIR}/${CANDIDATE}/${VERSION}!g"`
echo ""
echo Using "${CANDIDATE}" version "${VERSION} in this shell."
View
8 src/main/resources/scripts/install.sh
@@ -175,8 +175,7 @@ mkdir -p "${GVM_DIR}/gradle"
mkdir -p "${GVM_DIR}/vertx"
echo "Prime the config file..."
-gvm_config_file="${GVM_DIR}/etc/config"
-echo "isolated_mode=1" > "${gvm_config_file}"
+touch "${gvm_config_file}"
echo "Download script archive..."
curl -s "${GVM_SERVICE}/res?platform=${gvm_platform}&purpose=install" > "${gvm_zip_file}"
@@ -196,11 +195,6 @@ mv "${gvm_stage_folder}"/gvm-* "${gvm_src_folder}"
echo "Make init script executable..."
chmod +x "${gvm_bin_folder}/gvm-init.sh"
-echo "Prime config file..."
-if [[ ! -f "${gvm_config_file}" ]]; then
- echo "isolated_mode=1" > "${gvm_config_file}"
-fi
-
echo "Attempt update of bash profiles..."
if [ ! -f "${gvm_bash_profile}" -a ! -f "${gvm_profile}" ]; then
echo "#!/bin/bash" > "${gvm_bash_profile}"
View
3 src/main/resources/scripts/selfupdate.sh
@@ -72,7 +72,8 @@ fi
echo "Prime the config file..."
gvm_config_file="${GVM_DIR}/etc/config"
-echo "isolated_mode=1" > "${gvm_config_file}"
+rm "${gvm_config_file}"
+touch "${gvm_config_file}"
echo "Download new scripts to: ${gvm_tmp_zip}"
curl -s "${GVM_SERVICE}/res?platform=${gvm_platform}&purpose=selfupdate" > "${gvm_tmp_zip}"
View
1 src/test/cucumber/gvm/current_candidate.feature
@@ -1,7 +1,6 @@
Feature: Current Candidate
Background:
- Given isolated mode is active
And the internet is reachable
Scenario: Display current candidate version in use
View
4 src/test/cucumber/gvm/install_gvm.feature
@@ -67,7 +67,7 @@ Feature: Install GVM
When I open a new Login Shell
Then the "gvm-init.sh" script is sourced once only
- Scenario: Do not Source the Initialisation Script on subsequent invokation of the Init Snippet
+ Scenario: Do not Source the Initialisation Script on subsequent invocation of the Init Snippet
Given the user home contains a ".bash_profile" file
And the ".bash_profile" contains an Initialisation Snippet
And the user home contains a ".bashrc" file
@@ -80,5 +80,3 @@ Feature: Install GVM
And the configuration file has not been primed
When I run the installation script
Then the configuration file is present
- And the configuration file contains "isolated_mode=0"
-
View
24 src/test/cucumber/gvm/local_developement_versions.feature
@@ -47,26 +47,4 @@ Feature: Local Development Versions
And the candidate "groovy" version "2.1-SNAPSHOT" is already linked to "/tmp/groovy-core"
When I enter "gvm use groovy 2.1-SNAPSHOT"
Then I see "Using groovy version 2.1-SNAPSHOT in this shell"
- And the candidate "groovy" version "2.1-SNAPSHOT" should be in use
-
- Scenario: Switch from a local version to a standard one in isolated mode
- Given isolated mode is active
- Given the candidate "groovy" version "2.0.5" is already installed and default
- And the candidate "groovy" version "dev" is already linked to "/tmp/groovy-core"
- When I enter "gvm use groovy dev"
- Then I see "Using groovy version dev in this shell"
- When I enter "gvm use groovy 2.0.5"
- Then I see "Using groovy version 2.0.5 in this shell"
- When I enter "gvm current groovy"
- Then I see "Using groovy version 2.0.5"
-
- Scenario: Switch from a local version to a standard one
- Given isolated mode is not active
- Given the candidate "groovy" version "2.0.5" is already installed and default
- And the candidate "groovy" version "dev" is already linked to "/tmp/groovy-core"
- When I enter "gvm use groovy dev"
- Then I see "Using groovy version dev in this shell"
- When I enter "gvm use groovy 2.0.5"
- Then I see "Using groovy version 2.0.5 in this shell"
- When I enter "gvm current groovy"
- Then I see "Using groovy version 2.0.5"
+ And the candidate "groovy" version "2.1-SNAPSHOT" should be in use
View
14 src/test/cucumber/gvm/upgrade.feature
@@ -12,18 +12,6 @@ Feature: Upgrade
And the staging folder is cleaned up
And I see "Successfully upgraded GVM."
- Scenario: Upgrade an installation without configuration
- Given the configuration file has not been primed
- When I enter "gvm selfupdate"
- Then the configuration file is present
- And the configuration file contains "isolated_mode=1"
-
- Scenario: Upgrade an installation with configuration
- Given the configuration file has been primed with "isolated_mode=0"
- When I enter "gvm selfupdate"
- Then the configuration file is present
- And the configuration file contains "isolated_mode=1"
-
Scenario: Upgrade an installation with dodgy configuration
Given a configuration file in the extensions folder
When I enter "gvm selfupdate"
@@ -41,4 +29,4 @@ Feature: Upgrade
Given the candidate "vertx" version "1.3.0.final" is already installed and default
When I enter "gvm selfupdate"
Then the candidate "vertx" version "1.3.0.final" is installed
- And the candidate "vert.x" version "1.3.0.final" is not installed
+ And the candidate "vert.x" version "1.3.0.final" is not installed
View
5 ...test/cucumber/gvm/isolated_shells.feature → ...ber/gvm/use_and_default_candidate.feature
@@ -1,8 +1,7 @@
-Feature: Isolated Shells
+Feature: Use and Default Candidate
Background:
- Given isolated mode is active
- And the internet is reachable
+ Given the internet is reachable
Scenario: Use without providing a Candidate
When I enter "gvm use"
View
48 src/test/cucumber/gvm/use_candidate.feature
@@ -1,48 +0,0 @@
-Feature: Use Candidate without Isolated Shells
-
- Background:
- Given isolated mode is not active
- And the internet is reachable
-
- Scenario: Use without providing a Candidate
- When I enter "gvm use"
- Then I see "Usage: gvm <command> <candidate> [version]"
-
- Scenario: Use a version of an installed candidate that exists
- Given the candidate "grails" version "2.1.0" is already installed but not default
- When I enter "gvm use grails 2.1.0"
- Then the candidate "grails" version "2.1.0" should be the default
-
- Scenario: Use a version of an uninstalled candidate that exists
- Given the candidate "grails" version "2.1.0" is not installed
- When I enter "gvm use grails 2.1.0" and answer "Y"
- Then I see "Stop! grails 2.1.0 is not installed."
- And I see "Do you want to install it now? (Y/n)"
- And the candidate "grails" version "2.1.0" is installed
- Then the candidate "grails" version "2.1.0" should be the default
-
- Scenario: Use a version of a candidate that doesn't exist
- When I enter "gvm use grails 1.4.4"
- Then I see "Stop! 1.4.4 is not a valid grails version."
-
- Scenario: Use an installed candidate version
- Given the candidate "grails" version "1.3.9" is already installed and default
- And the candidate "grails" version "2.1.0" is already installed but not default
- When I enter "gvm use grails 2.1.0"
- Then the candidate "grails" version "2.1.0" should be the default
- And the candidate "grails" version "1.3.9" is not in use
-
- Scenario: Use an uninstalled candidate version and choose to install it
- Given the candidate "grails" version "1.3.9" is already installed and default
- And the candidate "grails" version "2.1.0" is not installed
- When I enter "gvm use grails 2.1.0" and answer "Y"
- Then the candidate "grails" version "2.1.0" is installed
- And the candidate "grails" version "2.1.0" should be the default
- And the candidate "grails" version "1.3.9" is not in use
-
- Scenario: Use an uninstalled candidate version and choose not to install it
- Given the candidate "grails" version "1.3.9" is already installed and default
- And the candidate "grails" version "2.1.0" is not installed
- When I enter "gvm use grails 2.1.0" and answer "N"
- Then the candidate "grails" version "2.1.0" is not installed
- And the candidate "grails" version "1.3.9" should be the default
View
12 src/test/resources/gvm/initialisation_steps.groovy
@@ -17,18 +17,6 @@ Given(~'^an initialised system$') { ->
gvmDir.mkdirs()
}
-Given(~'^isolated mode is active$') { ->
- def etcDir = new File(gvmDir, "etc")
- etcDir.mkdirs()
- new File(etcDir, "config").text = "isolated_mode=1\n"
-}
-
-Given(~'^isolated mode is not active$') {->
- def etcDir = new File(gvmDir, "etc")
- etcDir.mkdirs()
- new File(etcDir, "config").text = "isolated_mode=0\n"
-}
-
When(~'^the archive for candidate "([^"]*)" version "([^"]*)" is corrupt$') { String candidate, String version ->
try {
new ZipFile(new File("src/test/resources/${candidate}-${version}.zip"))
View
4 src/test/resources/gvm/upgrade_steps.groovy
@@ -1,7 +1,5 @@
package gvm
-import cucumber.runtime.PendingException
-
import static cucumber.runtime.groovy.EN.*
And(~'^the configuration file has been primed with "([^"]*)"$') { String content ->
@@ -28,7 +26,7 @@ And(~'^the configuration file contains "([^"]*)"$') { String content ->
Given(~'^a configuration file in the extensions folder$') {->
def configFile = "$gvmDir/ext/config" as File
- configFile << "isolated_mode=1"
+ configFile.text = ""
}
And(~'^the configuration is not present in the extensions folder$') {->

0 comments on commit b8c279f

Please sign in to comment.