2 # this can help you create/update your fedora mirror
7 root=/data/fedora/linux
8 rsyncurl=rsync://mirrors.kernel.org/fedora
14 echo "Usage: $COMMAND [-n] [-v] [-r root] [-u rsyncurl] [-f distroname] [-a arch]"
15 echo "Defaults to -r $root -u $rsyncurl -f $distroname -a $arch"
16 echo "Use vserver conventions for distroname, e.g. fc6 and f7"
20 while getopts "nvr:u:f:a:h" opt ; do
23 v) set -x ; verbose=true ;;
25 u) rsyncurl=$OPTARG ;;
26 f) distroname=$OPTARG ;;
34 distroindex=$(echo $distroname | sed -e "s,fc,,g")
38 distroindex=$(echo $distroname | sed -e "s,f,,g")
42 distroindex=$(echo $distroname | sed -e "s,centos,,g")
46 echo "Unknown redhat distribution $distroname - exiting"
52 excludelist="debug/ iso/ ppc/ source/"
53 options="$dry_run -avz --delete --delete-excluded --quiet"
54 [ -n "$verbose" ] && options="$options --verbose"
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"
73 for repopath in core/$distroindex/$arch/os/ core/updates/$distroindex/$arch/ extras/$distroindex/$arch/
75 echo "============================== $distro -> $distroindex $repopath"
76 mkdir -p ${root}/${repopath}
77 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}
90 echo "Unknown fedora index $distroindex - exiting"
99 for repopath in $distroindex/os/$arch/ $distroindex/updates/$arch/
101 echo "============================== $distro -> $distroindex $repopath"
102 mkdir -p ${root}/${repopath}
103 rsync $options ${rsyncurl}/${repopath} ${root}/${repopath}
108 echo "$distro $distroindex currently unsupported - exiting"
115 echo "$distro $distroindex currently unsupported - exiting"