From df07cea946efc5bffb43b25855607f2762a70643 Mon Sep 17 00:00:00 2001 From: Spacelord Date: Fri, 6 Dec 2019 20:22:16 +0100 Subject: todo --- installer_todo | 1 + 1 file changed, 1 insertion(+) create mode 100644 installer_todo diff --git a/installer_todo b/installer_todo new file mode 100644 index 0000000..c9935ae --- /dev/null +++ b/installer_todo @@ -0,0 +1 @@ +-Updater (Remote Repo letzten tag lesen und mit lokaler installation abgleichen) \ No newline at end of file -- cgit v1.2.3 From 2fb3801be65cd98a6069f503897da93033b5049e Mon Sep 17 00:00:00 2001 From: Spacelord Date: Sat, 7 Dec 2019 15:22:58 +0100 Subject: Convert user check to 1line --- installer.sh | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/installer.sh b/installer.sh index eab9f50..1a6301c 100755 --- a/installer.sh +++ b/installer.sh @@ -97,10 +97,7 @@ CLEAN () { trap ERROR SIGINT SIGTERM SIGKILL clear -if [ $user != "root" ]; then # Check if $user = root! - echo "Installer must be run as root" - ERROR -fi +if [ $user != "root" ]; then echo "Installer must be run as root"; ERROR; fi # Check if $user = root! if [ $(wget -q --spider http://github.com) $? -eq 0 ]; then "INSTALL-DEPS"; else echo You need connection to the internet; ERROR ; fi -- cgit v1.2.3 From 95eac9cccb2cba39446f83e8803565f018fa411b Mon Sep 17 00:00:00 2001 From: Spacelord Date: Sat, 7 Dec 2019 16:36:09 +0100 Subject: Git checkout fix (again) --- installer.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/installer.sh b/installer.sh index 1a6301c..ae6518e 100755 --- a/installer.sh +++ b/installer.sh @@ -41,8 +41,10 @@ INSTALL-PREP () { Iversion=(git describe --abbrev=0) # Get last tag(stable version) echo "Starting Git checkout to "$Iversion"" git init $tmp_path - git checkout $Iversion $tmp_path - + ( + cd $tmp_path + git checkout $Iversion $tmp_path + ) echo "" read -e -i "$VAR_PREFIX" -p "PREFIX (Install root directory): " input # Reads VAR_PREFIX -- cgit v1.2.3 From 2e1c2f63ef728027ebb8183599a4ebba734c8a04 Mon Sep 17 00:00:00 2001 From: Spacelord Date: Sat, 7 Dec 2019 16:41:44 +0100 Subject: checkout fix again (bugfix) --- installer.sh | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/installer.sh b/installer.sh index ae6518e..dab1afc 100755 --- a/installer.sh +++ b/installer.sh @@ -41,10 +41,7 @@ INSTALL-PREP () { Iversion=(git describe --abbrev=0) # Get last tag(stable version) echo "Starting Git checkout to "$Iversion"" git init $tmp_path - ( - cd $tmp_path - git checkout $Iversion $tmp_path - ) + (cd $tmp_path; git checkout $Iversion) echo "" read -e -i "$VAR_PREFIX" -p "PREFIX (Install root directory): " input # Reads VAR_PREFIX -- cgit v1.2.3 From c038fee6bd4888749691299456f8e95611677e43 Mon Sep 17 00:00:00 2001 From: Spacelord Date: Sat, 7 Dec 2019 17:40:35 +0100 Subject: git checkout bug fix.. --- installer.sh | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/installer.sh b/installer.sh index dab1afc..fc544f6 100755 --- a/installer.sh +++ b/installer.sh @@ -7,7 +7,7 @@ user=$(whoami) # for bypassing user check replace "$(whoami)" w script_path="`cd $0; pwd`" # Script dir tmp_path=$(mktemp -d) # Repo download path -Iversion="v0.2" # (fallback version if ) +Iversion="TEST!" # (fallback version if ) makeargs=all # Build args VAR_DESTDIR="" # Unused @@ -38,10 +38,35 @@ echo "" INSTALL-PREP () { echo "Starting Git!" git clone https://github.com/cbdevnet/midimonster.git "$tmp_path" # Gets Midimonster - Iversion=(git describe --abbrev=0) # Get last tag(stable version) - echo "Starting Git checkout to "$Iversion"" + +( + echo "" + echo "" + cd $tmp_path + echo "IVer.: $Iversion" + + echo "Start GIT INIT" git init $tmp_path - (cd $tmp_path; git checkout $Iversion) + + echo "IVer.: $Iversion VOR GIT DESCRIBE!" + echo "" + + + echo "Starting git describe.." + Iversion=$(git describe --abbrev=0) # Get last tag(stable version) + echo "IVer.: $Iversion NACH GIT DESCRIBE!" + + echo "" + + + echo "Starting Git checkout to "$Iversion"" + git checkout $Iversion + ) + echo "" + echo "Done. (Iver.: $Iversion)" + + + echo "" read -e -i "$VAR_PREFIX" -p "PREFIX (Install root directory): " input # Reads VAR_PREFIX -- cgit v1.2.3 From 565c75ff0c0b828b370179e0b877d629503794e5 Mon Sep 17 00:00:00 2001 From: Spacelord Date: Sat, 7 Dec 2019 18:17:05 +0100 Subject: Finally git checkout bug with subshell fixed. --- installer.sh | 35 ++++++++++------------------------- 1 file changed, 10 insertions(+), 25 deletions(-) diff --git a/installer.sh b/installer.sh index fc544f6..fd4dd91 100755 --- a/installer.sh +++ b/installer.sh @@ -7,7 +7,6 @@ user=$(whoami) # for bypassing user check replace "$(whoami)" w script_path="`cd $0; pwd`" # Script dir tmp_path=$(mktemp -d) # Repo download path -Iversion="TEST!" # (fallback version if ) makeargs=all # Build args VAR_DESTDIR="" # Unused @@ -36,37 +35,24 @@ echo "" } INSTALL-PREP () { - echo "Starting Git!" - git clone https://github.com/cbdevnet/midimonster.git "$tmp_path" # Gets Midimonster - -( +(#### Subshell make things like cd $tmp_path easier to revert + echo "Starting download..." + git clone https://github.com/cbdevnet/midimonster.git "$tmp_path" # Gets Midimonster echo "" echo "" + echo "Initializing repository..." cd $tmp_path - echo "IVer.: $Iversion" - - echo "Start GIT INIT" git init $tmp_path - - echo "IVer.: $Iversion VOR GIT DESCRIBE!" echo "" - - - echo "Starting git describe.." + echo "Finding latest stable version..." Iversion=$(git describe --abbrev=0) # Get last tag(stable version) - echo "IVer.: $Iversion NACH GIT DESCRIBE!" - - echo "" + echo "Starting Git checkout to "$Iversion"..." + git checkout -f -q $Iversion + echo "Done." + ) - - echo "Starting Git checkout to "$Iversion"" - git checkout $Iversion - ) echo "" - echo "Done. (Iver.: $Iversion)" - - - + echo "" echo "" read -e -i "$VAR_PREFIX" -p "PREFIX (Install root directory): " input # Reads VAR_PREFIX @@ -117,7 +103,6 @@ CLEAN () { ################################################ Main ################################################# - trap ERROR SIGINT SIGTERM SIGKILL clear -- cgit v1.2.3