mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] Proper quoting of semicolons in URLs
@ 2013-02-26  9:20 Dennis.Herbrich
  2013-02-26  9:59 ` Marc Kleine-Budde
  0 siblings, 1 reply; 5+ messages in thread
From: Dennis.Herbrich @ 2013-02-26  9:20 UTC (permalink / raw)
  To: ptxdist

Good day, everyone!

When using ptxdist to "get" a package with an URL with semicolons in it, 
for example a snapshot from a gitweb repo, anything after the first 
semicolon
is interpreted as options to wget. Unfortunately I was unable to find a 
quoting
style that prevented this while still handing over a usable URL to wget:

An example for an URL I want to use:
http://git.xilinx.com/?p=linux-xlnx.git;a=snapshot;h=04d9378881401e71f83b8b4fea0abd71d33b4052;sf=tgz

I'm using ptxdist 2013.01.90 and copied the original kernel.make to my 
project
rules, with a custom KERNEL_URL. I tried these variations, and got the 
following
(slightly cleaned) results:

"Naive":
KERNEL_URL              := 
http://git.xilinx.com/?p=linux-xlnx.git;a=snapshot;h=04d9378881401e71f83b8b4fea0abd71d33b4052;sf=tgz

$ ptxdist-2013.01.90 print KERNEL_URL
http://git.xilinx.com/?p=linux-xlnx.git;a=snapshot;h=04d9378881401e71f83b8b4fea0abd71d33b4052;sf=tgz
$ ptxdist-2013.01.90 get kernel
ptxdist: error: invalid option 'a=snapshot' to ptxd_make_get_http


"Doublequoting":
KERNEL_URL              := 
"http://git.xilinx.com/?p=linux-xlnx.git;a=snapshot;h=04d9378881401e71f83b8b4fea0abd71d33b4052;sf=tgz"

$ ptxdist-2013.01.90 print KERNEL_URL
http://git.xilinx.com/?p=linux-xlnx.git
(This downloads an obviously unwanted HTML index page)


"Singlequoting":
KERNEL_URL              := 
'http://git.xilinx.com/?p=linux-xlnx.git;a=snapshot;h=04d9378881401e71f83b8b4fea0abd71d33b4052;sf=tgz'

$ ptxdist-2013.01.90 print KERNEL_URL
'http://git.xilinx.com/?p=linux-xlnx.git;a=snapshot;h=04d9378881401e71f83b8b4fea0abd71d33b4052;sf=tgz'
$ ptxdist-2013.01.90 get kernel
Could not download package
URL: 
'http://git.xilinx.com/?p=linux-xlnx.git;a=snapshot;h=04d9378881401e71f83b8b4fea0abd71d33b4052;sf=tgz'


Using backslashes to escape the semicolons does not work, either, same 
behaviour
as in "Naive".

Using urlencoding as in 
KERNEL_URL              := 
http://git.xilinx.com/?p=linux-xlnx.git%3Ba=snapshot%3Bh=04d9378881401e71f83b8b4fea0abd71d33b4052%3Bsf=tgz
would technically work with ptxdist, but gitweb doesn't seem to decode 
this,
 and throws a 404, which seems broken by itself. :(

Does anybody have a suggestion how to quote semicolons in my URL properly,
lest they are passed literally to wget instead of being split into 
options?
Is there some $(call verbatim,FOO) macro, perchance?

Thanks!
Dennis Herbrich

Hytera Mobilfunk GmbH
Fritz-Hahne-Str. 7
31848 Bad Münder/ Germany
Abteilung E

Tel.: + 49 (0) 5042 998 339
Fax: + 49 (0) 5042 998 305
mailto:dennis.herbrich@hytera.de

------------------------------------------------------------
Geschäftsführer / President:  Matthias Klausing,  Sitz der Gesellschaft / 
Company's Place of Business: Bad Muender,  Registereintrag / Commercial 
Register No.  Amtsgericht / Local Court Hannover: HRB  100300, 
Umsatzsteuer-Identifikationsnummer (USt-IdNr.) / VAT Identification No.: 
DE 115 447 987,  Elektro-Altgeräte Register (EAR) / WEEE Register No.: DE 
187 048 87

-- 
ptxdist mailing list
ptxdist@pengutronix.de

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

* Re: [ptxdist] Proper quoting of semicolons in URLs
  2013-02-26  9:20 [ptxdist] Proper quoting of semicolons in URLs Dennis.Herbrich
@ 2013-02-26  9:59 ` Marc Kleine-Budde
  2013-02-26 10:00   ` Marc Kleine-Budde
  2013-02-26 10:13   ` Dennis.Herbrich
  0 siblings, 2 replies; 5+ messages in thread
From: Marc Kleine-Budde @ 2013-02-26  9:59 UTC (permalink / raw)
  To: ptxdist; +Cc: Dennis.Herbrich


[-- Attachment #1.1: Type: text/plain, Size: 2996 bytes --]

On 02/26/2013 10:20 AM, Dennis.Herbrich@hytera.de wrote:
> Good day, everyone!
> 
> When using ptxdist to "get" a package with an URL with semicolons in it, 
> for example a snapshot from a gitweb repo, anything after the first 
> semicolon
> is interpreted as options to wget. Unfortunately I was unable to find a 
> quoting
> style that prevented this while still handing over a usable URL to wget:
> 
> An example for an URL I want to use:
> http://git.xilinx.com/?p=linux-xlnx.git;a=snapshot;h=04d9378881401e71f83b8b4fea0abd71d33b4052;sf=tgz
> 
> I'm using ptxdist 2013.01.90 and copied the original kernel.make to my 
> project
> rules, with a custom KERNEL_URL. I tried these variations, and got the 
> following
> (slightly cleaned) results:
> 
> "Naive":
> KERNEL_URL              := 
> http://git.xilinx.com/?p=linux-xlnx.git;a=snapshot;h=04d9378881401e71f83b8b4fea0abd71d33b4052;sf=tgz
> 
> $ ptxdist-2013.01.90 print KERNEL_URL
> http://git.xilinx.com/?p=linux-xlnx.git;a=snapshot;h=04d9378881401e71f83b8b4fea0abd71d33b4052;sf=tgz
> $ ptxdist-2013.01.90 get kernel
> ptxdist: error: invalid option 'a=snapshot' to ptxd_make_get_http
> 
> 
> "Doublequoting":
> KERNEL_URL              := 
> "http://git.xilinx.com/?p=linux-xlnx.git;a=snapshot;h=04d9378881401e71f83b8b4fea0abd71d33b4052;sf=tgz"
> 
> $ ptxdist-2013.01.90 print KERNEL_URL
> http://git.xilinx.com/?p=linux-xlnx.git
> (This downloads an obviously unwanted HTML index page)
> 
> 
> "Singlequoting":
> KERNEL_URL              := 
> 'http://git.xilinx.com/?p=linux-xlnx.git;a=snapshot;h=04d9378881401e71f83b8b4fea0abd71d33b4052;sf=tgz'
> 
> $ ptxdist-2013.01.90 print KERNEL_URL
> 'http://git.xilinx.com/?p=linux-xlnx.git;a=snapshot;h=04d9378881401e71f83b8b4fea0abd71d33b4052;sf=tgz'
> $ ptxdist-2013.01.90 get kernel
> Could not download package
> URL: 
> 'http://git.xilinx.com/?p=linux-xlnx.git;a=snapshot;h=04d9378881401e71f83b8b4fea0abd71d33b4052;sf=tgz'
> 
> 
> Using backslashes to escape the semicolons does not work, either, same 
> behaviour
> as in "Naive".
> 
> Using urlencoding as in 
> KERNEL_URL              := 
> http://git.xilinx.com/?p=linux-xlnx.git%3Ba=snapshot%3Bh=04d9378881401e71f83b8b4fea0abd71d33b4052%3Bsf=tgz
> would technically work with ptxdist, but gitweb doesn't seem to decode 
> this,
>  and throws a 404, which seems broken by itself. :(
> 
> Does anybody have a suggestion how to quote semicolons in my URL properly,
> lest they are passed literally to wget instead of being split into 
> options?
> Is there some $(call verbatim,FOO) macro, perchance?

What about using %3B instead of ;
http://www.w3schools.com/TAGS/ref_urlencode.asp

Marc

-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |


[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 263 bytes --]

[-- Attachment #2: Type: text/plain, Size: 48 bytes --]

-- 
ptxdist mailing list
ptxdist@pengutronix.de

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

* Re: [ptxdist] Proper quoting of semicolons in URLs
  2013-02-26  9:59 ` Marc Kleine-Budde
@ 2013-02-26 10:00   ` Marc Kleine-Budde
  2013-02-26 10:03     ` Marc Kleine-Budde
  2013-02-26 10:13   ` Dennis.Herbrich
  1 sibling, 1 reply; 5+ messages in thread
From: Marc Kleine-Budde @ 2013-02-26 10:00 UTC (permalink / raw)
  To: ptxdist; +Cc: Dennis.Herbrich


[-- Attachment #1.1: Type: text/plain, Size: 3129 bytes --]

On 02/26/2013 10:59 AM, Marc Kleine-Budde wrote:
> On 02/26/2013 10:20 AM, Dennis.Herbrich@hytera.de wrote:
>> Good day, everyone!
>>
>> When using ptxdist to "get" a package with an URL with semicolons in it, 
>> for example a snapshot from a gitweb repo, anything after the first 
>> semicolon
>> is interpreted as options to wget. Unfortunately I was unable to find a 
>> quoting
>> style that prevented this while still handing over a usable URL to wget:
>>
>> An example for an URL I want to use:
>> http://git.xilinx.com/?p=linux-xlnx.git;a=snapshot;h=04d9378881401e71f83b8b4fea0abd71d33b4052;sf=tgz
>>
>> I'm using ptxdist 2013.01.90 and copied the original kernel.make to my 
>> project
>> rules, with a custom KERNEL_URL. I tried these variations, and got the 
>> following
>> (slightly cleaned) results:
>>
>> "Naive":
>> KERNEL_URL              := 
>> http://git.xilinx.com/?p=linux-xlnx.git;a=snapshot;h=04d9378881401e71f83b8b4fea0abd71d33b4052;sf=tgz
>>
>> $ ptxdist-2013.01.90 print KERNEL_URL
>> http://git.xilinx.com/?p=linux-xlnx.git;a=snapshot;h=04d9378881401e71f83b8b4fea0abd71d33b4052;sf=tgz
>> $ ptxdist-2013.01.90 get kernel
>> ptxdist: error: invalid option 'a=snapshot' to ptxd_make_get_http
>>
>>
>> "Doublequoting":
>> KERNEL_URL              := 
>> "http://git.xilinx.com/?p=linux-xlnx.git;a=snapshot;h=04d9378881401e71f83b8b4fea0abd71d33b4052;sf=tgz"
>>
>> $ ptxdist-2013.01.90 print KERNEL_URL
>> http://git.xilinx.com/?p=linux-xlnx.git
>> (This downloads an obviously unwanted HTML index page)
>>
>>
>> "Singlequoting":
>> KERNEL_URL              := 
>> 'http://git.xilinx.com/?p=linux-xlnx.git;a=snapshot;h=04d9378881401e71f83b8b4fea0abd71d33b4052;sf=tgz'
>>
>> $ ptxdist-2013.01.90 print KERNEL_URL
>> 'http://git.xilinx.com/?p=linux-xlnx.git;a=snapshot;h=04d9378881401e71f83b8b4fea0abd71d33b4052;sf=tgz'
>> $ ptxdist-2013.01.90 get kernel
>> Could not download package
>> URL: 
>> 'http://git.xilinx.com/?p=linux-xlnx.git;a=snapshot;h=04d9378881401e71f83b8b4fea0abd71d33b4052;sf=tgz'
>>
>>
>> Using backslashes to escape the semicolons does not work, either, same 
>> behaviour
>> as in "Naive".
>>
>> Using urlencoding as in 
>> KERNEL_URL              := 
>> http://git.xilinx.com/?p=linux-xlnx.git%3Ba=snapshot%3Bh=04d9378881401e71f83b8b4fea0abd71d33b4052%3Bsf=tgz
>> would technically work with ptxdist, but gitweb doesn't seem to decode 
>> this,
>>  and throws a 404, which seems broken by itself. :(
>>
>> Does anybody have a suggestion how to quote semicolons in my URL properly,
>> lest they are passed literally to wget instead of being split into 
>> options?
>> Is there some $(call verbatim,FOO) macro, perchance?
> 
> What about using %3B instead of ;
> http://www.w3schools.com/TAGS/ref_urlencode.asp

Doh - you tried already.

Marc
-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |


[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 263 bytes --]

[-- Attachment #2: Type: text/plain, Size: 48 bytes --]

-- 
ptxdist mailing list
ptxdist@pengutronix.de

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

* Re: [ptxdist] Proper quoting of semicolons in URLs
  2013-02-26 10:00   ` Marc Kleine-Budde
@ 2013-02-26 10:03     ` Marc Kleine-Budde
  0 siblings, 0 replies; 5+ messages in thread
From: Marc Kleine-Budde @ 2013-02-26 10:03 UTC (permalink / raw)
  To: ptxdist; +Cc: Dennis.Herbrich


[-- Attachment #1.1: Type: text/plain, Size: 620 bytes --]

On 02/26/2013 11:00 AM, Marc Kleine-Budde wrote:
>>> Does anybody have a suggestion how to quote semicolons in my URL properly,
>>> lest they are passed literally to wget instead of being split into 
>>> options?

We could change the option parser not to bail out if there is an unknown
option and not modify the URL in that case.

Mar
-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |


[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 263 bytes --]

[-- Attachment #2: Type: text/plain, Size: 48 bytes --]

-- 
ptxdist mailing list
ptxdist@pengutronix.de

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

* Re: [ptxdist] Proper quoting of semicolons in URLs
  2013-02-26  9:59 ` Marc Kleine-Budde
  2013-02-26 10:00   ` Marc Kleine-Budde
@ 2013-02-26 10:13   ` Dennis.Herbrich
  1 sibling, 0 replies; 5+ messages in thread
From: Dennis.Herbrich @ 2013-02-26 10:13 UTC (permalink / raw)
  To: ptxdist; +Cc: mkl

Hello again!

Shortly after my inquiry, I followed a hunch and changed the semicolons
to ampersands, as common for GET query strings, and it seems that gitweb
actually accepts this just fine, too.

This does not fix the issue itself, but is at least a workaround for 
gitweb URLs.

Thanks again for your consideration,
Dennis Herbrich

Hytera Mobilfunk GmbH
Fritz-Hahne-Str. 7
31848 Bad Münder/ Germany
Abteilung E

Tel.: + 49 (0) 5042 998 339
Fax: + 49 (0) 5042 998 305
mailto:dennis.herbrich@hytera.de

------------------------------------------------------------
Geschäftsführer / President:  Matthias Klausing,  Sitz der Gesellschaft / 
Company's Place of Business: Bad Muender,  Registereintrag / Commercial 
Register No.  Amtsgericht / Local Court Hannover: HRB  100300, 
Umsatzsteuer-Identifikationsnummer (USt-IdNr.) / VAT Identification No.: 
DE 115 447 987,  Elektro-Altgeräte Register (EAR) / WEEE Register No.: DE 
187 048 87

-- 
ptxdist mailing list
ptxdist@pengutronix.de

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

end of thread, other threads:[~2013-02-26 10:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-26  9:20 [ptxdist] Proper quoting of semicolons in URLs Dennis.Herbrich
2013-02-26  9:59 ` Marc Kleine-Budde
2013-02-26 10:00   ` Marc Kleine-Budde
2013-02-26 10:03     ` Marc Kleine-Budde
2013-02-26 10:13   ` Dennis.Herbrich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox