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 fcdistro] [-a arch]"
16 echo "Defaults to -r $root -u $rsyncurl -f $fcdistro -a $arch"
17 echo "Use vserver conventions for fcdistro, e.g. fc6 and f7"
21 while getopts "nvr:u:f:a:h" opt ; do
26 u) rsyncurl=$OPTARG ;;
27 f) fcdistro=$OPTARG ;;
35 findex=$(echo $fcdistro | sed -e s,fc,,g)
38 findex=$(echo $fcdistro | sed -e s,f,,g)
43 echo rsyncurl="$rsyncurl"
44 echo "fcdistro=$fcdistro"
50 echo "============================== $findex core"
51 mkdir -p ${root}/core/$findex/$arch/os/
52 rsync $dry_run -avz --delete --exclude debug/ ${rsyncurl}/core/$findex/$arch/os/ ${root}/core/$findex/$arch/os/
53 echo "============================== $findex updates"
54 mkdir -p ${root}/core/updates/$findex/$arch/
55 rsync $dry_run -avz --delete --exclude debug/ ${rsyncurl}/core/updates/$findex/$arch/ ${root}/core/updates/$findex/$arch/
56 echo "============================== $findex extras"
57 mkdir -p ${root}/extras/$findex/$arch/
58 rsync $dry_run -avz --delete --exclude debug/ ${rsyncurl}/extras/$findex/$arch/ ${root}/extras/$findex/$arch/
61 echo "============================== $findex core"
62 mkdir -p ${root}/core/$findex/$arch/os/
63 rsync $dry_run -avz --delete --exclude debug/ ${rsyncurl}/core/$findex/Everything/$arch/os/ ${root}/core/$findex/$arch/os/
64 echo "============================== $findex updates"
65 mkdir -p ${root}/core/updates/$findex/$arch/
66 rsync $dry_run -avz --delete --exclude debug/ ${rsyncurl}/core/updates/$findex/$arch/ ${root}/core/updates/$findex/$arch/
69 # somehow the layout on my favorite mirror is different in 7 and 8, /Everything/ has gone
70 echo "============================== $findex core"
71 mkdir -p ${root}/core/$findex/$arch/os/
72 rsync $dry_run -avz --delete --exclude debug/ ${rsyncurl}/core/$findex/$arch/os/ ${root}/core/$findex/$arch/os/
73 echo "============================== $findex updates"
74 mkdir -p ${root}/core/updates/$findex/$arch/
75 rsync $dry_run -avz --delete --exclude debug/ ${rsyncurl}/core/updates/$findex/$arch/ ${root}/core/updates/$findex/$arch/
78 echo "Unknown fedora index $findex - exiting"