source: branches/fc19-dev/locker/sbin/scripts-createrepo @ 2402

Last change on this file since 2402 was 2129, checked in by andersk, 11 years ago
scripts-createrepo: Use paranoid ssh options again
  • Property svn:executable set to *
File size: 714 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
6set -eux
7
8ssh='ssh -o GSSAPIAuthentication=yes -o GSSAPIDelegateCredentials=no'
9
10yum=/afs/athena.mit.edu/contrib/scripts/yum-repos/rpm-fc$($ssh root@scripts.mit.edu 'lsb_release -rs')
11[ -d "$yum" ]
12
13tmp=$($ssh root@scripts.mit.edu "\
14set -eux
15tmp=\$(mktemp -dt createrepo.XXXXXX)
16createrepo -d -o \"\$tmp\" -- '$yum' >&2
17printf '%s' \"\$tmp\"
18")
19[ "$tmp" ]
20
21new=$(mktemp -d -- "$yum/repodata.XXXXXX")
22rsync -avz -e "$ssh" -- "root@scripts.mit.edu:$tmp/repodata/" "$new"
23mv -b -T -- "$new" "$yum/repodata"
24rm -rf -- "$yum/repodata~"
25
26$ssh root@scripts.mit.edu "\
27set -eux
28rm -rf -- '$tmp'
29"
Note: See TracBrowser for help on using the repository browser.