Sunil Mohan Adapa 1d4e9eacff
packages: Don't run force upgrade hooks when freedombox perform ops
- We have a hook that triggers when 'apt update' is successfully run. This hook
handles the force upgrading mechanism. It's intended purpose is to handle
packages with configuration file prompts that unattended-upgrades does not
touch. 'apt update' is run on behalf of unattended-upgrades every day on a
schedule. This is the primary time the hook is intended to run. However, the
hook also run every time FreedomBox runs 'apt update' before installing an app.
Also no operations are performed, there is a race to see of apt is available for
the operation.

- Avoid these unnecessary runs by setting an environmental variable and by
checking it before running the trigger.

- There is one place where we want to genuinely run the trigger. That is after a
distribution upgrade. Handle this case.

Tests:

- When apt update is run on the command line, the hook is triggered.

- When installing an app, however, the hook is not triggered.

- During a dist-upgrade, the hook is triggered at the end.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2025-04-04 21:34:36 -04:00
..