Hi zypp devels, especially Duncan, Marius, Jiri, I think that you are probably very busy with release of openSUSE 11.0. Maybe you have a few minutes nevertheless to share some insight. These questions block Gerards work. With the complexity of libzypps media handling, it seems difficult to proceed in the best direction, without your help. Your advice would be very much appreciated. On Tue, May 20, 2008 at 05:44:39PM +0200, Gerard Farràs i Ballabriga wrote:
Hello, good afternoon :-)
There are some new ideas and changes about implementation details of the concept of failover [1].
Before, our idea was to modify MediaCurl class [2] to parse a list of mirrors like this [3].
But now, new idea is to use only metalink files ([4] [5]) and don't use anymore this type of mirror lists.
Libzypp could download files using an external program (ej. aria2c [6]) to avoid having to implement all the logic from zero.
I implemented a proof-of-concept in Yum in 20 minutes (and less than 10 changed lines). Instead of calling python-urlgrabber, I called aria2c for fetching files (putting them into the cache), and it works fine to implement part 1 and part 3 of http://en.opensuse.org/Libzypp/Failover. In libzypp, it seems to be much more complicated. Our question is: How can we easily add a new handler (fetching files with an external program) with as few intrusion into libzypp's media handling as possible? Is there a central place where one could hook into? It would be great if it is possible to use e.g. aria2c as external downloader, which already implements nearly everything that we need. It meanwhile seems to me that implementing more stuff in libzypp will not only reinvent the wheel in many regards but also increase the media handling's complexity even further. An underlying assumption that I have is that there always is some kind of package caching directory where files are downloaded (and used later), so it wouldn't matter if the files are put there by libcurl or by the external process. Is this assumption correct?
Why this change?
- Because we think than we are reinventing the wheel in things like:
* Parse HTTP codes and act according to these. * To choose the fastest mirror.
How to implement?
I think we can do the implementation with some changes:
- Modify media/MediaAccess.cc [7] and check if there are available tools like aria2c in the target system. - If we get a negative response we must use MediaCurl (like now). - If we get a positive response we can use a "new" class called MediaArise (or something like this) which uses aria2c to download files using Medialink from network.
What do you think about this idea? Any comments for this implementation? Dr. Poeml, please, feel free to correct me if there are any error.
Obviously, any suggestion or comment will be more than welcome :-).
Thanks :-)
Gerard
[1] http://en.opensuse.org/Libzypp/Failover [2] http://svn.opensuse.org/svn/zypp/trunk/libzypp/zypp/media/MediaCurl.h [3] http://download.opensuse.org/distribution/10.3/repo/oss/suse/repodata/primar... [4] http://www.metalinker.org/ [5] http://download.opensuse.org/distribution/10.3/repo/oss/suse/repodata/primar... [6] http://aria2.sourceforge.net/ [7] http://svn.opensuse.org/svn/zypp/trunk/libzypp/zypp/media/MediaAccess.cc
Thank you for your comments! Peter -- "WARNING: This bug is visible to non-employees. Please be respectful!" SUSE LINUX Products GmbH Research & Development