summaryrefslogtreecommitdiffstats
path: root/rsync-fedora-debuginfo.sh
blob: 18f2a7340515ad394dad5ce05171b915a6665d61 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/bin/bash
# Given arch and version, fetch all debuginfo packages
# Copyright 2009 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
# 
# Author: Will Woods <wwoods@redhat.com>

source config.sh

if [ -z "$cachedir" ]; then
    echo "Couldn't find config.sh - exiting."
    exit 1
fi

if [ $# -lt 2 ]; then
    echo "usage: $0 VERSION ARCH"
    echo "Fetches and prepares all the debuginfo data for the given ver/arch,"
    echo "then runs unpack-debuginfo.sh and make-links.sh on them."
    echo
    echo "RPMs are saved under $cachedir."
    exit 1
fi

ver=$1; shift
arch=$1; shift
# FIXME sanity check ver/arch

rpmdir="$cachedir/debuginfo-$ver-$arch"

# FIXME use mirrormanager / yum repo files / something
server="rsync://wallace.redhat.com/fedora-enchilada/linux"

# This is dumb. Use a dict or something.
testing=$server/updates/testing/$ver/$arch/debug
updates=$server/updates/$ver/$arch/debug
fedora=$server/releases/$ver/Everything/$arch/debug

mkdir -p $rpmdir
rsync -avz $@ --progress $testing $rpmdir/testing
rsync -avz $@ --progress $updates $rpmdir/updates
rsync -avz $@ --progress $fedora $rpmdir/fedora
find $rpmdir/testing -name "*.rpm" \
     -exec ./unpack-debuginfo.sh testing-$ver-$arch {} +
find $rpmdir/updates -name "*.rpm" \
     -exec ./unpack-debuginfo.sh updates-$ver-$arch {} +
find $rpmdir/fedora -name "*.rpm" \
     -exec ./unpack-debuginfo.sh fedora-$ver-$arch {} +
./make-links.sh testing-$ver-$arch updates-$ver-$arch fedora-$ver-$arch