Subject: Re: bug#64106: `modify-services` no longer affects multiple instances of the same service

From: Brian Cully <[email-masked]>
Date: Wed, 21 Jun 2023 14:10:06 -0400

Ludovic Courtès <[email-masked]> writes:

> It wasn’t really intended, more a side effect of the implementation, and
> I agree it should be fixed.

There have been a number of complaints about the behavior change, and I
think the patch should probably be reverted. My only intention was to
raise an error for the cases where a service was used in
‘modify-services’ that wasn't defined, as that's something people would
probably want to know about and fix, but the sequelae to that change
have changed the primary behavior of ‘modify-services’ in a disruptive
way (and without a corresponding news item).

I've taken a number of stabs at tweaking the current code to satisfy
both my desire to raise an error for mis-configurations as well as match
every instance of a service, but I can't find a way to do it that also
preserves service ordering.

However, if ‘modify-services’ can be changed to do two passes, the first
as a sanity check which verifies service references and raises errors,
and the second to do the actual modification, that should work well. I'm
not concerned with efficiency particularly. Unless there are many
thousands of services I sincerely doubt anyone would notice the extra
pass, even on a Raspberry Pi.

WDYT?

-bjc