eclipse/eclipse-reconciler.sh
Sami Wagiaalla 33c0464e31 Extract .so files after installation.
- Install .so extraction file.
- eclipse-reconciler script now extract .so
  files if the reconciler is run with -clean
2011-10-03 14:47:13 -04:00

69 lines
1.9 KiB
Bash
Executable File

#!/bin/bash
# This script runs the eclipse can do the following:
# - backup configuration files
# - restore configuration files from backup loation
# - run the eclipse reconciler
# - delete the backup files.
# A list of the files of directory that are to be backed up
config_files=("artifacts.xml" "eclipse.ini" "p2" "configuration")
if [ $# -ge 2 ]
then
echo "backing up configuration files"
for file in ${config_files[@]}
do
echo $file
cp -r $1/$file $2/$file
done
echo "Running eclipse reconciler"
pushd $1
./eclipse --launcher.suppressErrors -nosplash -consolelog -application org.eclipse.equinox.p2.reconciler.application ${@:3}
r_exit_value=$?
if [ $# -ge 3 ] && [ $3 == "-clean" ]
then
echo "Running the initializer"
./eclipse --launcher.suppressErrors -cosolelog -nosplash -application org.eclipse.equinox.initializer.configInitializer -fileInitializer extract_patterns.txt
i_exit_value=$?
else
i_exit_value=0
fi
# Check exit value
if [ ! $i_exit_value -eq 0 ] || [ ! $r_exit_value -eq 0 ]
then
# Restore files
echo "Reconciler failed. Restoring files"
for file in ${config_files[@]}
do
echo $file
cp --remove-destination -Tr $2/$file $1/$file
done
fi
popd
#delete the backup files
for file in ${config_files[@]}
do
rm -rf $2/$file
done
exit $exit_value
fi
echo "Invalid options"
echo ""
echo "Usage:"
echo ""
echo " eclipse-reconciler <eclipse dir> <backup location> [-clean] [reconciler parameters]"
echo " Backsup configuration files in the given location, run the reconciler"
echo " and restore the files if there is a problem at the end delete backup files."
echo " If the -clean option is specified -clean is passed to the reoconciler, and the"
echo " And the initializer is rerun after reconcilation. Any parameters given after"
echo " the first three are passed directly to the reconciler"
exit 1;