TheLocehiliosan / yadm

Yet Another Dotfiles Manager
https://yadm.io/
GNU General Public License v3.0
5.08k stars 175 forks source link

Fall back to ID if ID_LIKE is not available #494

Open mmuffins opened 2 months ago

mmuffins commented 2 months ago

Is your feature request related to a problem? Please describe.

I recently got started with yadm and spent a good while trying to figure out why alternative files wouldn't be created for selector ##distro_family.debian when using it on a vanilla debian system.

Describe the solution you'd like

Could it be an option to consider the base ID field if ID_LIKE is not available in /etc/os-release? Base distros like debian or arch sitting at the root of the distro tree may deliberately omit the field. The specification is not explicit on what to do if the current distro isn't a derivative of something else, but it says to only list distros you derive from, so base distros seem to correctly not set this field.

A space-separated list of operating system identifiers in the same syntax as the ID= setting. It should list identifiers of operating systems that are closely related to the local operating system in regards to packaging and programming interfaces, for example listing one or more OS identifiers the local OS is a derivative from. An OS should generally only list other OS identifiers it itself is a derivative of, and not any OSes that are derived from it, though symmetric relationships are possible. Build scripts and similar should check this variable if they need to identify the local operating system and the value of ID= is not recognized. Operating systems should be listed in order of how closely the local operating system relates to the listed ones, starting with the closest. This field is optional.

from https://www.freedesktop.org/software/systemd/man/latest/os-release.html

Describe alternatives you've considered

I can see that there are options being considered, e.g by overriding the distro_family, which is definitely a valid option for distros that just don't set the value, but I'm not sure if it's the best approach for all use cases.

github-actions[bot] commented 20 hours ago

This issue has been labeled as stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.