YUM repo fails with koji/mock when base URL is used

Recently I started playing around with Koji for package building.

Everything was set-up pretty fast... but the first attempts to build a build-root failed...

After some troubleshooting I found the cause...

If you use the repo-data as available on an installation ISO (served via a webserver) and use mergerepos the location of an RPM will look like:

<location xml:base="CentOS" href="pam-"/>

The entry as available on the ISO is:

<location xml:base="media://1330913492.861127#1" href="CentOS/pam-"/>

The way to workaround this issue, is be recreated the repodata using createrepo:

# createrepo -u ${WEBSERVERPATH}/new-repo/ /media/cd/

And then the entry will look like:

<location xml:base="" href="pam-"/>

The bug can be found in bugzilla.