2 # this can help you create/update your fedora mirror
10 root=/data/fedora/linux
11 rsyncurl=rsync://mirrors.kernel.org/fedora
12 eu_rsyncurl=rsync://ftp-stud.hs-esslingen.de/fedora/linux
18 echo "Usage: $COMMAND [-n] [-v] [-c] [-e] [-r root] [-u rsyncurl] [-f distroname] [-a arch]"
19 echo "Defaults to -r $root -u $rsyncurl -f $distroname -a $arch"
20 echo "Use vserver conventions for distroname, e.g. fc6 and f7"
24 echo " -c : skips core repository"
25 echo " -e : uses European mirror $eu_rsyncurl"
29 while getopts "nvcer:u:f:a:h" opt ; do
31 n) dry_run=--dry-run ;;
32 v) verbose=--verbose ;;
34 e) rsyncurl=$eu_rsyncurl ;;
36 u) rsyncurl=$OPTARG ;;
37 f) distroname=$OPTARG ;;
45 distroindex=$(echo $distroname | sed -e "s,fc,,g")
49 distroindex=$(echo $distroname | sed -e "s,f,,g")
53 distroindex=$(echo $distroname | sed -e "s,centos,,g")
57 echo "Unknown redhat distribution $distroname - exiting"
62 excludelist="debug/ iso/ ppc/ source/"
63 options="--archive --compress --delete --delete-excluded $dry_run $verbose"
64 [ -n "$(rsync --help | grep no-motd)" ] && options="$options --no-motd"
65 for e in $excludelist; do
66 options="$options --exclude $e"
69 if [ -n "$verbose" ] ; then
71 echo "distro=$distroname"
72 echo "distroname=$distroname"
73 echo "distroindex=$distroindex"
75 echo rsyncurl="$rsyncurl"
76 echo "rsync options=$options"
85 [ -z "$skip_core" ] && paths="core/$distroindex/$arch/os/"
86 paths="$paths core/updates/$distroindex/$arch/ extras/$distroindex/$arch/"
90 [ -z "$skip_core" ] && paths="releases/$distroindex/Everything/$arch/os/"
91 paths="$paths updates/$distroindex/$arch/"
100 [ -z "$skip_core" ] && paths="$distroindex/os/$arch/"
101 paths="$paths $distroindex/updates/$arch/"
109 if [ "$RES" = 1 ] ; then
110 echo "$distro $distroindex currently unsupported - exiting"
112 for repopath in $paths; do
113 echo "============================== $distro -> $distroindex $repopath"
114 [ -z "$dry_run" ] && mkdir -p ${root}/${repopath}
115 command="rsync $options ${rsyncurl}/${repopath} ${root}/${repopath}"