forked from JSBSim-Team/jsbsim
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathjsb2fg
executable file
·78 lines (58 loc) · 1.63 KB
/
jsb2fg
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#!/bin/sh
#
if [ x$1 = x ]; then
echo "Usage: $0 [FlightGear source path (where is AUTHORS)]"
exit;
fi
if [ ! -d $1 -o ! -d $1/src/FDM/JSBSim ]; then
echo "Not the FlightGear Aircraft directory: $1"
exit;
fi
if [ ! -d engine ]; then
echo "Please change to the root directory of the JSBSim package."
exit;
fi
FG_SRC=`(cd $1; pwd)`
FG_DIR="$FG_SRC/src/FDM/JSBSim"
cd src
CUR_DIR=`pwd`
CP="cp"
#CP="echo"
NEW_FILES=
REMOVED_FILES=
$CP $FG_DIR/JSBSim.cxx ../examples/FlightGear.cxx
$CP $FG_DIR/JSBSim.hxx ../examples/FlightGear.hxx
for n in `find . -path './simgear' -prune -o -path './utilities' -prune -o -type f -name 'FG*.cpp' -o -name '*.h' -o -name string_utilities.h`; do
if [ -f $FG_DIR/$n ]; then
NUM=`diff $n $FG_DIR/$n | grep -e "^>" -e "^<" | wc -l`;
NID=`diff $n $FG_DIR/$n | grep -e "^>" -e "^<" | grep "\\$Id:" | wc -l`;
if [ ! $NUM -eq $NID ]; then
echo "$FG_DIR/$n";
$CP $n $FG_DIR/$n
fi;
else
NEW_FILES="$NEW_FILES $n";
fi;
done
if [ "x$NEW_FILES" != "x" ]; then
echo
echo "The following files where not found in the FlightGear source"
echo "directory:"
for n in $NEW_FILES; do echo " "$n; done
echo
fi;
cd $FG_DIR;
for n in `find . -type f -name 'FG*.cpp' -o -name 'FG*.h'`; do
if [ ! -f $CUR_DIR/$n ]; then
REMOVED_FILES="$REMOVED_FILES $n";
fi;
done
cd $CUR_DIR
if [ "x$REMOVED_FILES" != "x" ]; then
echo
echo "The following files where found in the FlightGear source"
echo "directory but are not present in the JSBSim root directory:"
for n in $REMOVED_FILES; do echo " "$n; done
echo
fi;
exit 0