refactor(docs): Explain ZFS snapshot name max length (#1)

This commit is contained in:
hygienic-books 2023-12-25 22:30:16 +01:00
parent e3f6316c47
commit 47885efbab
2 changed files with 5 additions and 2 deletions

View File

@ -101,6 +101,8 @@ zpool/root/archlinux@pacman_2023-03-07-0114_op:inst_sev:trv
zpool/root/archlinux@pacman_2023-03-07-0115_op:upgr_sev:trv zpool/root/archlinux@pacman_2023-03-07-0115_op:upgr_sev:trv
``` ```
Whatever you set as your `pkgs_list_max_length` is still just a best effort as it is subject to ZFS' internal maximum for dataset name length. This limit is currently 255 characters. For a snapshot this is counted against the dataset name in front of the `@` character plus everything else starting with the `@` character til the end. If you'd like e.g. 200 characters allocated to the package list chances are that you'll see fewer characters than that depending on how long your dataset names are on their own.
Have a look at `pacman-zfs-snapshot.conf` as well, its comments should be clear enough to get you going. Have a look at `pacman-zfs-snapshot.conf` as well, its comments should be clear enough to get you going.
# Rollback # Rollback

View File

@ -202,8 +202,9 @@ function trim_pkg_list_oneline () {
local available_pkg_list_length local available_pkg_list_length
available_pkg_list_length="$((${max_zfs_snapshot_name_length} - ${max_dataset_name_length}))" available_pkg_list_length="$((${max_zfs_snapshot_name_length} - ${max_dataset_name_length}))"
if [[ "${available_pkg_list_length}" -lt "${pkgs_list_max_length}" ]]; then if [[ "${available_pkg_list_length}" -lt "${pkgs_list_max_length}" ]]; then
# If we have fewer characters available than the user wants limit # If we have fewer characters available before hitting the
# package list length # ZFS internal maximum snapshot name length than the user
# wants limit package list length.
pkgs_list_max_length="${available_pkg_list_length}" pkgs_list_max_length="${available_pkg_list_length}"
fi fi