-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmirror-opensuse-repo
executable file
·40 lines (32 loc) · 1.25 KB
/
mirror-opensuse-repo
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/sh
# Mirrors the opensuse distribution. Meant to be run daily.
#
# -- [email protected] Tue Feb 19 19:52:47 CET 2013
# -- [email protected] Tue Jan 7 19:07:55 CET 2014
#
source $(dirname $(realpath $0))/.config.opensuse.subr
create_lock
create_filter_suse
echo
echo "--------------------------------------------------------------"
echo "`date` - OpenSuSE mirror started"
# Include only update and distribution repos for selected releases.
#
$RSYNC --verbose --human-readable \
--recursive --links --perms --times \
--itemize-changes --stats --delete \
--filter "merge $FILTER" \
--exclude='*' \
$RSYNC_HOST $MIRROR_DIR
ret=$?
echo "`date` - OpenSuSE mirror completed with status $ret"
echo "--------------------------------------------------------------"
echo
# Update URLs in .repo files in update/ repos
replace_repo_uris $MIRROR_DIR/update
# Update URLs in content.xml files in distribution/ repos
find $MIRROR_DIR/distribution/{,leap/}*/repo/*/control.xml -print0 |
xargs -0 sed -Ei \
-e "s#https?://download.opensuse.org/update/#https://$LOCAL_HOST/update/#" \
-e "s#https?://download.opensuse.org/distribution/#https://$LOCAL_HOST/distribution/#"
exit $ret