Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
eepm
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
eepm
Commits
1e517490
Commit
1e517490
authored
Mar 03, 2021
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
epm-sh-altlinux-contents-index: improve content_index list informativity
parent
d717e2d9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
12 deletions
+13
-12
epm-sh-altlinux-contents-index
bin/epm-sh-altlinux-contents-index
+13
-12
No files found.
bin/epm-sh-altlinux-contents-index
View file @
1e517490
...
...
@@ -98,21 +98,22 @@ __init_contents_index_list()
truncate
-s0
$ALT_CONTENTS_INDEX_LIST
}
# "comment" "file"
__add_to_contents_index_list
()
{
echo
"
$1
"
echo
"
$
1
"
>>
$ALT_CONTENTS_INDEX_LIST
echo
"
$1
->
$2
"
echo
"
$
2
"
>>
$ALT_CONTENTS_INDEX_LIST
}
# file file2
#
"comment"
file file2
__add_better_to_contents_index_list
()
{
if
[
-s
"
$
1
"
]
&&
[
-s
"
$2
"
]
;
then
[
"
$
1
"
-ot
"
$2
"
]
&&
__add_to_contents_index_list
"
$2
"
&&
return
__add_to_contents_index_list
"
$1
"
&&
return
if
[
-s
"
$
2
"
]
&&
[
-s
"
$3
"
]
;
then
[
"
$
2
"
-ot
"
$3
"
]
&&
__add_to_contents_index_list
"
$1
"
"
$3
"
&&
return
__add_to_contents_index_list
"
$1
"
"
$2
"
&&
return
fi
[
-s
"
$
1
"
]
&&
__add_to_contents_index_list
"
$1
"
&&
return
[
-s
"
$
2
"
]
&&
__add_to_contents_index_list
"
$2
"
&&
return
[
-s
"
$
2
"
]
&&
__add_to_contents_index_list
"
$1
"
"
$2
"
&&
return
[
-s
"
$
3
"
]
&&
__add_to_contents_index_list
"
$1
"
"
$3
"
&&
return
}
...
...
@@ -131,19 +132,19 @@ update_alt_contents_index()
# first check for local mirror
local
LOCALPATH
=
"
$(
echo
"
$URL
/base"
)
"
local
LOCALPATHGZIP
=
"
$(
echo
"
$LOCALPATH
"
|
sed
-e
"s|/ALTLinux/|/ALTLinux/contents_index/|"
)
"
__add_better_to_contents_index_list
"
$LOCALPATHGZIP
/contents_index.gz"
"
$LOCALPATH
/contents_index"
__add_better_to_contents_index_list
"
$
URL
"
"
$
LOCALPATHGZIP
/contents_index.gz"
"
$LOCALPATH
/contents_index"
else
local
LOCALPATH
=
"
$(
get_local_alt_mirror_path
"
$URL
"
)
"
local
REMOTEURL
=
"
$(
get_url_to_etersoft_mirror
"
$URL
"
)
"
if
[
-n
"
$REMOTEURL
"
]
;
then
rsync_alt_contents_index
$REMOTEURL
/base/contents_index.gz
$LOCALPATH
/contents_index.gz
&&
__add_to_contents_index_list
"
$LOCALPATH
/contents_index.gz"
&&
continue
rsync_alt_contents_index
$REMOTEURL
/base/contents_index.gz
$LOCALPATH
/contents_index.gz
&&
__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
# fix rsync URL firstly
local
RSYNCURL
=
"
$(
echo
"
$URL
"
|
sed
-e
"s|rsync://
\(
ftp.basealt.ru
\|
basealt.org
\|
altlinux.ru
\)
/pub/distributions/ALTLinux|rsync://
\1
/ALTLinux|"
)
"
#"
rsync_alt_contents_index
$RSYNCURL
/base/contents_index
$LOCALPATH
/contents_index
&&
__add_to_contents_index_list
"
$LOCALPATH
/contents_index"
&&
continue
rsync_alt_contents_index
$RSYNCURL
/base/contents_index
$LOCALPATH
/contents_index
&&
__add_to_contents_index_list
"
$
RSYNCURL
"
"
$
LOCALPATH
/contents_index"
&&
continue
__add_better_to_contents_index_list
"
$LOCALPATH
/contents_index.gz"
"
$LOCALPATH
/contents_index"
__add_better_to_contents_index_list
"
(cached)"
"
$LOCALPATH
/contents_index.gz"
"
$LOCALPATH
/contents_index"
fi
done
if
[
!
-s
"
$ALT_CONTENTS_INDEX_LIST
"
]
;
then
...
...
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