2 # this can help you create/update your fedora mirror
7 root=/data/fedora/linux
8 rsyncurl=rsync://mirrors.kernel.org/fedora
9 #rsyncurl=rsync://fr.rpmfind.net/linux/fedora
15 echo "Usage: $COMMAND [-n] [-v] [-r root] [-u rsyncurl] [-f distroname] [-a arch]"
16 echo "Defaults to -r $root -u $rsyncurl -f $distroname -a $arch"
17 echo "Use vserver conventions for distroname, e.g. fc6 and f7"
21 while getopts "nvr:u:f:a:h" opt ; do
26 u) rsyncurl=$OPTARG ;;
27 f) distroname=$OPTARG ;;
35 distroindex=$(echo $distroname | sed -e "s,fc,,g")
39 distroindex=$(echo $distroname | sed -e "s,f,,g")
43 distroindex=$(echo $distroname | sed -e "s,centos,,g")
47 echo "Unknown redhat distribution $distroname - exiting"
53 excludelist="debug/ iso/ ppc/ source/"
54 options="$dry_run -avz --delete --delete-excluded --no-motd"
57 options="$options --exclude $e"
61 echo "distro=$distroname"
62 echo "distroname=$distroname"
63 echo "distroindex=$distroindex"
65 echo rsyncurl="$rsyncurl"
66 echo "rsync options=$options"
72 for repopath in core/$distroindex/$arch/os/ core/updates/$distroindex/$arch/ extras/$distroindex/$arch/
74 echo "============================== $distro -> $distroindex $repopath"
75 mkdir -p ${root}/${repopath}
76 rsync $options ${rsyncurl}/${repopath} ${root}/${repopath}
82 for repopath in releases/$distroindex/Everything/$arch/os/ updates/$distroindex/$arch/
84 echo "============================== $distro -> $distroindex $repopath"
85 mkdir -p ${root}/${repopath}
86 rsync $options ${rsyncurl}/${repopath} ${root}/${repopath}
91 echo "Unknown fedora index $distroindex - exiting"
97 echo "$distro $distroindex currently unsupported - exiting"