Treat special characters in pkg names in pkgs_list_max_length correctly #3

Open
opened 2024-07-18 16:57:37 +00:00 by hygienic-books · 3 comments

Until and including commit hash 7ea829a if a package contains characters that are invalid for ZFS dataset names such as extra/libc++ with its plus-plus characters (++) we will not be able to create a snapshot. Reference Arch Wiki's Arch Package Guidelines and treat special characters correctly to always allow creation of a ZFS snapshot.

Until and including commit hash 7ea829a if a package contains characters that are invalid for ZFS dataset names such as [extra/libc++](https://archlinux.org/packages/extra/x86_64/libc++/) with its plus-plus characters (`++`) we will not be able to create a snapshot. Reference [Arch Wiki's Arch Package Guidelines](https://wiki.archlinux.org/title/Arch_package_guidelines) and treat special characters correctly to always allow creation of a ZFS snapshot.
Author
Owner

Arch Wiki's Arch Package Guidelines says:

Package names can contain only alphanumeric characters and any of @, ., _, +, -. Names are not allowed to start with hyphens or dots. All letters should be lowercase.

[Arch Wiki's Arch Package Guidelines](https://wiki.archlinux.org/title/Arch_package_guidelines) says: > Package names can contain only alphanumeric characters and any of `@`, `.`, `_`, `+`, `-`. Names are not allowed to start with hyphens or dots. All letters should be lowercase.
Author
Owner

ZFS Component Naming Requirements in Oracle Solaris ZFS Administration Guide says:

Each ZFS component, such as datasets and pools, must be named according to the following rules:

  • Each component can only contain alphanumeric characters in addition to the following four special characters:
    • Underscore (_)
    • Hyphen (-)
    • Colon (:)
    • Period (.)
  • ...

In package names we need to treat specially because not allowed to show up in a ZFS dataset name:

  • At (@)
  • Plus (+)

In package names we can ignore:

  • Dot (.)
  • Underscore (_)
  • Dash (-)
[ZFS Component Naming Requirements in Oracle Solaris ZFS Administration Guide](https://docs.oracle.com/cd/E26505_01/html/E37384/gbcpt.html) says: > Each ZFS component, such as datasets and pools, must be named according to the following rules: > - Each component can only contain alphanumeric characters in addition to the following four special characters: > - Underscore (`_`) > - Hyphen (`-`) > - Colon (`:`) > - Period (`.`) > - ... In package names we need to treat specially because not allowed to show up in a ZFS dataset name: - At (`@`) - Plus (`+`) In package names we can ignore: - Dot (`.`) - Underscore (`_`) - Dash (`-`)
Author
Owner

Taking extra/libc++ some options are:

libc         (cut offending characters)
libcpp       (replace offending characters with one "p" each per plus ("+"))
libcplusplus (replace offending characters with one "plus" each per plus ("+"))
libc__       (replace offending characters with one underscore ("_") each per plus ("+"))
libc..       (replace offending characters with one dot (".") each per plus ("+"))
libc--       (replace offending characters with one dash ("-") each per plus ("+"))

We'll go with transforming:

+  -->  _
@  -->  .
Taking [extra/libc++](https://archlinux.org/packages/extra/x86_64/libc++/) some options are: ``` libc (cut offending characters) libcpp (replace offending characters with one "p" each per plus ("+")) libcplusplus (replace offending characters with one "plus" each per plus ("+")) libc__ (replace offending characters with one underscore ("_") each per plus ("+")) libc.. (replace offending characters with one dot (".") each per plus ("+")) libc-- (replace offending characters with one dash ("-") each per plus ("+")) ``` We'll go with transforming: ``` + --> _ @ --> . ```
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: quico-os-setup/zfs-pacman-hook#3
No description provided.