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

Re: Writing a Spacewalk plugin for Apt-Get

On Wed, Feb 16, 2011 at 01:26:35PM +0100, Šimon Lukašík wrote:
> Hello Apt-Get List,
Hi Šimon,
> Basically, each time the libapt is going to read
> /etc/apt/sources.list.d/spacewalk.list, I would like my code to update
> the information there. To reflect currently authorized channels. For
> instance:
>   - deb spacewalk://fqdn channels: main foobar
>   + deb spacewalk://fqdn channels: main bar foo xxx
> For this, I would like to introduce a new hook (similar to
> DPKg::*-Invoke) to libapt code. And then configure spacewalk-plugin to
> benefit from it.
> But I would a appreciate any suggestions or comments from apt-get
> upstream first. Please, can you see any other option then introducing a
> new hook to apt?

The sources.list is read a lot and often by non-root processes (that
just check the status of the system like update-notifier). So hooking
into that sounds not like the ideal solution. The next problem with
that is that when you add "bar foo xxx" apt will have no package
information for those, so you will have to apt-get update (see below).

Would simply using APT::Update::Pre-Invoke help? To only refresh the
sources.list entries when the info is actually refreshed?


Reply to: