X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=vbuild-fedora-mirror.sh;h=34a09e3570a910657829aaed4b70f6cc4eb987e3;hb=5a66b3cdb787905b2ed821ca073ecbbc1e9df742;hp=47eaadb589a2c485d1be7c8c85fed5fc983ee5ff;hpb=c14c780d322e7aef14d5f5247a3f833a7af8bcd3;p=build.git diff --git a/vbuild-fedora-mirror.sh b/vbuild-fedora-mirror.sh index 47eaadb5..34a09e35 100755 --- a/vbuild-fedora-mirror.sh +++ b/vbuild-fedora-mirror.sh @@ -13,38 +13,44 @@ log= skip_core= root=/mirror/ + +hozac_url=ftp://rpm.hozac.com/dhozac/centos/5/vserver +# Daniel mentions rsync://rpm.hozac.com/dhozac/centos/5/vserver/ + us_fedora_url=rsync://mirrors.kernel.org/fedora -# change this us_centos_url=rsync://mirrors.rit.edu/centos +us_epel_url=rsync://rsync.gtlib.gatech.edu/fedora-epel -# this one is contaminated with the .~tmp~ thing -#eu_fedora_url=rsync://ftp-stud.hs-esslingen.de/fedora/linux -eu_fedora_url=rsync://mirrors.ircam.fr/fedora-linux +# ircam's fedora8 repo has been turned off +#eu_fedora_url=rsync://mirrors.ircam.fr/fedora-linux +eu_fedora_url=rsync://mirror.ovh.net/download.fedora.redhat.com/linux eu_centos_url=rsync://mirrors.ircam.fr/CentOS +eu_epel_url=rsync://mirrors.ircam.fr/fedora-epel -# change this -jp_fedora_url="need-to-be-defined" -# change this -jp_centos_url="need-to-be-defined" +jp_fedora_url="jp_fedora_url-needs-to-be-defined" +jp_centos_url="jp_centos_url-needs-to-be-defined" +jp_epel_url="jp_epel_url-needs-to-be-defined" -default_distroname=f8 -all_distronames="f7 f8 f9 centos5.2" -default_arch=i386 +default_distroname="centos5" +all_distronames="f8 f10 f11 centos5.2 centos5.3 epel5" +default_arch="i386" all_archs="i386 x86_64" case $(hostname) in *.fr|*.de|*.uk) - fedora_url=$eu_fedora_url ; centos_url=$eu_centos_url ;; + fedora_url=$eu_fedora_url ; centos_url=$eu_centos_url ; epel_url=$eu_epel_url ;; *.jp) - fedora_url=$jp_fedora_url ; centos_url=$jp_centos_url ;; + fedora_url=$jp_fedora_url ; centos_url=$jp_centos_url ; epel_url=$jp_epel_url ;; *) - fedora_url=$us_fedora_url ; centos_url=$us_centos_url ;; + fedora_url=$us_fedora_url ; centos_url=$us_centos_url ; epel_url=$us_epel_url ;; esac function mirror_distro_arch () { distroname=$1; shift arch=$1; shift + LFTP=0 + distroname=$(echo $distroname | tr '[A-Z]' '[a-z]') case $distroname in fc*[1-6]) @@ -52,7 +58,7 @@ function mirror_distro_arch () { distro="Fedora Core" rsyncurl=$fedora_url ;; - f*[7-9]) + f*[7-9]|f1?) distroindex=$(echo $distroname | sed -e "s,f,,g") distro="Fedora" rsyncurl=$fedora_url @@ -62,6 +68,16 @@ function mirror_distro_arch () { distro="CentOS" rsyncurl=$centos_url ;; + epel5) + distroindex=5 + distro=epel + rsyncurl=$epel_url + ;; + hozac) + distroindex=5 + distro="hozac" + rsyncurl=$hozac_url + ;; *) echo "WARNING -- Unknown distribution $distroname -- skipped" return 1 @@ -70,9 +86,11 @@ function mirror_distro_arch () { excludelist="debug/ iso/ ppc/ source/" options="--archive --compress --delete --delete-excluded $dry_run $verbose" + lftp_options="--delete $dry_run $verbose" [ -n "$(rsync --help | grep no-motd)" ] && options="$options --no-motd" for e in $excludelist; do options="$options --exclude $e" + lftp_options="$lftp_options --exclude $e" done echo ">>>>>>>>>>>>>>>>>>>> root=$root distroname=$distroname arch=$arch rsyncurl=$rsyncurl" @@ -88,7 +106,7 @@ function mirror_distro_arch () { paths="$paths core/updates/$distroindex/$arch/ extras/$distroindex/$arch/" RES=0 ;; - 7|8|9) + 7|8|9|1?) [ -z "$skip_core" ] && paths="releases/$distroindex/Everything/$arch/os/" paths="$paths updates/$distroindex/$arch/" # f8 and f9 have the additional newkey repo @@ -112,6 +130,28 @@ function mirror_distro_arch () { localpath=centos ;; + epel*) + case $distroindex in + 5) + paths="$paths $distroindex/$arch/" + RES=0 + ;; + esac + localpath=epel + ;; + + hozac*) + case $distroindex in + 5) + # leave off trailing '/' + paths="$paths $arch" + RES=0 + LFTP=1 + ;; + esac + localpath=dhozac + ;; + esac if [ "$RES" = 1 ] ; then @@ -120,7 +160,11 @@ function mirror_distro_arch () { for repopath in $paths; do echo "===== $distro -> $distroindex $repopath" [ -z "$dry_run" ] && mkdir -p ${root}/${localpath}/${repopath} - command="rsync $options ${rsyncurl}/${repopath} ${root}/${localpath}/${repopath}" + if [ "$LFTP" = 1 ]; then + command="lftp -c mirror $lftp_options ${rsyncurl}/${repopath} ${root}/${localpath}/${repopath}" + else + command="rsync $options ${rsyncurl}/${repopath} ${root}/${localpath}/${repopath}" + fi echo $command $command done @@ -143,10 +187,11 @@ function usage () { echo " -r root (default is $root)" echo " -u rsyncurl for fedora (default is $fedora_url)" echo " -U rsyncurl for centos (default is $centos_url)" - echo " -s : uses standard (US) mirrors $us_fedora_url $us_centos_url" - echo " -e : uses European mirrors $eu_fedora_url $eu_centos_url" - echo " -j : uses Japanese mirrors $jp_fedora_url $jp_centos_url" - echo " -f distroname - use vserver convention, e.g. fc6 and f7" + echo " -E rsyncurl for epel (default is $epel_url)" + echo " -s : uses standard (US) mirrors $us_fedora_url $us_centos_url $us_epel_url" + echo " -e : uses European mirrors $eu_fedora_url $eu_centos_url $eu_epel_url" + echo " -j : uses Japanese mirrors $jp_fedora_url $jp_centos_url $jp_epel_url" + echo " -f distroname - use vserver convention, e.g. f8 or centos5" echo " -F : for distroname in $all_distronames" echo " -a arch - use yum convention" echo " -A : for arch in $all_archs" @@ -166,7 +211,7 @@ function run () { function main () { distronames="" archs="" - while getopts "nvlcr:u:U:sejf:Fa:Ah" opt ; do + while getopts "nvlcr:u:U:E:sejf:Fa:Ah" opt ; do case $opt in n) dry_run=--dry-run ;; v) verbose=--verbose ;; @@ -175,9 +220,10 @@ function main () { r) root=$OPTARG ;; u) fedora_url=$OPTARG ;; U) centos_url=$OPTARG ;; - s) fedora_url=$us_fedora_url ; centos_url=$us_centos_url ;; - e) fedora_url=$eu_fedora_url ; centos_url=$eu_centos_url ;; - j) fedora_url=$jp_fedora_url ; centos_url=$jp_centos_url ;; + E) epel_url=$OPTARG ;; + s) fedora_url=$us_fedora_url ; centos_url=$us_centos_url ; epel_url=$us_epel_url;; + e) fedora_url=$eu_fedora_url ; centos_url=$eu_centos_url ; epel_url=$eu_epel_url ;; + j) fedora_url=$jp_fedora_url ; centos_url=$jp_centos_url ; epel_url=$jp_epel_url ;; f) distronames="$distronames $OPTARG" ;; F) distronames="$distronames $all_distronames" ;; a) archs="$archs $OPTARG" ;;