2 # this can help you create/update your fedora mirror
7 root=/data/fedora/linux
8 rsyncurl=rsync://fr.rpmfind.net/linux/fedora
14 echo "Usage: $COMMAND [-n] [-v] [-r root] [-u rsyncurl] [-f fcdistro] [-a arch]"
15 echo "Defaults to -r $root -u $rsyncurl -f $fcdistro -a $arch"
16 echo "Use vserver conventions for fcdistro, e.g. fc6 and f7"
20 while getopts "nvr:u:f:a:h" opt ; do
25 u) rsyncurl=$OPTARG ;;
26 f) fcdistro=$OPTARG ;;
34 findex=$(echo $fcdistro | sed -e s,fc,,g)
37 findex=$(echo $fcdistro | sed -e s,f,,g)
42 echo rsyncurl="$rsyncurl"
43 echo "fcdistro=$fcdistro"
49 echo "============================== $findex core"
50 mkdir -p ${root}/core/$findex/$arch/os/
51 rsync $dry_run -avz --exclude debug/ ${rsyncurl}/core/$findex/$arch/os/ ${root}/core/$findex/$arch/os/
52 echo "============================== $findex updates"
53 mkdir -p ${root}/core/updates/$findex/$arch/
54 rsync $dry_run -avz --exclude debug/ ${rsyncurl}/core/updates/$findex/$arch/ ${root}/core/updates/$findex/$arch/
55 echo "============================== $findex extras"
56 mkdir -p ${root}/extras/$findex/$arch/
57 rsync $dry_run -avz --exclude debug/ ${rsyncurl}/extras/$findex/$arch/ ${root}/extras/$findex/$arch/
60 echo "============================== $findex core"
61 mkdir -p ${root}/core/$findex/$arch/os/
62 rsync $dry_run -avz --exclude debug/ ${rsyncurl}/core/$findex/Everything/$arch/os/ ${root}/core/$findex/$arch/os/
63 echo "============================== $findex updates"
64 mkdir -p ${root}/core/updates/$findex/$arch/
65 rsync $dry_run -avz --exclude debug/ ${rsyncurl}/core/updates/$findex/$arch/ ${root}/core/updates/$findex/$arch/
68 # somehow the layout on my favorite mirror is different in 7 and 8, /Everything/ has gone
69 echo "============================== $findex core"
70 mkdir -p ${root}/core/$findex/$arch/os/
71 rsync $dry_run -avz --exclude debug/ ${rsyncurl}/core/$findex/$arch/os/ ${root}/core/$findex/$arch/os/
72 echo "============================== $findex updates"
73 mkdir -p ${root}/core/updates/$findex/$arch/
74 rsync $dry_run -avz --exclude debug/ ${rsyncurl}/core/updates/$findex/$arch/ ${root}/core/updates/$findex/$arch/
77 echo "Unknown fedora index $findex - exiting"