Cache the complete snapshot-name listing once per hook invocation instead\nof querying ZFS separately for every dataset and counter candidate. This\nremoves the repeated full-pool scan that becomes expensive when recursive\nsnapshot histories are large.\n\nCache the operation suffix as well and return an explicit success status\nfrom snapshot-name generation so collision retries are unambiguous. Ignore\nAPT configuration-only records because they do not represent package data\nchanges requiring a new pre-install snapshot.
Parse the APT package action protocol and classify records by operation.
Use the package list to determine important and trivial snapshot chains,
then generate collision-resistant names containing shortened package data.
Select ZFS datasets through the configured property or explicit roots.
Create recursive snapshots atomically, support dry-run output, and prune
old snapshots from the matching retention chain after success.
Preserve the original warning-oriented behavior by reporting snapshot and
retention failures without aborting the package operation.