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

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