Re: [PATCH 1/2 v2] * avoid downloading tomcat if it already exists

2018-01-11 Thread Geraldo Netto
Hello Nadav/All,

Indeed, '-nc' leaves the partial file :(
So, '-c' it is :)

I'll prepare another patch with that
Also, I'm preparing some patches to upgrade tomcat from 8.0.15 to 8.0.48
Please, let me know if you happen to have any instruction when submitting
the patches
Specially because this is the first time I'm using git and submitting any
patch


Kind Regards,

Geraldo Netto
Sapere Aude => Non dvcor, dvco
http://exdev.sf.net/

On 11 January 2018 at 20:42, Nadav Har'El  wrote:

>
> On Thu, Jan 11, 2018 at 11:09 PM, geraldo netto 
> wrote:
>
>> Signed-off-by: geraldo netto 
>> ---
>>  tomcat/GET | 9 -
>>  1 file changed, 8 insertions(+), 1 deletion(-)
>>
>> diff --git a/tomcat/GET b/tomcat/GET
>> index b96d963..07247d9 100755
>> --- a/tomcat/GET
>> +++ b/tomcat/GET
>> @@ -8,7 +8,14 @@ archive=$dir.tar.gz
>>
>>  mkdir -p upstream
>>  pushd upstream
>> -wget http://archive.apache.org/dist/tomcat/tomcat-${MAJOR}/v${VER
>> SION}/bin/${archive}
>> +wget -nc http://archive.apache.org/dist/tomcat/tomcat-${MAJOR}/v${VER
>> SION}/bin/${archive}
>> +wget -nc https://archive.apache.org/dist/tomcat/tomcat-${MAJOR}/v${VE
>> RSION}/bin/${archive}.md5
>> +
>> +if [ "$(md5sum -c ${archive}.md5)" != "${archive}: OK" ];
>> +then
>> +echo "Aborting: invalid md5 for Apache Tomcat $VERSION"
>> +exit 1
>> +fi
>>
>
> What does the "-nc" do if the download fails in the middle for some reason
> (e.g., user pressed control-C),
> and then tries to run the build again? Does "-nc" leave the partial file -
> and then fail the md5sum check -
> or does it do something more problem?
> This is why I thought that "-c" was the right option to use. But maybe
> "-nc" also does the right thing here?
> Please check.
>
>>
>>  tar zxvf $archive
>>
>>  pushd $dir
>> --
>> 2.7.4
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "OSv Development" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to osv-dev+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [PATCH 1/2 v2] * avoid downloading tomcat if it already exists

2018-01-11 Thread Nadav Har'El
On Thu, Jan 11, 2018 at 11:09 PM, geraldo netto 
wrote:

> Signed-off-by: geraldo netto 
> ---
>  tomcat/GET | 9 -
>  1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/tomcat/GET b/tomcat/GET
> index b96d963..07247d9 100755
> --- a/tomcat/GET
> +++ b/tomcat/GET
> @@ -8,7 +8,14 @@ archive=$dir.tar.gz
>
>  mkdir -p upstream
>  pushd upstream
> -wget http://archive.apache.org/dist/tomcat/tomcat-${MAJOR}/v$
> {VERSION}/bin/${archive}
> +wget -nc http://archive.apache.org/dist/tomcat/tomcat-${MAJOR}/v$
> {VERSION}/bin/${archive}
> +wget -nc https://archive.apache.org/dist/tomcat/tomcat-${MAJOR}/v$
> {VERSION}/bin/${archive}.md5
> +
> +if [ "$(md5sum -c ${archive}.md5)" != "${archive}: OK" ];
> +then
> +echo "Aborting: invalid md5 for Apache Tomcat $VERSION"
> +exit 1
> +fi
>

What does the "-nc" do if the download fails in the middle for some reason
(e.g., user pressed control-C),
and then tries to run the build again? Does "-nc" leave the partial file -
and then fail the md5sum check -
or does it do something more problem?
This is why I thought that "-c" was the right option to use. But maybe
"-nc" also does the right thing here?
Please check.

>
>  tar zxvf $archive
>
>  pushd $dir
> --
> 2.7.4
>
> --
> You received this message because you are subscribed to the Google Groups
> "OSv Development" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to osv-dev+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[PATCH 1/2 v2] * avoid downloading tomcat if it already exists

2018-01-11 Thread geraldo netto
Signed-off-by: geraldo netto 
---
 tomcat/GET | 9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/tomcat/GET b/tomcat/GET
index b96d963..07247d9 100755
--- a/tomcat/GET
+++ b/tomcat/GET
@@ -8,7 +8,14 @@ archive=$dir.tar.gz
 
 mkdir -p upstream
 pushd upstream
-wget 
http://archive.apache.org/dist/tomcat/tomcat-${MAJOR}/v${VERSION}/bin/${archive}
+wget -nc 
http://archive.apache.org/dist/tomcat/tomcat-${MAJOR}/v${VERSION}/bin/${archive}
+wget -nc 
https://archive.apache.org/dist/tomcat/tomcat-${MAJOR}/v${VERSION}/bin/${archive}.md5
+
+if [ "$(md5sum -c ${archive}.md5)" != "${archive}: OK" ];
+then
+echo "Aborting: invalid md5 for Apache Tomcat $VERSION"
+exit 1
+fi
 tar zxvf $archive
 
 pushd $dir
-- 
2.7.4

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.