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

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