Re: Writing a Spacewalk plugin for Apt-Get
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
> This could be fixed in the code by moving the sources.list reading
> after the hook.
Yep, that sounds good. I'll try it in a lab and report back. I still
have to understand apt code better.
> I don't know enough about your project to know if that
> is helpful or not, just wanted to mention it.
It is helpful. I will follow with more info about my usecase, to make
things clear, maybe I am missing something foundational.
Very basic user story: As admin of Spacewalk, I add or remove repository
to the system(s). And this change propagates from Spacewalk server to
debian client(s) with next installation/update of packages.
It could be achieved in multiple ways:
(1) I've chosen to dynamically modify sources.list by some '*-Invoke'
hook in libapt. But it might be considered ugly, because sources.list is
mean to be rather static file, modified mainly by local admin.
(2) Another possibility I can see is to modify acquire-method to
download all available Pacakages.gz and return only one to apt-get.
But it might be even worse case. User will never see from what
repository his packages come from. And user will cannot do a pining,
between Spacewalk repositories.
(3) Do some bigger changes to Apt to support dynamic repositories
provided by single sources.list line.
I wonder If someone can see more options here.
Thanks for Your ideas,