Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 161852 Details for
Bug 305642
Support shared configurable multi-user installs
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
example feature management script
eclipse-install (text/plain), 8.02 KB, created by
James Blackburn
on 2010-03-12 04:39:57 EST
(
hide
)
Description:
example feature management script
Filename:
MIME Type:
Creator:
James Blackburn
Created:
2010-03-12 04:39:57 EST
Size:
8.02 KB
patch
obsolete
>#! /bin/bash ># ># $Id: eclipse-install,v 1.3 2010/02/03 16:11:53 jamesb Exp $ ># ># Wrapper for Installing features into a user's Eclipse configuration > >. /projects/firepath/tools/bin/.wrapper/wrapper-common.sh > ># print a usage message and exit >usage () { > [ -n "$ERROR" ] && echo "ERROR: $ERROR" > echo "Usage: eclipse-install {options}" > echo " Customise the Eclipse plugins installed" > echo "Current Environment:" > echo " ECLIPSE_VERSION=$ECLIPSE_VERSION" > echo "Options:" > echo "-s Show currently installed plugins" > echo "" > echo "-l List possible plugins to install" > echo "-l {name} List all versions of specified feature" > echo "-i <name> {version} Install feature into the current configuration with " > echo " optional version. If version is unspecified then" > echo " default version is used tracking the platform default." > echo "-d <name> Remove the feature from Eclipse" ># echo "-c <config> Operate on the specified configuration" ># echo "" ># echo "--init Installs / Checks the default set of features " > exit 1 >} > >[ "$ECLIPSE_VERSION" ] || fatal "ECLIPSE_VERSION is unset" > >P=eclipse >V=$ECLIPSE_VERSION >T=eclipse > ># Don't work with older versions >if [[ "$V" = 3.[1-4]* ]] ; then > ERROR="Only compatible with ECLIPSE_VERSION >= 3.5" > usage >fi > >ECLIPSE_BASE=$FPT_TOOLS_REL/$P >ECLIPSE_EXTENSIONS=$ECLIPSE_BASE/p2extensions >ECLIPSE_INSTALL=$ECLIPSE_BASE/$ECLIPSE_VERSION >ECLIPSE_USERDIR=$HOME/.eclipse > ># Test that the versions all exist >[ -d $ECLIPSE_BASE ] || fatal "no such package: $P" >[ -d $ECLIPSE_INSTALL ] || fatal "package $P has no version $V" >[ -x $ECLIPSE_INSTALL/$T ] || fatal "no such tool $T in package $P, version $V" > > ># p2-extensions is layed out (by convention): ># $ECLIPSE_ENTENSIONS/<feature_name>/<version_1> ># $ECLIPSE_ENTENSIONS/<feature_name>/<version_2> ># $ECLIPSE_ENTENSIONS/<feature_name>/... ># $ECLIPSE_ENTENSIONS/<feature_name>/default -- text file contains the name of the default version ># where default contains the string name of the current default version > ># The default set of features to include for each site >BASE_FEATURES="cvs pydev epic-perl " > ># Custom features used at other sites >case `/usr/bin/ypwhich` in > *.cam.*) > BASE_FEATURES=$BASE_FEATURES" subclipse" > ;; > *.mec.*) > BASE_FEATURES=$BASE_FEATURES" subclipse" > ;; > *.ban.*) > BASE_FEATURES=$BASE_FEATURES" ccrc" > ;; > *) echo "Location `/usr/bin/ypwhich` unknown; using default features: $BASE_FEATURES" ;; >esac ># Ensure first and last items math regexp >BASE_FEATURES=" "$BASE_FEATURES" " > >#echo $BASE_FEATURES > ># Parse the command line options >while true ; do > case "$1" in > -l) LIST_FEATURES=1 ; FEATURE_NAME=$2 ; break ;; > -i) INSTALL=1; shift; TO_INSTALL=$1 ; INSTALL_VERSION=$2 ; break ;; > -s) SHOW_INSTALLED=1 ; break ;; > -c) shift; ECLIPSE_CONFIG=$ECLIPSE_USERDIR/$1 ;; > -d) shift; TO_REMOVE=$1 ; break ;; > --init) INSTALL_BASE=1 ; break ;; > *) usage ;; > esac > shift >done > ># Calculate the platform >if [ `uname -m` = 'i686' ] ; then > PLATFORM=_x86 >elif [ `uname -m` = 'x86_64' ] ; then > PLATFORM=_x86_64 >fi > ># Configuration location is based upon version and platform - as generated by eclipse wrapper script >if [ -z "$ECLIPSE_CONFIG" ] ; then > ECLIPSE_CONFIG=$ECLIPSE_USERDIR/config${ECLIPSE_VERSION%-*}${PLATFORM} >fi > >#echo "Current ECLIPSE_VERSION=$ECLIPSE_VERSION" >#echo "Current configuration=$ECLIPSE_CONFIG" > ># Ensure that the dropins directory exists >DROPINS=$ECLIPSE_CONFIG/dropins/ >mkdir -p $DROPINS > >[ -e $DROPINS/warning ] || echo "Warning: Change installed features using eclipse-install -- please don't edit the files in this directory by hand!" > $DROPINS/warning > ># Install/check the default versions of the tools for a base launch > >pushd $DROPINS > /dev/null > ># handle --init base configuration >if [ -n "$INSTALL_BASE" ]; then > # Iterate over all the features to upgrade user tracking plugins > pushd $ECLIPSE_EXTENSIONS > /dev/null > for TOOL in `ls -d *` ; do > if [ ! -e $TOOL/default ] ; then > continue > fi > DEFAULT_VER=`cat $ECLIPSE_EXTENSIONS/$TOOL/default` > > pushd $DROPINS > /dev/null > # if the tool isn't installed && in the base feature set, > # || the user already has an older default version of the tool, update > CURR_VER=`ls $TOOL-*.link 2>/dev/null` > if [[ ( -z "$CURR_VER" && `expr "$BASE_FEATURES" : ".* $TOOL .*"` -ne 0 ) || $CURR_VER = $TOOL-default-* ]] ; then > > # Check that the default version exists -- i.e. I haven't messed up ... > if [ ! -d $ECLIPSE_EXTENSIONS/$TOOL/$DEFAULT_VER ] ; then > echo "ERROR: Default-Version $DEFAULT_VER doesn't exist for tool $TOOL" > fi > > # If the default has changed, remove and replace the previous default > if [ ! -e $DROPINS/$TOOL-default-$DEFAULT_VER.link ] ; then > rm $DROPINS/$TOOL-default-*.link > /dev/null 2>&1 > echo "Installing / Upgrading $TOOL to $DEFAULT_VER" > echo "path=$ECLIPSE_EXTENSIONS/$TOOL/$DEFAULT_VER" > $DROPINS/$TOOL-default-$DEFAULT_VER.link > fi > fi > popd > /dev/null > done > popd > /dev/null ># Handle listing installed plugins >elif [ -n "$SHOW_INSTALLED" ]; then > LINKS=`ls *.link 2>/dev/null` > if [ -z "$LINKS" ] ; then > ERROR="No features installed" > usage > fi > for LINK in $LINKS ; do > VER=${LINK##*-} > VER=${VER%%.link} > TOOL=${LINK%-*} > TOOL=${TOOL%-*} > echo -n "${TOOL} => $VER" > if [[ "$LINK" == *-default-* ]] ; then > echo -n " (default)" > fi > echo > done ># Handle show possible features to install >elif [ -n "$LIST_FEATURES" ]; then > > # Specified tool ? > if [ -n "$FEATURE_NAME" ] ; then > if [ ! -e $ECLIPSE_EXTENSIONS/$FEATURE_NAME/default ] ; then > ERROR="No tool $FEATURE_NAME use \"-l\" to see available features" > usage > fi > DEFAULT=`cat $ECLIPSE_EXTENSIONS/$FEATURE_NAME/default` > if [ -n "$FEATURE_NAME" ] ; then > echo "Available versions of \"$FEATURE_NAME\":" > ls $ECLIPSE_EXTENSIONS/$FEATURE_NAME/ | grep -v default > echo "Default: $DEFAULT" > fi > # Show all tools > else > TOOLS=`ls $ECLIPSE_EXTENSIONS` > for TOOL in $TOOLS ; do > if [ -e $ECLIPSE_EXTENSIONS/$TOOL/default ] ; then > DEFAULT=`cat $ECLIPSE_EXTENSIONS/$TOOL/default` > echo "$TOOL (default: $DEFAULT)" > fi > done > fi > >elif [ -n "$TO_INSTALL" ]; then > > # Check that the tool exists > if [ ! -d $ECLIPSE_EXTENSIONS/$TO_INSTALL ] ; then > ERROR="No tool $TO_INSTALL exists. Use \"-l\" to see available features" > usage > fi > if [[ -n "$INSTALL_VERSION" && ! -d $ECLIPSE_EXTENSIONS/$TO_INSTALL/$INSTALL_VERSION ]] ; then > ERROR="Tool $TO_INSTALL has no version $INSTALL_VERSION" > usage > fi > # Remove previous version > rm $DROPINS/$TO_INSTALL-*.link 2>/dev/null > > if [ -z "$INSTALL_VERSION" ] ; then > # Install the default version > INSTALL_VERSION=`cat $ECLIPSE_EXTENSIONS/$TO_INSTALL/default` > echo "Installing default version $INSTALL_VERSION of tool $TO_INSTALL, tracking tools team default" > echo "path=$ECLIPSE_EXTENSIONS/$TO_INSTALL/$INSTALL_VERSION" > $DROPINS/$TO_INSTALL-default-$INSTALL_VERSION.link > else > # Install the specified version of the tool into the user's configuration > echo "Installing fixed version $INSTALL_VERSION of tool $TO_INSTALL" > echo "path=$ECLIPSE_EXTENSIONS/$TO_INSTALL/$INSTALL_VERSION" > $DROPINS/$TO_INSTALL-custom-$INSTALL_VERSION.link > fi > >elif [ -n "$TO_REMOVE" ]; then > # Check that the tool exists > if [ ! -d $ECLIPSE_EXTENSIONS/$TO_REMOVE ] ; then > ERROR="No tool $TO_REMOVE exists to remove. Use \"-s\" to see what's installed" > usage > fi > > INSTALLED=`ls $DROPINS/${TO_REMOVE}*.link 2>/dev/null |grep -v removed` > if [[ -z "$INSTALLED" && -f $DROPINS/${TO_REMOVE}-removed.link ]] ; then > ERROR="Tool $TO_REMOVE already removed. Use \"-s\" to see what's installed" > usage > fi > > rm $DROPINS/${TO_REMOVE}*.link 2>/dev/null > touch $DROPINS/${TO_REMOVE}-removed.link > >else > usage >fi > >popd > /dev/null
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 305642
: 161852