Bug 965131

Summary: [rfe] substituting $vars in mirrorlists
Product: [Fedora] Fedora Reporter: Ales Kozumplik <akozumpl>
Component: librepoAssignee: Tomas Mlcoch <tmlcoch>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 19CC: jzeleny, rhughes, tmlcoch
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libsolv-0.3.0-5.git228d412.fc19 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-07-01 01:36:54 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 964584    

Description Ales Kozumplik 2013-05-20 13:32:56 UTC
It looks besides substituting variables in mirrorlist URLS and baseurls, Yum is able do $basearch and $releasever substitutions in the mirrorlists itself, e.g when one downloads mirrorlist containing the following entries:

http://mirror.unl.edu/kde-redhat/fedora/$releasever/$basearch/stable
http://ftp.heanet.ie/pub/kde-redhat/fedora/$releasever/$basearch/stable
http://apt.kde-redhat.org/apt/kde-redhat/fedora/$releasever/$basearch/stable
http://kdeforge.unl.edu/apt/kde-redhat/fedora/$releasever/$basearch/stable
http://kdeforge2.unl.edu/kde-redhat/fedora/$releasever/$basearch/stable

It replaces all $releasever and $basearch with proper string before issuing a HTTP request to one of the mirrors.

Several approaches toward implementing this in librepo can be considers of which, I'd like to point out, a callback mechanism seems the least practical to me. Perhaps passing the handler list of substitutions beforehand?

Comment 1 Tomas Mlcoch 2013-05-23 13:43:54 UTC
Fixed in https://github.com/Tojaj/librepo/commit/a97530214cc39f1a63f51ca76baa9a8640d03bfb

Add option LRO_VARSUB.

Example of usage:

h = librepo.Handle()
h.varsub = [("releasever", "18"), ("basearch", "i386")]

Comment 2 Richard Hughes 2013-06-12 08:53:31 UTC
Looks good. Tomas, could you roll a new release with this functionality included into Fedora rawhide please. librepo isn't really usable without LRO_VARSUB unless you like butchering your .repo files with sed :).

Comment 3 Tomas Mlcoch 2013-06-12 11:59:45 UTC
Hi, new build is done (http://koji.fedoraproject.org/koji/buildinfo?buildID=426150).

Comment 4 Fedora Update System 2013-06-24 12:22:42 UTC
libsolv-0.3.0-5.git228d412.fc19, librepo-0.0.4-2.fc19, hawkey-0.3.14-1.git78b3aa0.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/librepo-0.0.4-2.fc19,hawkey-0.3.14-1.git78b3aa0.fc19,libsolv-0.3.0-5.git228d412.fc19

Comment 5 Fedora Update System 2013-06-24 18:49:45 UTC
Package libsolv-0.3.0-5.git228d412.fc19, librepo-0.0.4-2.fc19, hawkey-0.3.14-1.git78b3aa0.fc19, dnf-0.3.8-2.git85524ae.fc19:
* should fix your issue,
* was pushed to the Fedora 19 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing libsolv-0.3.0-5.git228d412.fc19 librepo-0.0.4-2.fc19 hawkey-0.3.14-1.git78b3aa0.fc19 dnf-0.3.8-2.git85524ae.fc19'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-11602/libsolv-0.3.0-5.git228d412.fc19,dnf-0.3.8-2.git85524ae.fc19,hawkey-0.3.14-1.git78b3aa0.fc19,librepo-0.0.4-2.fc19
then log in and leave karma (feedback).

Comment 6 Fedora Update System 2013-07-01 01:36:54 UTC
libsolv-0.3.0-5.git228d412.fc19, librepo-0.0.4-2.fc19, hawkey-0.3.14-1.git78b3aa0.fc19, dnf-0.3.8-2.git85524ae.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.