Commit 8d89ac1b authored by Downloader's avatar Downloader

rsync_all.sh: update

parent bd3b9bdd
......@@ -6,9 +6,9 @@
RPMS=/var/ftp/pub/ALTLinux
TIMEOUT=5000
LISTARCH="x86_64 noarch i586 x86_64-i586"
BRANCHLIST="c7 c8 p8 p9"
BRANCHLIST="c7 c8 p8 p9 c9f2 c10f1 c10f2 p10 p11"
DELETE="--delete-after --delete-excluded --max-delete=1000"
RSYNCOPTS="--fuzzy --partial"
FORCE=''
if [ "$1" = "--force" ] ; then
......@@ -33,7 +33,7 @@ get_rsync_path()
if [ "$1" = "c6/branch" ] || [ "$1" = "c7/branch" ] ; then
RSYNCPATH=rsync.altlinux.ru::ALTLinux
#elif echo "$1" | grep -q "p8/" ; then
elif false ; then
elif true ; then
#RSYNCPATH=rsync://ftp.basealt.ru/pub/distributions/ALTLinux
RSYNCPATH=rsync://ftp.basealt.ru/ALTLinux
......@@ -53,7 +53,7 @@ echo "Start sync from $RSYNCPATH/$1 to $RPMS/$1"
# sync only if main dir is exist
test -d "$RPMS/${1/\/*/}" || return 0
mkdir -p $RPMS/$1/
rsync $DELETE --fuzzy --partial --timeout=$TIMEOUT --progress $CHECKSUM --stats -vrlt --copy-links $2 \
rsync $DELETE $RSYNCOPTS --timeout=$TIMEOUT --progress $CHECKSUM --stats -vrlt --copy-links $2 \
$RSYNCPATH/$1/ $RPMS/$1/
RES=$?
echo "rsync exit: $RES"
......@@ -70,23 +70,29 @@ sync_file()
echo
echo "Start sync from $RSYNCPATH/$1 to $RPMS/$1"
rsync $DELETE --fuzzy --partial --timeout=$TIMEOUT --progress $CHECKSUM --stats -vrlt --copy-links \
--exclude "*SRPMS*" --exclude "*RPMS.debuginfo*" \
--exclude "*SRPMS*" \
$RSYNCPATH/$1 $RPMS/$1
}
# p8/branch i586 classic
sync_branch()
{
local BRANCH="$1"
local ARCH="$2"
local COMPONENT="$3"
[ -n "$COMPONENT" ] || fatal "sync_branch: missed COMPONENT"
RSYNCPATH=$(get_rsync_path $BRANCH)
# 1. sync files, without delete
(DELETE='' func $BRANCH/$ARCH '--exclude *SRPMS* --exclude *RPMS.debuginfo* --exclude */base/*') || return
#(DELETE='' func $BRANCH/$ARCH '--exclude *SRPMS* --exclude *RPMS.debuginfo* --exclude base/') || return
# 1. sync files, this will skip delete if errors
func $BRANCH/$ARCH/RPMS.$COMPONENT || return
# 2. sync base
func $BRANCH/$ARCH/base || return
# 3. if all is ok, remove old files
func $BRANCH/$ARCH '--exclude *SRPMS* --exclude *RPMS.debuginfo* --exclude */base/*' || return
#func $BRANCH/$ARCH '--exclude *SRPMS* --exclude *RPMS.debuginfo* --exclude base/' || return
}
# branch component
sync_branches()
{
RSYNCPATH=$(get_rsync_path $1)
......@@ -100,7 +106,9 @@ sync_branches()
fi
for i in $LISTARCH; do
sync_branch "$1" "$i"
[ "$i" = "x86_64-i586" ] && [ "$2" = "debuginfo" ] && continue
[ "$i" = "noarch" ] && [ "$2" = "debuginfo" ] && continue
sync_branch "$1" "$i" "$2"
done
}
......@@ -135,7 +143,8 @@ if [ "$1" = "--checksum" ] ; then
fi
if [ "$1" = "Sisyphus" ] ; then
sync_branches $1
sync_branches $1 classic
sync_branches $1 debuginfo
exit
elif [ "$1" = "--file" ] ; then
shift
......@@ -148,7 +157,8 @@ elif [ "$1" = "--srpms" ] ; then
func $1/files/SRPMS
exit
elif echo "$1" | grep -q branch ; then
sync_branches $1
sync_branches $1 classic
sync_branches $1 debuginfo
exit
elif [ -n "$1" ] ; then
sync_other $1
......@@ -156,13 +166,15 @@ elif [ -n "$1" ] ; then
fi
for i in $BRANCHLIST; do
sync_branches $i/branch
sync_branches $i/branch classic
sync_branches $i/branch debuginfo
done
#sync_other p8/images
for i in Sisyphus ; do
sync_branches $i
sync_branches $i classic
sync_branches $i debuginfo
done
date
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment