Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 339051 - PMS should require PM to encode URLs listed in SRC_URI before fetching
Summary: PMS should require PM to encode URLs listed in SRC_URI before fetching
Status: CONFIRMED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: PMS/EAPI (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: PMS/EAPI
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 339027
  Show dependency tree
 
Reported: 2010-09-28 17:48 UTC by SpanKY
Modified: 2010-09-28 19:48 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description SpanKY gentoo-dev 2010-09-28 17:48:41 UTC
a PM should transparently encode URIs listed in SRC_URI to conform to RFC 1738 before fetching it

for example, openssl uses:
http://cvs.pld-linux.org/foo/${PN}-c_rehash.sh?rev=1.7

the PM should rewrite the "?" to "%3f" before fetching it.  some http servers are unable to locate the file if given the "?" but work fine with "%3f".

wget should be able to care of undoing the encoding when writing it out to disk, so i dont think the PM needs to handle that explicitly ...
Comment 1 Marco Leogrande 2010-09-28 18:07:25 UTC
(from my personal, user experience in bug 339027)

I don't want to sound picky, but I do not think that the URL encoding is the correct way to go here.

The base assumption (derived from the HTTP way of working) is that the characters after the '?' are not part of the filename, but instead are parameters that are used someway (at the application level) to choose the right file, or to format it in a readable way, or whatever. And this is what CVSweb does, by letting you choose the file revision with the "version=" parameter. Enconding the question mark character may lead to funny results: try these two commands.

wget 'http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/dev-libs/openssl/openssl-1.0.0a-r3.ebuild?revision=1.7'
wget 'http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/dev-libs/openssl/openssl-1.0.0a-r3.ebuild%3frevision=1.7'

While the first completes successfully (returning the desired version of the file requested), the second one fails with a 404. IMO, this makes sense, as the file "openssl-1.0.0a-r3.ebuild%3frevision=1.7" does not exist at all in the repository.

I do not know what is the correct solution, but I believe that the encoding is wrong. Free to correct me in the following, I do not know anything about Portage file inclusion policies.
I am not a Gentoo developer/mantainer/whatever (apart user :)), but I feel that having a SRC_URI formatted as "http://foo/file?param => file-param", or the file in FILESDIR, would be better.
The first solution would have the advantage of working correctly both with the upstream CVS (the correct file would be fetched) and with Portage distfiles repositories (the file would be stored among distfiles in a unambiguous way). The second solution is maybe even simpler, but increases Portage tree size and mainteinance overhead (?).
Comment 2 SpanKY gentoo-dev 2010-09-28 19:48:21 UTC
true, brain fart that i missed that.  as long as the file that gets mirrored is the renamed one, then i guess we should ban usage of "?" that lacks a rename.

moving things to FILESDIR in specific ebuilds ignores the underlying problem.