Skip to content

feat: explicit symlink indicator #283

@lczyk

Description

@lczyk

a quick braindump / feature proposal. here is what we end up often doing in chisel-releases:

slices:
  bins:
    contents:
      /usr/sbin/ip6tables-nft-restore:  # Symlink to xtables-legacy-multi
      /usr/sbin/ip6tables-nft-save:  # Symlink to xtables-legacy-multi
      /usr/sbin/ip6tables-restore-translate:  # Symlink to xtables-legacy-multi
      ...

this is to make it easier to maintainers to unserstand which files ought to go together and how they relate to one another.

we could create the symlinks explicitly:

slices:
  bins:
    contents:
      /usr/sbin/ip6tables-nft-restore:
        symlink: xtables-legacy-multi
      /usr/sbin/ip6tables-nft-save:
        symlink: xtables-legacy-multi
      /usr/sbin/ip6tables-restore-translate:
        symlink: xtables-legacy-multi
      ...

but them we're not actually checking that that file really is a symlink. we're just making one. the problem is with release-to-release maintenance:

  1. the underlying file e.g. /usr/sbin/ip6tables-nft-restore could be removed, and we would still be creating a symlink
  2. the symlink target in the deb could change, and we would overwrite it
  3. the file could change from symlink to binary and we would not catch it.

the very rough idea would be something like:

slices:
  bins:
    contents:
      /usr/sbin/ip6tables-nft-restore:
        expect-symlink: xtables-legacy-multi

which is a way of saying: "include this file. i expect it to be a symlink to $0. error otherwise"

i'm not strongly attached to the idea, but just thought i'd drop it here as a food-for-thought. :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions