All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] bitbake: fetch2/npm.py: Allow shrinkwrap resolved relative URL which startswith 'http' (e.g http-proxy)
@ 2018-07-18  9:03 Parthiban Nallathambi
  2018-07-18 14:01 ` Peter Kjellerstedt
  0 siblings, 1 reply; 7+ messages in thread
From: Parthiban Nallathambi @ 2018-07-18  9:03 UTC (permalink / raw)
  To: bitbake-devel

shrinkwrap resolved relative URL can start with http. For example,
"resolved: http-proxy/-/http-proxy-${PV}.tgz" is still relative URL
to npm registry, but starts with http.

Current if statement compares the startswith 'resolved' to 'http',
which makes impossible to use npm download. Condtional comparison
now strictly checks for "http://" and "https://"

Signed-off-by: Parthiban Nallathambi <pn@denx.de>
---
 bitbake/lib/bb/fetch2/npm.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bitbake/lib/bb/fetch2/npm.py b/bitbake/lib/bb/fetch2/npm.py
index ba7fa43a82..5e7fc2f769 100644
--- a/bitbake/lib/bb/fetch2/npm.py
+++ b/bitbake/lib/bb/fetch2/npm.py
@@ -234,7 +234,7 @@ class Npm(FetchMethod):
                         self._getshrinkeddependencies(obj, data['dependencies'][obj], data['dependencies'][obj]['version'], d, ud, lockdown, manifest, False)
                         return
         outputurl = "invalid"
-        if ('resolved' not in data) or (not data['resolved'].startswith('http')):
+        if ('resolved' not in data) or (not data['resolved'].startswith('http://')) or (not data['resolved'].startswith('https://')):
             # will be the case for ${PN}
             fetchcmd = "npm view %s@%s dist.tarball --registry %s" % (pkg, version, ud.registry)
             logger.debug(2, "Found this matching URL: %s" % str(fetchcmd))
-- 
2.14.4



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] bitbake: fetch2/npm.py: Allow shrinkwrap resolved relative URL which startswith 'http' (e.g http-proxy)
  2018-07-18  9:03 [PATCH] bitbake: fetch2/npm.py: Allow shrinkwrap resolved relative URL which startswith 'http' (e.g http-proxy) Parthiban Nallathambi
@ 2018-07-18 14:01 ` Peter Kjellerstedt
  2018-07-18 14:03   ` Parthiban Nallathambi
  0 siblings, 1 reply; 7+ messages in thread
From: Peter Kjellerstedt @ 2018-07-18 14:01 UTC (permalink / raw)
  To: Parthiban Nallathambi, bitbake-devel

> -----Original Message-----
> From: bitbake-devel-bounces@lists.openembedded.org [mailto:bitbake-
> devel-bounces@lists.openembedded.org] On Behalf Of Parthiban
> Nallathambi
> Sent: den 18 juli 2018 11:04
> To: bitbake-devel@lists.openembedded.org
> Subject: [bitbake-devel] [PATCH] bitbake: fetch2/npm.py: Allow
> shrinkwrap resolved relative URL which startswith 'http' (e.g http-
> proxy)
> 
> shrinkwrap resolved relative URL can start with http. For example,
> "resolved: http-proxy/-/http-proxy-${PV}.tgz" is still relative URL
> to npm registry, but starts with http.
> 
> Current if statement compares the startswith 'resolved' to 'http',
> which makes impossible to use npm download. Condtional comparison
> now strictly checks for "http://" and "https://"
> 
> Signed-off-by: Parthiban Nallathambi <pn@denx.de>
> ---
>  bitbake/lib/bb/fetch2/npm.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/bitbake/lib/bb/fetch2/npm.py b/bitbake/lib/bb/fetch2/npm.py
> index ba7fa43a82..5e7fc2f769 100644
> --- a/bitbake/lib/bb/fetch2/npm.py
> +++ b/bitbake/lib/bb/fetch2/npm.py
> @@ -234,7 +234,7 @@ class Npm(FetchMethod):
>                          self._getshrinkeddependencies(obj, data['dependencies'][obj], data['dependencies'][obj]['version'], d, ud, lockdown, manifest, False)
>                          return
>          outputurl = "invalid"
> -        if ('resolved' not in data) or (not data['resolved'].startswith('http')):
> +        if ('resolved' not in data) or (not data['resolved'].startswith('http://')) or (not data['resolved'].startswith('https://')):

That is wrong (the above will always evaluate to true as long as 
'resolved' exists in data since both expressions testing the prefix 
obviously cannot be false at the same time). The correct expression 
should be:

        if ('resolved' not in data) or (not data['resolved'].startswith('http://') and not data['resolved'].startswith('https://')):

>              # will be the case for ${PN}
>              fetchcmd = "npm view %s@%s dist.tarball --registry %s" % (pkg, version, ud.registry)
>              logger.debug(2, "Found this matching URL: %s" % str(fetchcmd))
> --
> 2.14.4

//Peter



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] bitbake: fetch2/npm.py: Allow shrinkwrap resolved relative URL which startswith 'http' (e.g http-proxy)
  2018-07-18 14:01 ` Peter Kjellerstedt
@ 2018-07-18 14:03   ` Parthiban Nallathambi
  2018-07-18 14:14     ` Parthiban Nallathambi
  0 siblings, 1 reply; 7+ messages in thread
From: Parthiban Nallathambi @ 2018-07-18 14:03 UTC (permalink / raw)
  To: Peter Kjellerstedt, bitbake-devel

Hello Peter,

On 07/18/2018 04:01 PM, Peter Kjellerstedt wrote:
>> -----Original Message-----
>> From: bitbake-devel-bounces@lists.openembedded.org [mailto:bitbake-
>> devel-bounces@lists.openembedded.org] On Behalf Of Parthiban
>> Nallathambi
>> Sent: den 18 juli 2018 11:04
>> To: bitbake-devel@lists.openembedded.org
>> Subject: [bitbake-devel] [PATCH] bitbake: fetch2/npm.py: Allow
>> shrinkwrap resolved relative URL which startswith 'http' (e.g http-
>> proxy)
>>
>> shrinkwrap resolved relative URL can start with http. For example,
>> "resolved: http-proxy/-/http-proxy-${PV}.tgz" is still relative URL
>> to npm registry, but starts with http.
>>
>> Current if statement compares the startswith 'resolved' to 'http',
>> which makes impossible to use npm download. Condtional comparison
>> now strictly checks for "http://" and "https://"
>>
>> Signed-off-by: Parthiban Nallathambi <pn@denx.de>
>> ---
>>   bitbake/lib/bb/fetch2/npm.py | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/bitbake/lib/bb/fetch2/npm.py b/bitbake/lib/bb/fetch2/npm.py
>> index ba7fa43a82..5e7fc2f769 100644
>> --- a/bitbake/lib/bb/fetch2/npm.py
>> +++ b/bitbake/lib/bb/fetch2/npm.py
>> @@ -234,7 +234,7 @@ class Npm(FetchMethod):
>>                           self._getshrinkeddependencies(obj, data['dependencies'][obj], data['dependencies'][obj]['version'], d, ud, lockdown, manifest, False)
>>                           return
>>           outputurl = "invalid"
>> -        if ('resolved' not in data) or (not data['resolved'].startswith('http')):
>> +        if ('resolved' not in data) or (not data['resolved'].startswith('http://')) or (not data['resolved'].startswith('https://')):
> 
> That is wrong (the above will always evaluate to true as long as
> 'resolved' exists in data since both expressions testing the prefix
> obviously cannot be false at the same time). The correct expression
> should be:
> 
>          if ('resolved' not in data) or (not data['resolved'].startswith('http://') and not data['resolved'].startswith('https://')):

Thanks for pointing. I missed it. I will update and send the v2.

> 
>>               # will be the case for ${PN}
>>               fetchcmd = "npm view %s@%s dist.tarball --registry %s" % (pkg, version, ud.registry)
>>               logger.debug(2, "Found this matching URL: %s" % str(fetchcmd))
>> --
>> 2.14.4
> 
> //Peter
> 

-- 
Thanks,
Parthiban Nallathambi

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH] bitbake: fetch2/npm.py: Allow shrinkwrap resolved relative URL which startswith 'http' (e.g http-proxy)
  2018-07-18 14:03   ` Parthiban Nallathambi
@ 2018-07-18 14:14     ` Parthiban Nallathambi
  2018-09-21 12:14       ` Parthiban Nallathambi
  0 siblings, 1 reply; 7+ messages in thread
From: Parthiban Nallathambi @ 2018-07-18 14:14 UTC (permalink / raw)
  To: peter.kjellerstedt, bitbake-devel; +Cc: wd, sbabic

shrinkwrap resolved relative URL can start with http. For example,
"resolved: http-proxy/-/http-proxy-${PV}.tgz" is still relative URL
to npm registry, but starts with http.

Current if statement compares the startswith 'resolved' to 'http',
which makes impossible to use npm download. Condtional comparison
now strictly checks for "http://" and "https://"

Changelog since v1:
- Use the proper conditional statement to avoid always success

Signed-off-by: Parthiban Nallathambi <pn@denx.de>
---
 bitbake/lib/bb/fetch2/npm.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bitbake/lib/bb/fetch2/npm.py b/bitbake/lib/bb/fetch2/npm.py
index 408dfc3d03..65bf5a3644 100644
--- a/bitbake/lib/bb/fetch2/npm.py
+++ b/bitbake/lib/bb/fetch2/npm.py
@@ -226,7 +226,7 @@ class Npm(FetchMethod):
                         self._getshrinkeddependencies(obj, data['dependencies'][obj], data['dependencies'][obj]['version'], d, ud, lockdown, manifest, False)
                         return
         outputurl = "invalid"
-        if ('resolved' not in data) or (not data['resolved'].startswith('http')):
+        if ('resolved' not in data) or (not data['resolved'].startswith('http://') and not data['resolved'].startswith('https://')):
             # will be the case for ${PN}
             fetchcmd = "npm view %s@%s dist.tarball --registry %s" % (pkg, version, ud.registry)
             logger.debug(2, "Found this matching URL: %s" % str(fetchcmd))
-- 
2.14.4



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] bitbake: fetch2/npm.py: Allow shrinkwrap resolved relative URL which startswith 'http' (e.g http-proxy)
  2018-07-18 14:14     ` Parthiban Nallathambi
@ 2018-09-21 12:14       ` Parthiban Nallathambi
  2018-11-16 17:49         ` Parthiban Nallathambi
  0 siblings, 1 reply; 7+ messages in thread
From: Parthiban Nallathambi @ 2018-09-21 12:14 UTC (permalink / raw)
  To: peter.kjellerstedt, bitbake-devel; +Cc: wd, sbabic

Ping on this patch!

On 07/18/2018 04:14 PM, Parthiban Nallathambi wrote:
> shrinkwrap resolved relative URL can start with http. For example,
> "resolved: http-proxy/-/http-proxy-${PV}.tgz" is still relative URL
> to npm registry, but starts with http.
> 
> Current if statement compares the startswith 'resolved' to 'http',
> which makes impossible to use npm download. Condtional comparison
> now strictly checks for "http://" and "https://"
> 
> Changelog since v1:
> - Use the proper conditional statement to avoid always success
> 
> Signed-off-by: Parthiban Nallathambi <pn@denx.de>
> ---
>   bitbake/lib/bb/fetch2/npm.py | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/bitbake/lib/bb/fetch2/npm.py b/bitbake/lib/bb/fetch2/npm.py
> index 408dfc3d03..65bf5a3644 100644
> --- a/bitbake/lib/bb/fetch2/npm.py
> +++ b/bitbake/lib/bb/fetch2/npm.py
> @@ -226,7 +226,7 @@ class Npm(FetchMethod):
>                           self._getshrinkeddependencies(obj, data['dependencies'][obj], data['dependencies'][obj]['version'], d, ud, lockdown, manifest, False)
>                           return
>           outputurl = "invalid"
> -        if ('resolved' not in data) or (not data['resolved'].startswith('http')):
> +        if ('resolved' not in data) or (not data['resolved'].startswith('http://') and not data['resolved'].startswith('https://')):
>               # will be the case for ${PN}
>               fetchcmd = "npm view %s@%s dist.tarball --registry %s" % (pkg, version, ud.registry)
>               logger.debug(2, "Found this matching URL: %s" % str(fetchcmd))
> 

-- 
Thanks,
Parthiban N


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] bitbake: fetch2/npm.py: Allow shrinkwrap resolved relative URL which startswith 'http' (e.g http-proxy)
  2018-09-21 12:14       ` Parthiban Nallathambi
@ 2018-11-16 17:49         ` Parthiban Nallathambi
  0 siblings, 0 replies; 7+ messages in thread
From: Parthiban Nallathambi @ 2018-11-16 17:49 UTC (permalink / raw)
  To: peter.kjellerstedt, bitbake-devel; +Cc: wd, sbabic

Ping on this patch!

On 9/21/18 2:14 PM, Parthiban Nallathambi wrote:
> Ping on this patch!
> 
> On 07/18/2018 04:14 PM, Parthiban Nallathambi wrote:
>> shrinkwrap resolved relative URL can start with http. For example,
>> "resolved: http-proxy/-/http-proxy-${PV}.tgz" is still relative URL
>> to npm registry, but starts with http.
>>
>> Current if statement compares the startswith 'resolved' to 'http',
>> which makes impossible to use npm download. Condtional comparison
>> now strictly checks for "http://" and "https://"
>>
>> Changelog since v1:
>> - Use the proper conditional statement to avoid always success
>>
>> Signed-off-by: Parthiban Nallathambi <pn@denx.de>
>> ---
>>   bitbake/lib/bb/fetch2/npm.py | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/bitbake/lib/bb/fetch2/npm.py b/bitbake/lib/bb/fetch2/npm.py
>> index 408dfc3d03..65bf5a3644 100644
>> --- a/bitbake/lib/bb/fetch2/npm.py
>> +++ b/bitbake/lib/bb/fetch2/npm.py
>> @@ -226,7 +226,7 @@ class Npm(FetchMethod):
>>                           self._getshrinkeddependencies(obj, data['dependencies'][obj], data['dependencies'][obj]['version'], d, ud, lockdown, manifest, False)
>>                           return
>>           outputurl = "invalid"
>> -        if ('resolved' not in data) or (not data['resolved'].startswith('http')):
>> +        if ('resolved' not in data) or (not data['resolved'].startswith('http://') and not data['resolved'].startswith('https://')):
>>               # will be the case for ${PN}
>>               fetchcmd = "npm view %s@%s dist.tarball --registry %s" % (pkg, version, ud.registry)
>>               logger.debug(2, "Found this matching URL: %s" % str(fetchcmd))
>>
> 

-- 
Thanks,
Parthiban N

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-22 Fax: (+49)-8142-66989-80 Email: pn@denx.de


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH] bitbake: fetch2/npm.py: Allow shrinkwrap resolved relative URL which startswith 'http' (e.g http-proxy)
@ 2018-03-14 16:50 Parthiban Nallathambi
  0 siblings, 0 replies; 7+ messages in thread
From: Parthiban Nallathambi @ 2018-03-14 16:50 UTC (permalink / raw)
  To: bitbake-devel; +Cc: lusus, wd, sbabic

shrinkwrap resolved relative URL can start with http. For example,
"resolved: http-proxy/-/http-proxy-${PV}.tgz" is still relative URL
to npm registry, but starts with http.

Current if statement compares the startswith 'resolved' to 'http',
which makes impossible to use npm download. Condtional comparison
now strictly checks for "http://" and "https://"

Signed-off-by: Parthiban Nallathambi <pn@denx.de>
---
 bitbake/lib/bb/fetch2/npm.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bitbake/lib/bb/fetch2/npm.py b/bitbake/lib/bb/fetch2/npm.py
index 730c346a93..95f7484444 100644
--- a/bitbake/lib/bb/fetch2/npm.py
+++ b/bitbake/lib/bb/fetch2/npm.py
@@ -227,7 +227,7 @@ class Npm(FetchMethod):
                         self._getshrinkeddependencies(obj, data['dependencies'][obj], data['dependencies'][obj]['version'], d, ud, lockdown, manifest, False)
                         return
         outputurl = "invalid"
-        if ('resolved' not in data) or (not data['resolved'].startswith('http')):
+        if ('resolved' not in data) or (not data['resolved'].startswith('http://')) or (not data['resolved'].startswith('https://')):
             # will be the case for ${PN}
             fetchcmd = "npm view %s@%s dist.tarball --registry %s" % (pkg, version, ud.registry)
             logger.debug(2, "Found this matching URL: %s" % str(fetchcmd))
-- 
2.14.3



^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-11-16 17:58 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-18  9:03 [PATCH] bitbake: fetch2/npm.py: Allow shrinkwrap resolved relative URL which startswith 'http' (e.g http-proxy) Parthiban Nallathambi
2018-07-18 14:01 ` Peter Kjellerstedt
2018-07-18 14:03   ` Parthiban Nallathambi
2018-07-18 14:14     ` Parthiban Nallathambi
2018-09-21 12:14       ` Parthiban Nallathambi
2018-11-16 17:49         ` Parthiban Nallathambi
  -- strict thread matches above, loose matches on Subject: below --
2018-03-14 16:50 Parthiban Nallathambi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.