Base URL handling

Florian Weimer <[email protected]> Mon, 04 Mar 2013 12:26:58 +0100
Newsgroups gmane.linux.rpm.yum
Message-ID <[email protected]>
repomd.xml and primary.xml contain relative URLs.  It appears that yum 
even recognizes the xml:base attribute on <location> elements.  However, 
the relative URL resolution does not seem to follow RFC 3986, Section 
5.2 <http://tools.ietf.org/html/rfc3986#section-5.2>.  For example, I've 
got a repository which specifies this:

     <location xml:base="http://download.example.com/root" 
href="packages/example-0.1-1.x86_64.rpm"/>

My reading of RFC 3986 suggests that the combined URL should be:

http://download.example.com/packages/example-0.1-1.x86_64.rpm

However, the expected URL (from the server directory layout and the fact 
that yum can download the RPM) appears to be:

http://download.example.com/root/packages/example-0.1-1.x86_64.rpm

That is, a relative reference does not replace the document part of the 
path (as it does in web browsers).

Is there a high-level description of how yum combines URLs?  Any 
suggestions for approximating that?

-- 
Florian Weimer / Red Hat Product Security Team