source: trunk/locker/sbin/scripts-createrepo @ 2127

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