-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_upgrade_sgi
executable file
·79 lines (73 loc) · 1.96 KB
/
run_upgrade_sgi
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
#
echo " "
echo " SGI Source Code Merge Utility"
echo " "
echo "Enter directory path of the original (base) code:"
set trunk1=($<)
echo "Enter directory path of one of the devolopment branches:"
set branch1=($<)
echo "Enter directory path of the other development branches:"
set branch2=($<)
echo "Enter directory path for the new (updated) code:"
set trunk2=($<)
if (!(-d $trunk2)) then
mkdir $trunk2
else
if ("$trunk2" == "$trunk1") then
echo " directory for updated code should not be the same as the base directory"
exit
endif
endif
if (!(-d $branch1)) then
echo " branch directory $branch1 does not exist."
exit
endif
if (!(-d $branch2)) then
echo " branch directory $branch2 does not exist."
exit
endif
echo " ==> building the list of changed files ..."
mkdir TEMPUPDATElist
cp $branch1/*.[Ffh] TEMPUPDATElist
cp $branch2/*.[Ffh] TEMPUPDATElist
cd TEMPUPDATElist
set list = `ls`
cd ../
rm -r TEMPUPDATElist
echo " file list = $list"
echo ' '
foreach file ($list)
set file1 = $branch1/$file
set file2 = $trunk1/$file
set file3 = $branch2/$file
set file4 = $trunk2/$file
echo " "
echo "==> working on $file ..."
if (-e $file1 && -e $file3) then
if (-e $file2) then
echo "$file exits in $trunk1, $branch1 and $branch2"
merge -p $file1 $file2 $file3 > $file4
else
echo "$file exits only in $branch1 and $branch2"
merge -p $file1 $file1 $file3 > $file4
endif
endif
if (!(-e $file1) && -e $file3) then
if (-e $file2) then
echo "$file exits in $trunk1 and $branch2"
merge -p $file3 $file2 $file3 > $file4
else
echo "$file only exits in $branch2 ... copying to $file4"
cp $file3 $file4
endif
endif
if (-e $file1 && !(-e $file3)) then
if (-e $file2) then
echo "$file exits in $trunk1 and $branch1"
merge -p $file1 $file2 $file1 > $file4
else
echo "$file only exits in $branch1 ... copying to $file4"
cp $file1 $file4
endif
endif
end