Last change
on this file since 2584 was
2552,
checked in by andersk, 10 years ago
|
scripts-createrepo: Accept a server argument
|
-
Property svn:executable set to
*
|
File size:
719 bytes
|
Line | |
---|
1 | #!/bin/sh |
---|
2 | |
---|
3 | # Runs createrepo on the primary scripts server and copies the resulting |
---|
4 | # metadata to the live yum repository. |
---|
5 | |
---|
6 | set -eux |
---|
7 | |
---|
8 | server="${1-scripts.mit.edu}" |
---|
9 | |
---|
10 | ssh='ssh -o GSSAPIAuthentication=yes -o GSSAPIDelegateCredentials=no' |
---|
11 | |
---|
12 | yum=/afs/athena.mit.edu/contrib/scripts/yum-repos/rpm-fc$($ssh "root@$server" 'lsb_release -rs') |
---|
13 | [ -d "$yum" ] |
---|
14 | |
---|
15 | tmp=$($ssh "root@$server" "\ |
---|
16 | set -eux |
---|
17 | tmp=\$(mktemp -dt createrepo.XXXXXX) |
---|
18 | createrepo -d -o \"\$tmp\" -- '$yum' >&2 |
---|
19 | printf '%s' \"\$tmp\" |
---|
20 | ") |
---|
21 | [ "$tmp" ] |
---|
22 | |
---|
23 | new=$(mktemp -d -- "$yum/repodata.XXXXXX") |
---|
24 | rsync -avz -e "$ssh" -- "root@$server:$tmp/repodata/" "$new" |
---|
25 | mv -b -T -- "$new" "$yum/repodata" |
---|
26 | rm -rf -- "$yum/repodata~" |
---|
27 | |
---|
28 | $ssh "root@$server" "\ |
---|
29 | set -eux |
---|
30 | rm -rf -- '$tmp' |
---|
31 | " |
---|
Note: See
TracBrowser
for help on using the repository browser.