Hacker News new | ask | show | jobs
by rollcat 1471 days ago
OpenBSD has sysmerge (https://man.openbsd.org/sysmerge), Debian's dpkg will also prompt to accept/reject changes; this probably would be the ideal solution, but macOS doesn't give you an opportunity to implement such a scheme, since an upgrade just overwrites all user changes unconditionally.

Patches are harder to use than plain files, since you need to maintain a source and a destination to diff against, and applying them can occasionally fail, requiring the user to resolve.

I think overriding configuration in /etc is one of those cases where the user's intent is very clearly "I know what I'm doing, please get out of my way", and other unices are built to respect that. macOS assumes it's the other way around, and ends up doing crazy stuff like overwriting "PasswordAuthentication" to "yes" in sshd_config on every upgrade.

Running rsync to just overwrite the configuration is probably too simplistic. Maybe the tool could detect that a file was overwritten by an upgrade, and make a backup (sshd_config.upgrade, and so on).

I think I'm just going to write it now.

1 comments

> Maybe the tool could detect that a file was overwritten by an upgrade, and make a backup

That's probably a good compromise between giving the user the power, but not letting them shoot themselves in the foot!

Would you like to have a look? https://github.com/rollcat/upmerge