For discussion of Alpine Linux development and developer support

3 2

[alpine-devel] [PATCH] setup-apkrepos: fix detect fastest mirror - fixes #6683

Details
Message ID
<1485272345-14166-1-git-send-email-rnalrd@gmail.com>
Sender timestamp
1485272345
DKIM signature
missing
Download raw message
Patch: +3 -1
From: Leonardo Arena <rnalrd@gmail.com>

---
 setup-apkrepos.in | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/setup-apkrepos.in b/setup-apkrepos.in
index 4565852..f4d4709 100644
--- a/setup-apkrepos.in
+++ b/setup-apkrepos.in
@@ -51,7 +51,7 @@ find_fastest_mirror() {
 	for url in $MIRRORS; do
 		# warm up the dns cache
 		nslookup $(get_hostname_from_url $url) >/dev/null 2>&1
-		local time=$(time_cmd wget -q -s -T 5 \
+		local time=$(time_cmd wget -q -S -T 5 \
 			${url%/}/edge/main/$arch/APKINDEX.tar.gz)
 		if [ -n "$time" ]; then
 			echo "$time $url"
@@ -204,6 +204,8 @@ if [ -n "$JUSTADDRANDOM" ]; then
 fi
 
 if [ -n "$JUSTADDFASTEST" ]; then
+	# need GNU wget
+	apk add wget --quiet
 	show_mirror_list > /dev/null
 	add_fastest_mirror && changed=true
 fi
-- 
2.7.4



---
Unsubscribe:  alpine-devel+unsubscribe@lists.alpinelinux.org
Help:         alpine-devel+help@lists.alpinelinux.org
---
Natanael Copa
Details
Message ID
<20170124165812.685f5714@ncopa-desktop.copa.dup.pw>
In-Reply-To
<1485272345-14166-1-git-send-email-rnalrd@gmail.com> (view parent)
Sender timestamp
1485273492
DKIM signature
missing
Download raw message
On Tue, 24 Jan 2017 16:39:05 +0100
rnalrd@gmail.com wrote:

> From: Leonardo Arena <rnalrd@gmail.com>
> 
> ---
>  setup-apkrepos.in | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/setup-apkrepos.in b/setup-apkrepos.in
> index 4565852..f4d4709 100644
> --- a/setup-apkrepos.in
> +++ b/setup-apkrepos.in
> @@ -51,7 +51,7 @@ find_fastest_mirror() {
>  	for url in $MIRRORS; do
>  		# warm up the dns cache
>  		nslookup $(get_hostname_from_url $url) >/dev/null 2>&1
> -		local time=$(time_cmd wget -q -s -T 5 \
> +		local time=$(time_cmd wget -q -S -T 5 \
>  			${url%/}/edge/main/$arch/APKINDEX.tar.gz)
>  		if [ -n "$time" ]; then
>  			echo "$time $url"
> @@ -204,6 +204,8 @@ if [ -n "$JUSTADDRANDOM" ]; then
>  fi
>  
>  if [ -n "$JUSTADDFASTEST" ]; then
> +	# need GNU wget
> +	apk add wget --quiet
>  	show_mirror_list > /dev/null
>  	add_fastest_mirror && changed=true
>  fi

I dont think we should pull in gnu wget since we then would need to
have it on the iso.

I think there is a wget --spider option that should work for busybox too.

https://git.busybox.net/busybox/commit/?id=2972e2c4acb9c46a8cc05c857acac2b3d439bf69

-nc


---
Unsubscribe:  alpine-devel+unsubscribe@lists.alpinelinux.org
Help:         alpine-devel+help@lists.alpinelinux.org
---
Leonardo Arena
Details
Message ID
<1485274245.11710.44.camel@gmail.com>
In-Reply-To
<20170124165812.685f5714@ncopa-desktop.copa.dup.pw> (view parent)
Sender timestamp
1485274245
DKIM signature
missing
Download raw message
On mar, 2017-01-24 at 16:58 +0100, Natanael Copa wrote:
> On Tue, 24 Jan 2017 16:39:05 +0100
> rnalrd@gmail.com wrote:
> 
> > 
> > From: Leonardo Arena <rnalrd@gmail.com>
> > 
> > ---
> >  setup-apkrepos.in | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> > 
> > diff --git a/setup-apkrepos.in b/setup-apkrepos.in
> > index 4565852..f4d4709 100644
> > --- a/setup-apkrepos.in
> > +++ b/setup-apkrepos.in
> > @@ -51,7 +51,7 @@ find_fastest_mirror() {
> >  	for url in $MIRRORS; do
> >  		# warm up the dns cache
> >  		nslookup $(get_hostname_from_url $url) >/dev/null
> > 2>&1
> > -		local time=$(time_cmd wget -q -s -T 5 \
> > +		local time=$(time_cmd wget -q -S -T 5 \
> >  			${url%/}/edge/main/$arch/APKINDEX.tar.gz)
> >  		if [ -n "$time" ]; then
> >  			echo "$time $url"
> > @@ -204,6 +204,8 @@ if [ -n "$JUSTADDRANDOM" ]; then
> >  fi
> >  
> >  if [ -n "$JUSTADDFASTEST" ]; then
> > +	# need GNU wget
> > +	apk add wget --quiet
> >  	show_mirror_list > /dev/null
> >  	add_fastest_mirror && changed=true
> >  fi
> I dont think we should pull in gnu wget since we then would need to
> have it on the iso.
> 
> I think there is a wget --spider option that should work for busybox
> too.
> 
> https://git.busybox.net/busybox/commit/?id=2972e2c4acb9c46a8cc05c857a
> cac2b3d439bf69
> 
> -nc


Well, edge still has 1.26. So I did it with what was available :)
Nice option though!

Thanks

-|_eo
Leonardo Arena
Details
Message ID
<1485328750.11710.54.camel@gmail.com>
In-Reply-To
<1485274245.11710.44.camel@gmail.com> (view parent)
Sender timestamp
1485328750
DKIM signature
missing
Download raw message
On mar, 2017-01-24 at 17:10 +0100, Leonardo Arena wrote:
> On mar, 2017-01-24 at 16:58 +0100, Natanael Copa wrote:
> > 
> > On Tue, 24 Jan 2017 16:39:05 +0100
> > rnalrd@gmail.com wrote:
> > 
> > > 
> > > 
> > > From: Leonardo Arena <rnalrd@gmail.com>
> > > 
> > > ---
> > >  setup-apkrepos.in | 4 +++-
> > >  1 file changed, 3 insertions(+), 1 deletion(-)
> > > 
> > > diff --git a/setup-apkrepos.in b/setup-apkrepos.in
> > > index 4565852..f4d4709 100644
> > > --- a/setup-apkrepos.in
> > > +++ b/setup-apkrepos.in
> > > @@ -51,7 +51,7 @@ find_fastest_mirror() {
> > >  	for url in $MIRRORS; do
> > >  		# warm up the dns cache
> > >  		nslookup $(get_hostname_from_url $url)
> > > >/dev/null
> > > 2>&1
> > > -		local time=$(time_cmd wget -q -s -T 5 \
> > > +		local time=$(time_cmd wget -q -S -T 5 \
> > >  			${url%/}/edge/main/$arch/APKINDEX.tar.gz
> > > )
> > >  		if [ -n "$time" ]; then
> > >  			echo "$time $url"
> > > @@ -204,6 +204,8 @@ if [ -n "$JUSTADDRANDOM" ]; then
> > >  fi
> > >  
> > >  if [ -n "$JUSTADDFASTEST" ]; then
> > > +	# need GNU wget
> > > +	apk add wget --quiet
> > >  	show_mirror_list > /dev/null
> > >  	add_fastest_mirror && changed=true
> > >  fi
> > I dont think we should pull in gnu wget since we then would need to
> > have it on the iso.
> > 
> > I think there is a wget --spider option that should work for
> > busybox
> > too.
> > 
> > https://git.busybox.net/busybox/commit/?id=2972e2c4acb9c46a8cc05c85
> > 7a
> > cac2b3d439bf69
> > 
> > -nc
> 
> Well, edge still has 1.26. So I did it with what was available :)
> Nice option though!
> 

I misread the commit message like there was version 1.28 out, but
instead it talks about GNU wget 1.18.
I guess I shouldn't look at this stuff when I'm in rush to the end of
working day :-)

-|_eo