[PATCH consfigurator] APT properties: cache packages installed or removed this deployment

Sean Whitton spwhitton at spwhitton.name
Sun Nov 20 18:18:35 GMT 2022


Hello,

On Sun 20 Nov 2022 at 08:53AM -04, David Bremner wrote:

> I have finally got around to testing v3 of your patch on my hosts where
> the build-dep property is used. No ill effects were detected.

Ah, great, thanks for testing.

>> The caching is only to avoid running commands that we don't have to run.
>> If it fails such that commands which we didn't have to run get run, then
>> no harm is done.  There'd only be a problem if we didn't run a command
>> that we in fact needed to run.
>>
>> Your build-dep thing installs a series of packages.  Suppose one is foo.
>> Then if we have
>>
>>     (apt:removed "foo")
>>     (bremner)
>>     (apt:removed "foo")
>>
>> the second APT:REMOVED would do nothing, even though it was meant to.
>>
>> Is there a sequence like this which could actually be a problem?
>
> If foo is installed by the build-dep, then the second apt:removed does
> nothing, as you say, but foo remains installed. So if foo was removed so
> as not to conflict with some other package "bar", then a following
> (apt:installed "bar") would fail, somewhat surprisingly. This is fixable
> with your new cache invalidation function, but

Right.  The only question is whether it's realistic for something like
this to happen.  If we're not sure, we can just assume that it could
happen.

> 1) I still think the commentary "in a way that is significant to the
> deployment" is a bit vague (maybe unavoidably?)

Fair.  How is "in a way that could invalidate the assumptions made by
implementations of properties subsequently to be applied"?

> 2) It might be nice to have a function/macro apt:get (or some other
> name) that invalidates the cache, and document that as the way to run
> arbitary apt-get commands. That could be a future enhancement,

I think that this might be useful only for 'apt-get build-dep', and
ideally we will add a property for that subcommand at some point?  I
can't see any other apt-get(8) subcommands for which it might be useful
that aren't already covered by properties.  The manual manipulation of
the set of installed packages that I was envisaging was custom
properties that invoke dpkg commands and/or manually manipulate its
database.

-- 
Sean Whitton



More information about the sgo-software-discuss mailing list