mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-22 14:12:10 +02:00

- Fix indentation - Call install.sh from cdtdebug.sh if installation needed. This should help the user realize they can run the script outside if the eclipse installation directory after the first time. - Use a subshell to run pwd to avoid having to actually change directory. - Tag the line that needs to be modified with a marker to make it future-proof. - Use find instead of ls which is easier to parse. - Allow to run install.sh without doing a cd to its location - Allow to run original cdtdebug.sh without doing a cd to its location Change-Id: I3f63dcf8a307784b0c38a286e645ea962ce62dc4 Signed-off-by: Marc Khouzam <marc.khouzam@ericsson.com> Reviewed-on: https://git.eclipse.org/r/29834 Tested-by: Hudson CI
43 lines
2 KiB
Bash
Executable file
43 lines
2 KiB
Bash
Executable file
#!/bin/sh
|
|
###############################################################################
|
|
# Copyright (c) 2014 Red Hat, Inc. and others
|
|
# All rights reserved. This program and the accompanying materials
|
|
# are made available under the terms of the Eclipse Public License v1.0
|
|
# which accompanies this distribution, and is available at
|
|
# http://www.eclipse.org/legal/epl-v10.html
|
|
#
|
|
# Contributors:
|
|
# Red Hat Inc. - initial API and implementation
|
|
###############################################################################
|
|
|
|
# Verify that the install script is being run from a plug-ins folder of a
|
|
# downloaded Eclipse and not in a local user .eclipse folder.
|
|
|
|
SCRIPT_DIR=`dirname $0`
|
|
|
|
if [ ! -f "$SCRIPT_DIR/../../../eclipse" ]; then
|
|
echo "$0: error: eclipse executable not found in expected location"
|
|
echo " "
|
|
echo "This can occur if you are running this script from your local .eclipse directory"
|
|
echo "which would mean you are running a shared instance of the Eclipse platform for"
|
|
echo "your distro and have installed the Stand-alone Debugger from an eclipse.org"
|
|
echo "download repo. Downloading the Stand-alone Debugger feature on top of a distro"
|
|
echo "version of Eclipse Debugger is not supported. If you are using a distro version"
|
|
echo "of the Eclipse platform, you should not use this script. Instead, install the"
|
|
echo "corresponding Eclipse CDT package for your distro (e.g. eclipse-cdt package)"
|
|
echo "which will install the Stand-alone Debugger for you."
|
|
exit 1
|
|
fi
|
|
|
|
if [ ! -d "$HOME/cdtdebugger" ]; then
|
|
mkdir -p "$HOME/cdtdebugger"
|
|
fi
|
|
cp "$SCRIPT_DIR/config.ini" "$HOME/cdtdebugger"
|
|
cp "$SCRIPT_DIR/dev.properties" "$HOME/cdtdebugger"
|
|
cp "$SCRIPT_DIR/cdtdebug.sh" "$HOME/cdtdebugger"
|
|
chmod +x "$HOME/cdtdebugger/cdtdebug.sh"
|
|
|
|
ECLIPSE_HOME=$(cd "$SCRIPT_DIR/../../.." && pwd)
|
|
# Replace the entire line with tag @#@# by the actual location of the eclipse installation
|
|
sed -i -e "s,^.*@#@#.*$,ECLIPSE_HOME=$ECLIPSE_HOME," "$HOME/cdtdebugger/cdtdebug.sh"
|
|
echo "Installation complete"
|