git://git.onelab.eu
/
build.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add NodeManage-topo to the modules to monitor
[build.git]
/
vbuild-fedora-mirror.sh
diff --git
a/vbuild-fedora-mirror.sh
b/vbuild-fedora-mirror.sh
index
34a09e3
..
c2f8206
100755
(executable)
--- a/
vbuild-fedora-mirror.sh
+++ b/
vbuild-fedora-mirror.sh
@@
-1,6
+1,5
@@
#!/bin/bash
# this can help you create/update your fedora mirror
#!/bin/bash
# this can help you create/update your fedora mirror
-# $Id$
COMMAND=$(basename $0)
LOGDIR=/var/log/fedora-mirroring
COMMAND=$(basename $0)
LOGDIR=/var/log/fedora-mirroring
@@
-14,8
+13,7
@@
skip_core=
root=/mirror/
root=/mirror/
-hozac_url=ftp://rpm.hozac.com/dhozac/centos/5/vserver
-# Daniel mentions rsync://rpm.hozac.com/dhozac/centos/5/vserver/
+dhozac_url=rsync://rpm.hozac.com/dhozac/centos/
us_fedora_url=rsync://mirrors.kernel.org/fedora
us_centos_url=rsync://mirrors.rit.edu/centos
us_fedora_url=rsync://mirrors.kernel.org/fedora
us_centos_url=rsync://mirrors.rit.edu/centos
@@
-23,22
+21,29
@@
us_epel_url=rsync://rsync.gtlib.gatech.edu/fedora-epel
# ircam's fedora8 repo has been turned off
#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_fedora_url=rsync://mirror.ovh.net/download.fedora.redhat.com/linux
+eu_fedora_url=rsync://ftp-stud.hs-esslingen.de/fedora/linux
eu_centos_url=rsync://mirrors.ircam.fr/CentOS
eu_epel_url=rsync://mirrors.ircam.fr/fedora-epel
eu_centos_url=rsync://mirrors.ircam.fr/CentOS
eu_epel_url=rsync://mirrors.ircam.fr/fedora-epel
+pl_fedora_url=$eu_fedora_url
+pl_centos_url=rsync://ftp.tpnet.pl/centos
+pl_epel_url=rsync://ftp.icm.edu.pl/pub/Linux/fedora/linux/epel
+
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"
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="centos5"
-all_distronames="f
8 f10 f11 centos5.2 centos5.3 epel5
"
+default_distroname="centos5
.5
"
+all_distronames="f
14 centos5.5 epel5 epel6
"
default_arch="i386"
all_archs="i386 x86_64"
case $(hostname) in
default_arch="i386"
all_archs="i386 x86_64"
case $(hostname) in
- *.fr|*.de|*.uk)
+
blitz*|
*.fr|*.de|*.uk)
fedora_url=$eu_fedora_url ; centos_url=$eu_centos_url ; epel_url=$eu_epel_url ;;
fedora_url=$eu_fedora_url ; centos_url=$eu_centos_url ; epel_url=$eu_epel_url ;;
+ *.pl)
+ fedora_url=$pl_fedora_url ; centos_url=$pl_centos_url ; epel_url=$pl_epel_url ;;
*.jp)
fedora_url=$jp_fedora_url ; centos_url=$jp_centos_url ; epel_url=$jp_epel_url ;;
*)
*.jp)
fedora_url=$jp_fedora_url ; centos_url=$jp_centos_url ; epel_url=$jp_epel_url ;;
*)
@@
-49,8
+54,6
@@
function mirror_distro_arch () {
distroname=$1; shift
arch=$1; shift
distroname=$1; shift
arch=$1; shift
- LFTP=0
-
distroname=$(echo $distroname | tr '[A-Z]' '[a-z]')
case $distroname in
fc*[1-6])
distroname=$(echo $distroname | tr '[A-Z]' '[a-z]')
case $distroname in
fc*[1-6])
@@
-68,15
+71,15
@@
function mirror_distro_arch () {
distro="CentOS"
rsyncurl=$centos_url
;;
distro="CentOS"
rsyncurl=$centos_url
;;
- epel
5
)
- distroindex=
5
+ epel
[5-6]
)
+ distroindex=
$(echo $distroname | sed -e "s,epel,,g")
distro=epel
rsyncurl=$epel_url
;;
distro=epel
rsyncurl=$epel_url
;;
- hozac)
+
d
hozac)
distroindex=5
distroindex=5
- distro="hozac"
- rsyncurl=$hozac_url
+ distro="
d
hozac"
+ rsyncurl=$
d
hozac_url
;;
*)
echo "WARNING -- Unknown distribution $distroname -- skipped"
;;
*)
echo "WARNING -- Unknown distribution $distroname -- skipped"
@@
-86,11
+89,9
@@
function mirror_distro_arch () {
excludelist="debug/ iso/ ppc/ source/"
options="--archive --compress --delete --delete-excluded $dry_run $verbose"
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"
[ -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"
done
echo ">>>>>>>>>>>>>>>>>>>> root=$root distroname=$distroname arch=$arch rsyncurl=$rsyncurl"
@@
-132,7
+133,7
@@
function mirror_distro_arch () {
epel*)
case $distroindex in
epel*)
case $distroindex in
- 5)
+ 5
|6
)
paths="$paths $distroindex/$arch/"
RES=0
;;
paths="$paths $distroindex/$arch/"
RES=0
;;
@@
-140,13
+141,12
@@
function mirror_distro_arch () {
localpath=epel
;;
localpath=epel
;;
- hozac*)
+
d
hozac*)
case $distroindex in
5)
# leave off trailing '/'
case $distroindex in
5)
# leave off trailing '/'
- paths="$paths $arch"
+ paths="$paths $
distroindex/vserver/$
arch"
RES=0
RES=0
- LFTP=1
;;
esac
localpath=dhozac
;;
esac
localpath=dhozac
@@
-160,11
+160,7
@@
function mirror_distro_arch () {
for repopath in $paths; do
echo "===== $distro -> $distroindex $repopath"
[ -z "$dry_run" ] && mkdir -p ${root}/${localpath}/${repopath}
for repopath in $paths; do
echo "===== $distro -> $distroindex $repopath"
[ -z "$dry_run" ] && mkdir -p ${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
+ command="rsync $options ${rsyncurl}/${repopath} ${root}/${localpath}/${repopath}"
echo $command
$command
done
echo $command
$command
done
@@
-184,6
+180,7
@@
function usage () {
echo " -v : verbose"
echo " -l : turns on autologging in $LOGDIR"
echo " -c : skips core repository"
echo " -v : verbose"
echo " -l : turns on autologging in $LOGDIR"
echo " -c : skips core repository"
+ echo " -C : force syncing core repository (default)"
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 " -r root (default is $root)"
echo " -u rsyncurl for fedora (default is $fedora_url)"
echo " -U rsyncurl for centos (default is $centos_url)"
@@
-211,12
+208,13
@@
function run () {
function main () {
distronames=""
archs=""
function main () {
distronames=""
archs=""
- while getopts "nvlcr:u:U:E:sejf:Fa:Ah" opt ; do
+ while getopts "nvlc
C
r:u:U:E:sejf:Fa:Ah" opt ; do
case $opt in
n) dry_run=--dry-run ;;
v) verbose=--verbose ;;
l) log=true ;;
c) skip_core=true ;;
case $opt in
n) dry_run=--dry-run ;;
v) verbose=--verbose ;;
l) log=true ;;
c) skip_core=true ;;
+ C) skip_core= ;;
r) root=$OPTARG ;;
u) fedora_url=$OPTARG ;;
U) centos_url=$OPTARG ;;
r) root=$OPTARG ;;
u) fedora_url=$OPTARG ;;
U) centos_url=$OPTARG ;;
@@
-231,6
+229,8
@@
function main () {
h|*) usage ;;
esac
done
h|*) usage ;;
esac
done
+ shift $(($OPTIND-1))
+ [[ -n "$@" ]] && usage
[ -z "$distronames" ] && distronames=$default_distroname
[ -z "$archs" ] && archs=$default_arch
[ -z "$distronames" ] && distronames=$default_distroname
[ -z "$archs" ] && archs=$default_arch