configurationengine/source/cone.sh
changeset 3 e7e0ae78773e
parent 0 2e8eeb919028
equal deleted inserted replaced
2:87cfa131b535 3:e7e0ae78773e
     5 # This component and the accompanying materials are made available
     5 # This component and the accompanying materials are made available
     6 # under the terms of "Eclipse Public License v1.0"
     6 # under the terms of "Eclipse Public License v1.0"
     7 # which accompanies this distribution, and is available
     7 # which accompanies this distribution, and is available
     8 # at the URL "http://www.eclipse.org/legal/epl-v10.html".
     8 # at the URL "http://www.eclipse.org/legal/epl-v10.html".
     9 #
     9 #
    10 # Initial Contributors:
    10 # Contributors:
    11 # Nokia Corporation - initial contribution.
    11 # Nokia Corporation - initial contribution.
    12 #
    12 #
    13 # Contributors:
    13 # Description:
    14 #
       
    15 # Description: 
       
    16 #  ConE tool wrapper for Unix
    14 #  ConE tool wrapper for Unix
    17 
    15 
    18 # Check that Python is available
    16 # Check that Python is available
    19 # ------------------------------
    17 # ------------------------------
    20 python --version &> /dev/null
    18 python -c None &> /dev/null
    21 if [ $? -ne 0 ]
    19 if [ $? -ne 0 ]
    22 then
    20 then
    23     echo "Python is required to run ConE!"
    21     echo "Python is required to run ConE!"
    24     exit 1
    22     exit 1
    25 fi
    23 fi
    26 
    24 
    27 
    25 
    28 # Determine the path where ConE is installed
    26 # Determine the path where ConE is installed
    29 # ------------------------------------------
    27 # ------------------------------------------
    30 
    28 
    31 # Try to derefence a symlink
    29 SCRIPT_FILE=`readlink -f $0`
    32 SCRIPT_FILE=`readlink $0`
    30 CONE_BASEDIR=`dirname "$SCRIPT_FILE"`/configurationengine/linux
    33 if [ "$SCRIPT_FILE" = "" ]
    31 
       
    32 if [ ! -e "$CONE_BASEDIR" ]
    34 then
    33 then
    35     # Not a symlink, the first command line parameter can be used
    34     echo "Cannot run ConE, the ConE base directory does not exist:"
    36     SCRIPT_FILE=$0
    35     echo $CONE_BASEDIR
       
    36     exit 1
    37 fi
    37 fi
    38 CONE_BASEDIR=`dirname "$SCRIPT_FILE"`/cone
       
    39 
       
    40 
    38 
    41 # Find out the Python version
    39 # Find out the Python version
    42 # ---------------------------
    40 # ---------------------------
    43 PYTHON_VERSION=`python -c "import sys; print sys.version[:3]"`
    41 PYTHON_VERSION=`python -c "import sys; sys.stdout.write(sys.version[:3])"`
    44 #echo "Python version: $PYTHON_VERSION"
    42 #echo "Python version: $PYTHON_VERSION"
    45 
    43 
    46 
    44 
    47 # Set the correct lib and scripts directories
    45 # Set the correct lib and scripts directories
    48 # to use based on the Python version
    46 # to use based on the Python version
    78 # --------------------------------------------
    76 # --------------------------------------------
    79 export PYTHONPATH="$CONE_BASEDIR/lib:$PYTHONPATH"
    77 export PYTHONPATH="$CONE_BASEDIR/lib:$PYTHONPATH"
    80 
    78 
    81 # Run cone_tool.py
    79 # Run cone_tool.py
    82 # ----------------
    80 # ----------------
    83 python $CONE_BASEDIR/scripts/cone_tool.py $@
    81 python $CONE_BASEDIR/scripts/cone_tool.py "$@"