forked from BladeGroup/gitlab-oe
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsstate-publish
More file actions
executable file
·51 lines (45 loc) · 805 Bytes
/
Copy pathsstate-publish
File metadata and controls
executable file
·51 lines (45 loc) · 805 Bytes
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
#!/bin/sh
set -e
die() {
echo >&2 "ERROR: $*"
exit 1
}
GEN=""
DST=""
PORT=""
while [ $# -gt 1 ]; do
case "$1" in
--sstate-gen)
GEN="$2"
shift
;;
--rsync-to)
DST="$2"
shift
;;
--ssh-port)
PORT="$2"
shift
;;
--)
shift
break
;;
-*)
die "unknown flag '$1'"
;;
*)
break
;;
esac
shift
done
[ -n "$GEN" ] || die "missing --sstate-gen"
[ -n "$DST" ] || die "missing --rsync-to"
if [ -n "$PORT" ]; then
export RSYNC_RSH="ssh -p '$PORT'"
fi
SSTATE=~/sstate-cache-"${GEN}"
rsync -aH --info=stats2 --safe-links "$@" \
$SSTATE \
"$DST"