[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Writing a Spacewalk plugin for Apt-Get



On 02/20/2011 02:27 PM, Šimon Lukašík wrote:
> On 02/17/2011 04:57 PM, Michael Vogt wrote:
>> On Thu, Feb 17, 2011 at 04:45:08PM +0100, Šimon Lukašík wrote:
>> [..]
>>> APT::Update::Pre-Invoke cannot be used.
>>>
>>> This hook is called before the update action, but after the sources.list
>>> is processed. This would only force people to run `apt-get update` twice
>>> in row. So this solution would not work smooth with other programs using
>>> libapt.
>>
>> This could be fixed in the code by moving the sources.list reading
>> after the hook. I don't know enough about your project to know if that
>> is helpful or not, just wanted to mention it.
>>
>> Cheers,
>>  Michael
>>  
> 
> Hello Michael,
> 
> I have prepared patch for this.
> 
> Basically, I introduced a new boolean option. If the option is set
> source.list will be re-read after APT::Update::Pre-Invoke and before
> acquiring.
> 
> Since I must not break api, there is a few glitches:
> (1) It changes behavior of APT::Update::Pre-Invoke. Previously it was
> not run, when sources.list was empty.
> (2) Now, It can change content of 'List' reference. On the other hand
> parameter is not const.
> (3) It assumes that 'List' parameter presents the whole sources.list.
> Which may not be always true.
> 
> Anyway, I tested common apt frontends and it worked well. It's certainly
> far more better than modifing pkgSourceList, which is issued quite often.
> 
> Could You please review/comment?
> 
> Many thanks,
> Šimon

Hello List,

Do you have any comments? I would really appreciate if somebody can
review the patch.

Thank you in advance,
Šimon


Reply to: