Discussion:
URL-encoded hrefs
Ash Charles
2013-03-04 18:11:29 UTC
Permalink
Hi,

I have an RPM repository that includes packages with characters in the
file name that shouldn't be used in a URL e.g. the '+' in
libjpeg8-8d+1.2.1-r2.armv7a_vfp_neon.rpm. I'm hosting the repository
on web space (specifically Amazon S3) that urlencodes any forbidden
characters so the URL I (and zypper) expect

http://package-cache.gumstix.org/armv7a_vfp_neon/libjpeg8-8d+1.2.1-r2.armv7a_vfp_neon.rpm

doesn't work because of the '+' sign. The actual URL turns out to be

http://package-cache.gumstix.org/armv7a_vfp_neon/libjpeg8-8d%2B1.2.1-r2.armv7a_vfp_neon.rpm

Is there a flag or setting for createrepo that allows it to generate
urlencoded hrefs? If not, would the project be open to a patch that
made this option available?

Thanks,
Ash
James Antill
2013-03-04 22:09:18 UTC
Permalink
Post by Ash Charles
Hi,
I have an RPM repository that includes packages with characters in the
file name that shouldn't be used in a URL e.g. the '+' in
libjpeg8-8d+1.2.1-r2.armv7a_vfp_neon.rpm. I'm hosting the repository
on web space (specifically Amazon S3) that urlencodes any forbidden
characters so the URL I (and zypper) expect
http://package-cache.gumstix.org/armv7a_vfp_neon/libjpeg8-8d+1.2.1-r2.armv7a_vfp_neon.rpm
doesn't work because of the '+' sign. The actual URL turns out to be
http://package-cache.gumstix.org/armv7a_vfp_neon/libjpeg8-8d%2B1.2.1-r2.armv7a_vfp_neon.rpm
Is there a flag or setting for createrepo that allows it to generate
urlencoded hrefs? If not, would the project be open to a patch that
made this option available?
What version are you using?
The current upstream createrepo uses yum which does call to_xml(blah,
attrib=True) in all code paths, that I can see.
Ville Skyttä
2013-03-05 19:39:04 UTC
Permalink
Post by James Antill
Post by Ash Charles
Is there a flag or setting for createrepo that allows it to generate
urlencoded hrefs? If not, would the project be open to a patch that
made this option available?
What version are you using?
The current upstream createrepo uses yum which does call to_xml(blah,
attrib=True) in all code paths, that I can see.
But that's XML encoding, while the OP is asking about URL encoding.
Which IMO should Just Happen properly if it already doesn't (haven't
checked) without any configuration options - if there's a + in a
filename, it needs to be encoded as %2B in a URL.
Ash Charles
2013-03-06 01:14:00 UTC
Permalink
Thanks for the replies.

I'm using version 0.4.9. Or rather,
$ createrepo -V
0.4.9
$ dpkg -s createrepo
...
Version: 0.4.11-1.1
...

Should I be using the latest dev. version?

--Ash
Post by Ash Charles
Hi,
I have an RPM repository that includes packages with characters in the
file name that shouldn't be used in a URL e.g. the '+' in
libjpeg8-8d+1.2.1-r2.armv7a_vfp_neon.rpm. I'm hosting the repository
on web space (specifically Amazon S3) that urlencodes any forbidden
characters so the URL I (and zypper) expect
http://package-cache.gumstix.org/armv7a_vfp_neon/libjpeg8-8d+1.2.1-r2.armv7a_vfp_neon.rpm
doesn't work because of the '+' sign. The actual URL turns out to be
http://package-cache.gumstix.org/armv7a_vfp_neon/libjpeg8-8d%2B1.2.1-r2.armv7a_vfp_neon.rpm
Is there a flag or setting for createrepo that allows it to generate
urlencoded hrefs? If not, would the project be open to a patch that
made this option available?
Thanks,
Ash
Loading...