Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
alpine-conf
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
18
Issues
18
List
Boards
Labels
Service Desk
Milestones
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
alpine
alpine-conf
Commits
64c15514
Commit
64c15514
authored
Mar 01, 2011
by
Natanael Copa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
setup-apkrepos: minor simplification
We only need the hostname after we found the mirror we want
parent
ee9312c5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
6 deletions
+1
-6
setup-apkrepos.in
setup-apkrepos.in
+1
-6
No files found.
setup-apkrepos.in
View file @
64c15514
...
...
@@ -63,38 +63,33 @@ get_random_mirror() {
}
get_fastest_mirror
()
{
local
mirror_hostname
local
tmp_mirror_nslookup
local
tmp_mirror_time
local
tmp_mirror_time_failed
local
tmp_mirror_rtt
local
mirror_lowest_rtt
local
mirror_lowest_rtt_hostname
local
mirror_lowest_rtt_mirror
echo
-n
"Finding fastest mirror... "
mirror_lowest_rtt
=
-1
for
mirror
in
$MIRRORS
;
do
mirror_hostname
=
`
echo
$mirror
|
awk
-F
'://'
'{print $2}'
|
awk
-F
'/'
'{print $1}'
`
tmp_mirror_time
=
"
`
(
time
wget
-qO
-
$mirror
)
2>&1
||
echo
"E_MIRROR_FAILED"
`
"
tmp_mirror_time_failed
=
`
echo
$tmp_mirror_time
|
grep
"E_MIRROR_FAILED"
`
if
[
${#
tmp_mirror_time_failed
}
-eq
0
]
;
then
tmp_mirror_rtt
=
`
echo
"
$tmp_mirror_time
"
|
grep
-E
"^real"
|
sed
-r
"s/^real[ ]+[0-9]+m[ ]+([0-9]+)
\.
([0-9]+)s
$/
\1\2
/"
`
if
[
$mirror_lowest_rtt
-eq
-1
]
;
then
mirror_lowest_rtt
=
$tmp_mirror_rtt
mirror_lowest_rtt_hostname
=
$mirror_hostname
mirror_lowest_rtt_mirror
=
$mirror
else
if
[
$tmp_mirror_rtt
-lt
$mirror_lowest_rtt
]
;
then
mirror_lowest_rtt
=
$tmp_mirror_rtt
mirror_lowest_rtt_hostname
=
$mirror_hostname
mirror_lowest_rtt_mirror
=
$mirror
fi
fi
fi
done
echo
"using
$mirror_lowest_rtt_hostname
."
mirror
=
$mirror_lowest_rtt_mirror
echo
"using
$(
get_hostname_from_url
$mirror
)
"
}
prompt_mirror_list
()
{
...
...
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