-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathUP,v
executable file
·420 lines (367 loc) · 6.26 KB
/
UP,v
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
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
head 1.17;
access;
symbols;
locks; strict;
comment @# @;
1.17
date 2014.04.25.20.49.22; author root; state Exp;
branches;
next 1.16;
commitid 100535ACA6B24DF4105;
1.16
date 2013.10.23.22.22.50; author tg; state Exp;
branches;
next 1.15;
commitid 10052684C4D2EAA3291;
1.15
date 2012.10.18.14.40.15; author root; state Exp;
branches;
next 1.14;
commitid 100508014E828F3A38E;
1.14
date 2010.12.13.00.13.15; author root; state Exp;
branches;
next 1.12;
commitid 1004D056533751E565B;
1.12
date 2010.12.11.18.57.14; author root; state Exp;
branches;
next 1.11;
commitid 1004D03C9A2229B9DC3;
1.11
date 2009.09.08.17.07.10; author root; state Exp;
branches;
next 1.10;
commitid 1004AA68F564659EEA1;
1.10
date 2009.08.15.14.22.14; author root; state Exp;
branches;
next 1.9;
commitid 1004A86C4AE40828BE8;
1.9
date 2009.08.12.12.28.40; author root; state Exp;
branches;
next 1.8;
commitid 1004A82B59010A682A4;
1.8
date 2009.08.12.12.04.11; author root; state Exp;
branches;
next 1.7;
commitid 1004A82AFD3446D445B;
1.7
date 2008.12.13.17.28.22; author tg; state Exp;
branches;
next 1.6;
commitid 1004943F0BC414E55FA;
1.6
date 2008.08.30.11.58.03; author tg; state Exp;
branches;
next 1.5;
commitid 10048B935D75A234CBF;
1.5
date 2007.03.24.20.15.07; author tg; state Exp;
branches;
next 1.4;
commitid 100460586D86E816359;
1.4
date 2007.02.07.03.07.28; author root; state Exp;
branches;
next 1.3;
1.3
date 2006.08.14.21.34.25; author tg; state Exp;
branches;
next 1.2;
1.2
date 2006.08.14.21.23.58; author tg; state Exp;
branches;
next 1.1;
1.1
date 2006.08.14.21.19.32; author tg; state Exp;
branches;
next ;
desc
@MirOS auto-rsync script (production use)
@
1.17
log
@hugh -> fish
@
text
@#!/usr/bin/env mksh
# $Id: UP,v 1.16 2013/10/23 22:22:50 tg Exp root $
# sync MirOS CVS repo from primary anoncvs mirror
# (or other mirrors)
what=/cvs
nani=miros-cvs
for rsync in rsync rsync-static false; do
$rsync --version >/dev/null 2>&1 && break
done
if [[ $rsync = false ]]; then
echo >&2 Error: cannot find rsync
exit 1
fi
if wd=$(realpath .); then
vd=$(realpath $(dirname $0))
else
wd=$(pwd)
cd $(dirname $0)
vd=$(pwd)
fi
cd $vd
p=
a=0
sshx="--rsh=ssh -T"
while :; do
if [[ $1 = -H ]]; then
: ${CVSROOT:=_anoncvs@@herc.mirbsd.org:$what}
shift
elif [[ $1 = -J ]]; then
: ${CVSROOT:=rsync://rsync.allbsd.org/$nani}
shift
elif [[ $1 = -W ]]; then
: ${CVSROOT:=_anoncvs@@fish.mirbsd.org:$what}
shift
elif [[ $1 = -4 ]]; then
sshx="$sshx -4"
shift
else
break
fi
done
case $1 {
(q) p= ;;
(c) p=-cPv ;;
(C) p=-c ;;
(v) p=-v ;;
(*) p=-Pv ;;
}
[[ -n $1 || -n $2 ]] && shift
[[ -e $HOME/.etc/anonkey.mirbsd ]] && sshx="$sshx -i $HOME/.etc/anonkey.mirbsd"
[[ $CVSROOT = rsync://* ]] && sshx=
set -x
nice $rsync -rxlztpgaHS --delete --stats --exclude=/ign/ \
--numeric-ids ${sshx:+"$sshx"} $p "$@@" \
${CVSROOT:-_anoncvs@@anoncvs.mirbsd.org:$what}/ $vd/
rv=$?
cd $wd
if [[ $a = 1 ]]; then
umount $vd || rv=1
mount $vd || rv=1
fi
exit $rv
@
1.16
log
@do not use -K as it’s dangerous
@
text
@d2 1
a2 1
# $Id: UP,v 1.14 2010/12/13 00:13:15 root Exp root $
d34 2
a35 5
elif [[ $1 = -P ]]; then
: ${CVSROOT:=_anoncvs@@pfau.mirbsd.org:$what}
shift
elif [[ $1 = -M ]]; then
: ${CVSROOT:=_anoncvs@@hugh.mirbsd.org:$what}
@
1.15
log
@add hugh (as long as it’s not yet anoncvs)
@
text
@d58 1
a58 1
nice $rsync -rxlztpgaHKS --delete --stats --exclude=/ign/ \
@
1.14
log
@avoid mismatched nop-transfers due to UID/GID matching *sigh(
@
text
@d2 1
a2 1
# $Id: UP,v 1.12 2010/12/11 18:57:14 root Exp root $
d36 3
@
1.12
log
@add pfau as mirror
@
text
@d2 1
a2 1
# $Id: UP,v 1.11 2009/09/08 17:07:10 root Exp root $
d56 1
a56 1
${sshx:+"$sshx"} $p "$@@" \
@
1.11
log
@apply cid 1004A941275166E182F here as well
@
text
@d2 1
a2 1
# $Id: UP,v 1.10 2009/08/15 14:22:14 root Exp root $
d33 3
@
1.10
log
@variablise rsync programme name
@
text
@d2 1
a2 1
# $Id: UP,v 1.9 2009/08/12 12:28:40 root Exp root $
d52 1
a52 1
nice $rsync -rxlztpgaHK --delete --stats --exclude=/ign/ \
@
1.9
log
@rsync:// support, actually tested this time *sigh*
@
text
@d2 1
a2 1
# $Id: UP,v 1.8 2009/08/12 12:04:11 root Exp root $
d9 7
d52 1
a52 1
nice rsync -rxlztpgaHK --delete --stats --exclude=/ign/ \
@
1.8
log
@• add Japanese mirror at AllBSD.org, thanks Hiroki Sato
• rsync syntax wants trailing slashes behind both start
and end for more reliability
• improve comment a little
@
text
@d2 1
a2 1
# $Id: UP,v 1.7 2008/12/13 17:28:22 tg Exp root $
d43 1
d45 2
a46 1
nice rsync -rxlztpgaHK --delete --stats --exclude=/ign/ "$sshx" $p "$@@" \
@
1.7
log
@• _anoncvs at eurynome
• realpath
• no absolute paths
@
text
@d2 1
a2 1
# $Id: UP,v 1.3 2006/08/14 21:34:25 tg Exp root $
d4 1
d6 3
a19 1
what=/cvs
d24 3
d45 1
a45 1
${CVSROOT:-_anoncvs@@anoncvs.mirbsd.org:$what}/ $vd
@
1.6
log
@make synching from anoncvs mirror (eurynome) the default
@
text
@d5 2
a6 2
if wd=$(readlink -nf .); then
vd=$(readlink -nf $(dirname $0))
d39 2
a40 1
${CVSROOT:-anoncvs@@anoncvs.mirbsd.org:$what}/ $vd
d42 5
a46 2
[[ $a = 1 ]] && exec /bin/mksh -c "umount $vd; mount $vd"
exit 0
@
1.5
log
@rsync needs extra option to preserve hard links
@
text
@d3 1
a3 2
# sync MirOS CVS repo from primary server to primary anoncvs mirror,
# or (if using -B) from there to a secondary anoncvs mirror.
d16 1
d18 2
a19 5
if [[ $1 = -A ]]; then
a=1
shift
elif [[ $1 = -B ]]; then
: ${CVSROOT:=anoncvs@@anoncvs.mirbsd.org:/cvs}
d39 1
a39 1
${CVSROOT:-_anoncvs@@herc.mirbsd.org:/cvs}/ $vd
@
1.4
log
@* do not hardcode path to mksh
* parse -4 (put it with -A and -B in a loop)
* if 'UP "" -foo' shift the "" away to prevent hard to debug errors
@
text
@d41 1
a41 1
nice rsync -rxlztpgaK --delete --stats --exclude=/ign/ "$sshx" $p "$@@" \
@
1.3
log
@move up to parent, capitalise
@
text
@d1 2
a2 2
#!/bin/mksh
# $Id: UP,v 1.2 2006/08/14 21:23:58 tg Exp tg $
d16 15
a30 7
if [[ $1 = -A ]]; then
a=1
shift
elif [[ $1 = -B ]]; then
: ${CVSROOT:=anoncvs@@anoncvs.mirbsd.org:/cvs}
shift
fi
d38 1
a38 2
[[ -n $1 ]] && shift
sshx="--rsh=ssh -T"
@
1.2
log
@allow synching from secondary server too
@
text
@d2 1
a2 1
# $Id: up,v 1.1 2006/08/14 21:19:32 tg Exp tg $
d7 1
a7 1
vd=$(readlink -nf $(dirname $0)/..)
d10 1
a10 1
cd $(dirname $0)/..
@
1.1
log
@Initial revision
@
text
@d2 3
a4 2
# $Id$
# sync MirOS CVS repo from primary server to primary anoncvs mirror
d18 3
@