From e9254bf8d6b00453edf2a15f9b6fb5cf55fd5538 Mon Sep 17 00:00:00 2001 From: Esteban de la Canal Date: Fri, 13 Mar 2015 20:58:43 +0100 Subject: [PATCH] Fixes issue restarting on Linux On Linux when the updater runs it does so by restarting the ide via a while loop in the bash script. However the bash script is not run again. This has two problems: . If we update the bash script itself, these changes are not picked up. And this includes for example changing the selector directory. . VM options files and other config data is not read again so if we change them as part of the update, they will not be picked up. This change fixes both issues by re-launching the script if the IDE requests a restart. https://android-review.googlesource.com/#/c/137800/2 --- bin/scripts/unix/idea.sh | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/bin/scripts/unix/idea.sh b/bin/scripts/unix/idea.sh index 2778a8c353f8..0a2df34dd688 100755 --- a/bin/scripts/unix/idea.sh +++ b/bin/scripts/unix/idea.sh @@ -165,19 +165,18 @@ fi # --------------------------------------------------------------------- # Run the IDE. # --------------------------------------------------------------------- -while true ; do - LD_LIBRARY_PATH="$IDE_BIN_HOME:$LD_LIBRARY_PATH" "$JDK/bin/java" \ - $AGENT \ - "-Xbootclasspath/a:$IDE_HOME/lib/boot.jar" \ - -classpath "$CLASSPATH" \ - $VM_OPTIONS "-Djb.vmOptionsFile=$VM_OPTIONS_FILES_USED" \ - "-XX:ErrorFile=$HOME/java_error_in_@@product_uc@@_%p.log" \ - -Djb.restart.code=88 -Didea.paths.selector=@@system_selector@@ \ - $IDE_PROPERTIES_PROPERTY \ - $IDE_JVM_ARGS \ - $REQUIRED_JVM_ARGS \ - $MAIN_CLASS_NAME \ - "$@" - EC=$? - test $EC -ne 88 && exit $EC -done +LD_LIBRARY_PATH="$IDE_BIN_HOME:$LD_LIBRARY_PATH" "$JDK/bin/java" \ + $AGENT \ + "-Xbootclasspath/a:$IDE_HOME/lib/boot.jar" \ + -classpath "$CLASSPATH" \ + $VM_OPTIONS "-Djb.vmOptionsFile=$VM_OPTIONS_FILES_USED" \ + "-XX:ErrorFile=$HOME/java_error_in_@@product_uc@@_%p.log" \ + -Djb.restart.code=88 -Didea.paths.selector=@@system_selector@@ \ + $IDE_PROPERTIES_PROPERTY \ + $IDE_JVM_ARGS \ + $REQUIRED_JVM_ARGS \ + $MAIN_CLASS_NAME \ + "$@" +EC=$? +test $EC -ne 88 && exit $EC +exec "$0" "$@"