Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
etersoft-admin-essentials
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
etersoft-admin-essentials
Commits
3f9ad4eb
Commit
3f9ad4eb
authored
Dec 11, 2025
by
Downloader
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rsync_contents_index.sh
parent
8d89ac1b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
134 additions
and
0 deletions
+134
-0
rsync_contents_index.sh
etersoft-cron/rsync_contents_index.sh
+134
-0
No files found.
etersoft-cron/rsync_contents_index.sh
0 → 100755
View file @
3f9ad4eb
#!/bin/bash
# Written by Lav (c) 2001, 2002, 2003, 2004, 2008, 2016, 2019
# Vitaly Lipatov <lav@etersoft.ru>
LISTARCH
=
"x86_64 noarch i586 aarch64"
# armh ppc64le"
BRANCHLIST
=
"c7 c8 p8 p9 c9f2 c10f1 c10f2 p10 p11"
RPMS
=
/var/ftp/pub/ALTLinux/contents_index
TIMEOUT
=
5000
RSYNCOPTS
=
"--partial --inplace -z"
FORCE
=
''
if
[
"
$1
"
=
"--force"
]
;
then
FORCE
=
"
$1
"
shift
fi
CP
=
$(
cat
$TMPDIR
/rsync_con_pid 2>/dev/null
)
if
[
-n
"
$CP
"
]
&&
[
-d
"/proc/
$CP
"
]
;
then
echo
"Run conflicts with
$CP
"
date
[
-n
"
$FORCE
"
]
||
exit
fi
echo
"
$$
"
>
$TMPDIR
/rsync_con_pid
date
get_rsync_path
()
{
local
RSYNCPATH
if
[
"
$1
"
=
"c6/branch"
]
||
[
"
$1
"
=
"c7/branch"
]
||
[
"
$1
"
=
"c8/branch"
]
;
then
RSYNCPATH
=
rsync.altlinux.ru::ALTLinux
#elif echo "$1" | grep -q "p8/" ; then
elif
true
;
then
#RSYNCPATH=rsync://ftp.basealt.ru/pub/distributions/ALTLinux
RSYNCPATH
=
rsync://ftp.basealt.ru/ALTLinux
else
RSYNCPATH
=
rsync://mirror.yandex.ru/altlinux
fi
echo
"
$RSYNCPATH
"
}
update_compress
()
{
[
-s
$1
]
||
return
[
"
$1
"
-nt
"
$1
.gz"
]
||
return
gzip
-qkvf
$1
}
DDD
=
$0
.tmp.t1
was_error
()
{
[
-s
"
$DDD
"
]
||
return
1
grep
"^
$1
"
$DDD
}
save_error
()
{
echo
"IGNORE SAVE ERROR"
return
echo
"add
$1
to
$DDD
"
echo
"
$1
"
>>
$DDD
}
sync_file
()
{
local
RET
was_error
$RPMS
/
$1
&&
return
1
RSYNCPATH
=
$(
get_rsync_path
$1
)
echo
echo
"Start sync from
$RSYNCPATH
/
$1
to
$RPMS
/
$1
"
mkdir
-p
$(
dirname
$RPMS
/
$1
)
rsync
$DELETE
--fuzzy
--partial
--timeout
=
$TIMEOUT
--progress
$CHECKSUM
--stats
-vrlt
--copy-links
\
--exclude
"*SRPMS*"
\
$RSYNCPATH
/
$1
$RPMS
/
$1
RET
=
$?
[
"
$RET
"
=
"0"
]
||
save_error
$RPMS
/
$1
return
$RET
}
# p8/branch i586 classic
sync_cont_branch
()
{
local
BRANCH
=
"
$1
"
local
ARCH
=
"
$2
"
local
COMPONENT
=
"
$3
"
[
-n
"
$COMPONENT
"
]
||
fatal
"sync_branch: missed COMPONENT"
RSYNCPATH
=
$(
get_rsync_path
$BRANCH
)
sync_file
$BRANCH
/
$ARCH
/base/contents_index
||
return
update_compress
$RPMS
/
$BRANCH
/
$ARCH
/base/contents_index
}
# branch component
sync_cont_branches
()
{
RSYNCPATH
=
$(
get_rsync_path
$1
)
local
i
for
i
in
$LISTARCH
;
do
sync_cont_branch
"
$1
"
"
$i
"
"
$2
"
done
}
CHECKSUM
=
''
if
[
"
$1
"
=
"--checksum"
]
;
then
CHECKSUM
=
"--checksum"
shift
fi
if
[
"
$1
"
=
"Sisyphus"
]
;
then
sync_cont_branches
$1
classic
sync_cont_branches
$1
debuginfo
exit
elif
echo
"
$1
"
|
grep
-q
branch
;
then
sync_cont_branches
$1
classic
sync_cont_branches
$1
debuginfo
exit
fi
for
i
in
$BRANCHLIST
;
do
sync_cont_branches
$i
/branch classic
sync_cont_branches
$i
/branch debuginfo
done
for
i
in
Sisyphus
;
do
sync_cont_branches
$i
classic
sync_cont_branches
$i
debuginfo
done
date
rm
-f
$TMPDIR
/rsync_con_pid
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment