File: save-pact

package info (click to toggle)
pact 980714-3
  • links: PTS
  • area: main
  • in suites: slink
  • size: 13,096 kB
  • ctags: 26,034
  • sloc: ansic: 109,076; lisp: 9,645; csh: 7,147; fortran: 1,050; makefile: 136; lex: 95; sh: 32
file content (204 lines) | stat: -rwxr-xr-x 4,090 bytes parent folder | download | duplicates (2)
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
#!/bin/csh -f
#

set Public    = `grep InstDir installx | awk  '{print $4}'`
set VarDir    = /var/tmp
set SchemeDir = `grep SchemeDir installx | awk  '{print $4}'`
set Owner     = `grep Owner installx | awk  '{print $4}'`
set Group     = `groups | awk '{print $1}'`

rm installx

set Bins = `cat pact.bin`
set Libs = `cat pact.lib`
set Incs = `cat pact.include`
set Scms = `cat pact.scheme`
set Scrs = `cat pact.script`

set TmpDir = $VarDir/pactold
set machine = `cat machinex`
if ($machine == "helix64") then
  set TmpDir = $VarDir/pactold64
endif
if ($machine == "helixn32") then
  set TmpDir = $VarDir/pactoldn32
endif
if ($machine == "helixo32") then
  set TmpDir = $VarDir/pactoldo32
endif

rm machinex

echo ""
echo "BACKING UP Current Version of PACT ..."
echo "  from $Public to $TmpDir"

chdir $Public/bin

set IsOk = 1
if (-e $TmpDir) then
   set IsOk = 0
endif
if ($IsOk == 1) then
   mkdir $TmpDir
   chgrp $Group $TmpDir
   chmod 775 $TmpDir
endif
set DestDir = $TmpDir/bin

# backup executable files
echo ""
echo "Copying PACT files from $Public/bin  to $TmpDir/bin"

set IsOk = 1
if (-e $DestDir) then
   set IsOk = 0
endif
if ($IsOk == 1) then
   mkdir $DestDir
   chgrp $Group $DestDir
   chmod 775 $DestDir
endif

foreach file ($Scrs)
   if (-e $file) then
      cp $file $DestDir
      if ($status != 0) then
         echo "   $file COPY FAILED ($status)"
      else
         echo "   $file"
      endif
   endif
end

# [use -s to strip executables]
foreach file ($Bins)
   if (-e $file) then
      cp $file $DestDir
      if ($status != 0) then
         echo "   $file COPY FAILED ($status)"
      else
         echo "   $file"
      endif
   endif
end
chgrp $Group $DestDir/*
chmod 775 $DestDir/*

# backup include files
chdir ../include
set DestDir = $TmpDir/include
echo ""
set IsOk = 1
if (-e $DestDir) then
   set IsOk = 0
endif
if ($IsOk == 1) then
   mkdir $DestDir
   chgrp $Group $DestDir
   chmod 775 $DestDir
endif
echo "Copying PACT files from $Public/include to $DestDir"
foreach file ($Incs)
   if (-e $file) then
      cp $file $DestDir
      if ($status != 0) then
         echo "   $file   COPY FAILED ($status)"
      else
         echo "   $file"
      endif
   endif
end
chgrp $Group $DestDir/*
chmod 664 $DestDir/*

# backup lib files
chdir ../lib
set DestDir = $TmpDir/lib
echo ""
set IsOk = 1
if (-e $DestDir) then
   set IsOk = 0
endif
if ($IsOk == 1) then
   mkdir $DestDir
   chgrp $Group $DestDir
   chmod 775 $DestDir
endif
echo "Copying PACT files from $Public/lib to $DestDir"
foreach file ($Libs)
   if (-e $file) then
      cp $file $DestDir
      if ($status != 0) then
         echo "   $file COPY FAILED ($status)"
      else
         echo "   $file"
      endif
   endif
end
chgrp $Group $DestDir/*
chmod 664 $DestDir/*

# backup scheme files
chdir $SchemeDir
set DestDir = $TmpDir/scheme
echo ""
set IsOk = 1
if (-e $DestDir) then
   set IsOk = 0
endif
if ($IsOk == 1) then
   mkdir $DestDir
   chgrp $Group $DestDir
   chmod 775 $DestDir
endif
echo "Copying PACT files from $SchemeDir to $DestDir"
foreach file ($Scms)
   if (-e $file) then
      if (!(-d $file)) then
         cp $file $DestDir
         if ($status != 0) then
            echo "   $file COPY FAILED ($status)"
         else
            echo "   $file"
         endif
      endif
   endif
end
chgrp $Group $DestDir/*
chmod 664 $DestDir/*

# backup extensions files (if present)
if (-e extensions) then
   chdir extensions
   set DestDir = $SchemeDir/extensions
   echo ""
   set IsOk = 1
   if (-e $DestDir) then
      set IsOk = 0
   endif
   if ($IsOk == 1) then
      mkdir $DestDir
      chgrp $Group $DestDir
      chmod 775 $DestDir
   endif
   echo "Copying PACT files from $SchemeDir/extensions to $DestDir"
   foreach file (*)
      if (!(-d $file)) then
         cp $file $DestDir
         if ($status != 0) then
            echo "   $file COPY FAILED ($status)"
         else
            echo "   $file"
         endif
      endif
   end
   chgrp $Group $DestDir/*
   chmod 664 $DestDir/*
endif

echo ""
echo "... PACT BACKUP COMPLETE"
echo ""

exit(0)