// Keeps q4os-updater's own dynamic Origins-Pattern drop-in
// (54unattended-upgrades-q4os-dynamic-origins) current with whatever
// repositories are actually configured, so a repository added after
// "Fully unattended updates" was first enabled still gets
// unattended-upgrades coverage - matching what the interactive updater
// already does for any configured repo. Safe to have installed
// unconditionally: qunattended-ctl's own refresh-origins action no-ops
// unless the master toggle is currently on.
//
// The "test -x ... || true" wrapper is load-bearing, not defensive
// boilerplate: apt aborts the entire run with "E: Problem executing
// scripts APT::Update::Post-Invoke-Success ... E: Sub-process returned
// an error code" as soon as a hook exits non-zero, which breaks every
// "apt update" AND Discover/Software Centre refresh on the system. This
// file is a CONFFILE, so it survives "apt remove q4os-updater-common"
// (which deletes /usr/lib/q4os/qunattended-ctl) and would otherwise
// leave apt permanently broken until a purge - the hook has to tolerate
// its own script being absent, and any failure inside it. See forum
// topic #6289.
APT::Update::Post-Invoke-Success {"test -x /usr/lib/q4os/qunattended-ctl && /usr/lib/q4os/qunattended-ctl refresh-origins || true";};
