[Yum-devel] [Patch 2/4] Defining other repository types in yum

James Bowes jbowes at redhat.com
Wed Apr 12 18:52:14 UTC 2006


seth vidal wrote:
> On Mon, 2006-03-20 at 15:36 -0500, James Bowes wrote:
>> Patch Contents:
>>
>> Repository related changes, incorporating the PackageSack/MetaSack changes.
>>
>>   * RepoStorage - use the MetaSack for storing packages/PackageSacks
>>     + repoMD specific setup code moved from populateSack to the
>>       YumPackageSack
>>   * Repository - abstract base class for rpm repositories.
>>     + replace 'get' with 'getPackage' and 'getHeader' for a more abstract
>>       interface.
>       Why not just add getPackage and getHeader while keeping the
> generic get w/o making it private or is this so one can leave getPackage
> and getHeader in place and just replace __get() in another repo-type?
> 

In our work, we found repository.get() to be very tied to the underlying 
urlgrabber-based implementation (mainly due to the byte ranges).

There were only two cases when get() was used, either to download a full 
RPM or just the header. By making two separate methods, the details of 
byte ranges can be hidden inside the Repository.

Also, classes implementing the Repository interface that get their 
header information from elsewhere can do so easily ;)

> 
>>     + add setup() and isReady() methods, rather than poking directly in
>>       the class
>>     + replace many repo.foo = bar with setter methods.
> 
> What do we get from that? Why not use properties - it looks prettier and
> gets us the same result?
> 
> I noticed isEnabled() seems a bit clunky. Why not properties to clean it
> up and abstract it?

I'll have to use ignorance as a defense for the properties thing; I had 
never seen the property builtin function before last night. Anyhoo, I 
love it, so I'll probably get working on a patch that replaces the 
getters and setters with properties.

-James




More information about the Yum-devel mailing list