Commit 524a09e0 authored by Boris Yumankulov's avatar Boris Yumankulov Committed by Vitaly Lipatov

epm update --content-index: fix rsync install (eterbug #17634)

parent 66364f58
...@@ -130,9 +130,23 @@ update_alt_contents_index() ...@@ -130,9 +130,23 @@ update_alt_contents_index()
# TODO: fix for Etersoft/LINUX@Etersoft # TODO: fix for Etersoft/LINUX@Etersoft
# TODO: fix for rsync # TODO: fix for rsync
info "Retrieving contents_index ..." info "Retrieving contents_index ..."
(quiet=1 epm_repolist) | grep -v " task$" | grep -E "rpm.*(ftp://|http://|https://|rsync://|file:/)" | sed -e "s@^rpm.*\(ftp://\|http://\|https://\)@rsync://@g" | sed -e "s@^rpm.*\(file:\)@@g" | while read -r URL1 URL2 component ; do
mapfile -t URL_LIST < <(
(quiet=1 epm_repolist) | \
grep -v " task$" | \
grep -E "rpm.*(ftp://|http://|https://|rsync://|file:/)" | \
sed -e "s@^rpm.*\(ftp://\|http://\|https://\)@rsync://@g" | \
sed -e "s@^rpm.*\(file:\)@@g"
)
for line in "${URL_LIST[@]}"; do
URL1=$(echo "$line" | awk '{print $1}')
URL2=$(echo "$line" | awk '{print $2}')
component=$(echo "$line" | awk '{print $3}')
[ "$component" = "debuginfo" ] && continue [ "$component" = "debuginfo" ] && continue
URL="$URL1/$URL2" URL="$URL1/$URL2"
if is_abs_path "$URL" ; then if is_abs_path "$URL" ; then
# first check for local mirror # first check for local mirror
local LOCALPATH="$(echo "$URL/base")" local LOCALPATH="$(echo "$URL/base")"
...@@ -141,9 +155,11 @@ update_alt_contents_index() ...@@ -141,9 +155,11 @@ update_alt_contents_index()
else else
local LOCALPATH="$(get_local_alt_mirror_path "$URL")" local LOCALPATH="$(get_local_alt_mirror_path "$URL")"
local REMOTEURL="$(get_url_to_etersoft_mirror "$URL")" local REMOTEURL="$(get_url_to_etersoft_mirror "$URL")"
if [ -n "$REMOTEURL" ] ; then if [ -n "$REMOTEURL" ] ; then
rsync_alt_contents_index $REMOTEURL/base/contents_index.gz $LOCALPATH/contents_index.gz && __add_to_contents_index_list "$REMOTEURL" "$LOCALPATH/contents_index.gz" && continue rsync_alt_contents_index "$REMOTEURL/base/contents_index.gz" "$LOCALPATH/contents_index.gz" && \
[ -n "$verbose" ] && info 'Note: Can'\''t retrieve $REMOTEURL/base/contents_index.gz, fallback to $URL/base/contents_index' __add_to_contents_index_list "$REMOTEURL" "$LOCALPATH/contents_index.gz" && continue
[ -n "$verbose" ] && info "Note: Can't retrieve $REMOTEURL/base/contents_index.gz, fallback to $URL/base/contents_index"
fi fi
# we don't know if remote server has rsync # we don't know if remote server has rsync
# fix rsync URL firstly # fix rsync URL firstly
......
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