X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=vbuild-fedora-mirror.sh;h=a178ff4bb80cb26590e63f7d9419ca34c7c593a7;hb=dde0308ec3dd6eb127d74051169e4b5110f9cc7b;hp=29fdaafe45d18dc65cc82e9ac8d7ac6d8b287ef7;hpb=b08d75f94588813747a99aac337d3c6fc56630e1;p=build.git diff --git a/vbuild-fedora-mirror.sh b/vbuild-fedora-mirror.sh index 29fdaafe..a178ff4b 100755 --- a/vbuild-fedora-mirror.sh +++ b/vbuild-fedora-mirror.sh @@ -3,7 +3,7 @@ # $Id$ COMMAND=$(basename $0) -LOGDIR=/root/fedora-mirroring +LOGDIR=/var/log/fedora-mirroring DATE=$(date '+%Y-%m-%d-%H-%M') LOG=${LOGDIR}/${DATE}.log @@ -13,30 +13,34 @@ log= skip_core= root=/mirror/ + us_fedora_url=rsync://mirrors.kernel.org/fedora # change this us_centos_url=rsync://mirrors.rit.edu/centos +us_epel_url="us_epel_url-needs-to-be-defined" + +# 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 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" +all_distronames="f8 f9 centos5.2 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 () { @@ -60,6 +64,11 @@ function mirror_distro_arch () { distro="CentOS" rsyncurl=$centos_url ;; + epel5) + distroindex=5 + distro=epel + rsyncurl=$epel_url + ;; *) echo "WARNING -- Unknown distribution $distroname -- skipped" return 1 @@ -73,15 +82,8 @@ function mirror_distro_arch () { options="$options --exclude $e" done - if [ -n "$verbose" ] ; then - echo "root=$root" - echo "distro=$distroname" - echo "distroname=$distroname" - echo "distroindex=$distroindex" - echo "arch=$arch" - echo rsyncurl="$rsyncurl" - echo "rsync options=$options" - fi + echo ">>>>>>>>>>>>>>>>>>>> root=$root distroname=$distroname arch=$arch rsyncurl=$rsyncurl" + [ -n "$verbose" ] && echo "rsync options=$options" RES=1 paths="" @@ -117,13 +119,23 @@ function mirror_distro_arch () { localpath=centos ;; + epel*) + case $distroindex in + 5) + paths="$paths $distroindex/$arch/" + RES=0 + ;; + esac + localpath=epel + ;; + esac if [ "$RES" = 1 ] ; then echo "DISTRIBUTION $distro $distroindex CURRENTLY UNSUPPORTED - skipped" else for repopath in $paths; do - echo "============================== $distro -> $distroindex $repopath" + echo "===== $distro -> $distroindex $repopath" [ -z "$dry_run" ] && mkdir -p ${root}/${localpath}/${repopath} command="rsync $options ${rsyncurl}/${repopath} ${root}/${localpath}/${repopath}" echo $command @@ -131,6 +143,8 @@ function mirror_distro_arch () { done fi + echo "<<<<<<<<<<<<<<<<<<<< $distroname $arch" + return $RES } @@ -149,7 +163,7 @@ function usage () { 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 " -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"