feat(script): Print warning and exit gracefully if snapshot name would be too long (#1)

This commit is contained in:
hygienic-books 2023-03-06 02:04:37 +01:00
parent f8592c215a
commit 7747e9bdc3

View File

@ -160,6 +160,10 @@ function find_max_dataset_name_length () {
max_dataset_name_length="${#dataset_name_no_pkgs}" max_dataset_name_length="${#dataset_name_no_pkgs}"
fi fi
done done
if [[ "${max_dataset_name_length}" -gt "${max_zfs_snapshot_name_length}" ]]; then
pprint 'warn' 'Snapshot name would exceed ZFS '"${max_zfs_snapshot_name_length}"' chars limit. Skipping snapshots ...' '0'
fi
} }
function main () { function main () {