Last change
on this file since 2731 was
2552,
checked in by andersk, 10 years ago
|
scripts-createrepo: Accept a server argument
|
-
Property svn:executable set to
*
|
File size:
719 bytes
|
Rev | Line | |
---|
[2126] | 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 | |
---|
[2552] | 8 | server="${1-scripts.mit.edu}" |
---|
| 9 | |
---|
[2127] | 10 | ssh='ssh -o GSSAPIAuthentication=yes -o GSSAPIDelegateCredentials=no' |
---|
| 11 | |
---|
[2552] | 12 | yum=/afs/athena.mit.edu/contrib/scripts/yum-repos/rpm-fc$($ssh "root@$server" 'lsb_release -rs') |
---|
[2128] | 13 | [ -d "$yum" ] |
---|
[2126] | 14 | |
---|
[2552] | 15 | tmp=$($ssh "root@$server" "\ |
---|
[2126] | 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") |
---|
[2552] | 24 | rsync -avz -e "$ssh" -- "root@$server:$tmp/repodata/" "$new" |
---|
[2126] | 25 | mv -b -T -- "$new" "$yum/repodata" |
---|
| 26 | rm -rf -- "$yum/repodata~" |
---|
| 27 | |
---|
[2552] | 28 | $ssh "root@$server" "\ |
---|
[2126] | 29 | set -eux |
---|
| 30 | rm -rf -- '$tmp' |
---|
| 31 | " |
---|
Note: See
TracBrowser
for help on using the repository browser.