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
692d59d4
Commit
692d59d4
authored
Mar 01, 2011
by
Natanael Copa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
setup-apkrepos: mionor cleanup
use get_hostname_from_url function to make it more readable
parent
a75f4297
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
8 deletions
+6
-8
setup-apkrepos.in
setup-apkrepos.in
+6
-8
No files found.
setup-apkrepos.in
View file @
692d59d4
...
@@ -20,6 +20,11 @@ if [ -r "$APKREPOS_PATH" ]; then
...
@@ -20,6 +20,11 @@ if [ -r "$APKREPOS_PATH" ]; then
APKREPOS
=
`
cat
"
$APKREPOS_PATH
"
`
APKREPOS
=
`
cat
"
$APKREPOS_PATH
"
`
fi
fi
get_hostname_from_url
()
{
local
n
=
${
1
#*
://
}
echo
${
n
%%/*
}
}
prompt_setup_method
()
{
prompt_setup_method
()
{
while
true
;
do
while
true
;
do
echo
"How would you like to set up internet apk repositories?"
echo
"How would you like to set up internet apk repositories?"
...
@@ -50,9 +55,7 @@ get_random_mirror() {
...
@@ -50,9 +55,7 @@ get_random_mirror() {
i
=
`
expr
$i
+ 1
`
i
=
`
expr
$i
+ 1
`
done
done
random_mirror_hostname
=
`
echo
$mirror
|
awk
-F
'://'
'{print $2}'
|
awk
-F
'/'
'{print $1}'
`
echo
"using
$(
get_hostname_from_url
$mirror
)
"
echo
"using
$random_mirror_hostname
."
}
}
get_fastest_mirror
()
{
get_fastest_mirror
()
{
...
@@ -90,11 +93,6 @@ get_fastest_mirror() {
...
@@ -90,11 +93,6 @@ get_fastest_mirror() {
mirror
=
$mirror_lowest_rtt_mirror
mirror
=
$mirror_lowest_rtt_mirror
}
}
get_hostname_from_url
()
{
local
n
=
${
1
#*
://
}
echo
${
n
%%/*
}
}
prompt_mirror_list
()
{
prompt_mirror_list
()
{
local
i
local
i
local
mirror_hostname
local
mirror_hostname
...
...
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