Bug 950407 - 'fetchmirrors' feature prevents unified handling of local and remote handles
Summary: 'fetchmirrors' feature prevents unified handling of local and remote handles
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: librepo
Version: 19
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Tomas Mlcoch
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-04-10 08:24 UTC by Ales Kozumplik
Modified: 2014-09-30 23:41 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-07-17 11:48:35 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Ales Kozumplik 2013-04-10 08:24:39 UTC
'fetchmirrors' allows downloading only the mirrorlists via peform() as was requested, but unfortunately its behavior intorduces new issues:

a) for remote repo, doing handle.perform() always fills in handle.mirrors
b) for local repo, doing handle.perform() doesn't fill in handle.mirrors

that means to obtain the mirrors list one has to treat the local and the remote handle in a different manner and add extra call to:

  handle.fetchmirrors = True
  handle.perform()

to the local handle. This is not what the feature was meant for, there is no reason not to fill in the mirror list when we are contacting the provider anyway, especially for a local handle. I suggest changing the semantics to:

- handle.mirrors is guaranteed to be non-None after any perform()
- if fetchmirrors is True ignore LRO_YUMDLIST and only download the mirrorlist.

There are no serious reasons not to always fill in handle.mirrors, especially for a local repo.

Comment 1 Tomas Mlcoch 2013-04-18 12:21:41 UTC
Hi, behavior changed:
https://github.com/Tojaj/librepo/commit/88c90e3935cd85a17b46bd414e588a62f8b9fceb

Few notes:
- handle.mirrors will be filled with content of mirrorlist specified by LRO_MIRRORLIST.
- in case of local repository which contains a mirrorlist file, handle.mirrors will be filled with content of the file.
- in case of local repository with mirrorlist file and LRO_MIRRORLIST option specified then handle.mirrors will contain mirrors from LRO_MIRRORLIST
- in other cases like: 
  - only LRO_URL for a remote repo is used
  - only LRO_URL for a local repo that doesn't have a mirrorlist stored
  handle.mirrors will be empty.


Note You need to log in before you can comment on or make changes to this bug.