Improvement on platform specific hacks for cygwin.

This commit is contained in:
Marco Vermeulen
2013-01-18 14:18:50 +00:00
parent a9ccc82431
commit ac948a6a33
3 changed files with 42 additions and 3 deletions

View File

@@ -17,7 +17,21 @@
#
export GVM_VERSION="@GVM_VERSION@"
export GVM_PLATFORM=$(uname -o)
export GVM_PLATFORM=$(uname)
# OS specific support (must be 'true' or 'false').
cygwin=false;
darwin=false;
case "`uname`" in
CYGWIN*)
cygwin=true
;;
Darwin*)
darwin=true
;;
esac
if [ -z "${GVM_SERVICE}" ]; then
export GVM_SERVICE="@GVM_SERVICE@"

View File

@@ -41,6 +41,18 @@ gvm_init_snippet=$( cat << EOF
EOF
)
# OS specific support (must be 'true' or 'false').
cygwin=false;
darwin=false;
case "`uname`" in
CYGWIN*)
cygwin=true
;;
Darwin*)
darwin=true
;;
esac
echo ' '
@@ -170,7 +182,7 @@ echo "Download script archive..."
curl -s "${GVM_SERVICE}/res?platform=${gvm_platform}&purpose=install" > "${gvm_zip_file}"
echo "Extract script archive..."
if [[ $(uname -o) == "Cygwin" ]]; then
if [[ "${cygwin}" == 'true' ]]; then
echo "Cygwin detected - normalizing paths for unzip..."
unzip -qo $(cygpath -w "${gvm_zip_file}") -d $(cygpath -w "${gvm_stage_folder}")
else

View File

@@ -23,6 +23,19 @@ if [ -z "${GVM_DIR}" ]; then
GVM_DIR="$HOME/.gvm"
fi
# OS specific support (must be 'true' or 'false').
cygwin=false;
darwin=false;
case "`uname`" in
CYGWIN*)
cygwin=true
;;
Darwin*)
darwin=true
;;
esac
gvm_platform=$(uname -o)
gvm_bin_folder="${GVM_DIR}/bin"
gvm_tmp_zip="${GVM_DIR}/tmp/res-${GVM_VERSION}.zip"
@@ -66,7 +79,7 @@ curl -s "${GVM_SERVICE}/res?platform=${gvm_platform}&purpose=selfupdate" > "${gv
echo "Extract script archive..."
echo "Unziping scripts to: ${gvm_stage_folder}"
if [[ $(uname -o) == "Cygwin" ]]; then
if [[ "${cygwin}" == 'true' ]]; then
echo "Cygwin detected - normalizing paths for unzip..."
unzip -qo $(cygpath -w "${gvm_tmp_zip}") -d $(cygpath -w "${gvm_stage_folder}")
else