forked from orientechnologies/orientdb
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfix-eclipse.sh
More file actions
executable file
·41 lines (36 loc) · 1.02 KB
/
fix-eclipse.sh
File metadata and controls
executable file
·41 lines (36 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/bash
if [ -z "$1" ]
then
echo "SYNTAX ERROR, USE: fix-eclipse.sh <root-path>"
exit
fi
echo "Updating version in Eclipse .classpath files..."
TFILE="/tmp/out.tmp.$$"
for filename in $(grep -r "J2SE-1.5" --include "*.classpath" $1|cut -f 1 -d :)
do
if [ -f $filename -a -r $filename ]; then
#/bin/cp -f $filename ${filename}.old
sed "s/J2SE-1.5/JavaSE-1.6/g" "$filename" > $TFILE && mv $TFILE "$filename"
else
echo "Error: Cannot read $filename"
fi
done
for filename in $(grep -r "1.5" --include "*/.settings/org.eclipse.jdt.core.prefs" $1|cut -f 1 -d :)
do
if [ -f $filename -a -r $filename ]; then
#/bin/cp -f $filename ${filename}.old
rm "$filename" > $TFILE && mv $TFILE "$filename"
else
echo "Error: Cannot read $filename"
fi
done
for filename in $(find $1 -name bin -print)
do
if [ -d $filename ]; then
#/bin/cp -f $filename ${filename}.old
rm -rf "$filename" > $TFILE && mv $TFILE "$filename"
else
echo "Error: Cannot read $filename"
fi
done
/bin/rm $TFILE 2>/dev/null