summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorAlexey Shmalko <rasen.dubi@gmail.com>2016-07-17 17:46:23 +0300
committerAlexey Shmalko <rasen.dubi@gmail.com>2016-07-25 15:50:53 +0300
commitfe9cabedf0292a2b09de16e272b968b42c0ac7fe (patch)
treee752eadb6bcd6671efce57fdca05d27da532144a /pkgs
parent76e41640070feda4ff343dec1d9c0aa2ccc8921c (diff)
downloadnixpkgs-fe9cabedf0292a2b09de16e272b968b42c0ac7fe.tar
nixpkgs-fe9cabedf0292a2b09de16e272b968b42c0ac7fe.tar.gz
nixpkgs-fe9cabedf0292a2b09de16e272b968b42c0ac7fe.tar.bz2
nixpkgs-fe9cabedf0292a2b09de16e272b968b42c0ac7fe.tar.lz
nixpkgs-fe9cabedf0292a2b09de16e272b968b42c0ac7fe.tar.xz
nixpkgs-fe9cabedf0292a2b09de16e272b968b42c0ac7fe.tar.zst
nixpkgs-fe9cabedf0292a2b09de16e272b968b42c0ac7fe.zip
etc: remove obsolete directories
This patch adds handling of a directory becoming a symlink in
/etc. Before this patch, the directory wasn't removed and then
symlinking failed, which caused directory not being updated at all.

The idea for the patch goes to @abbradar at
https://github.com/NixOS/nixpkgs/issues/16978#issuecomment-232921903:
> A heuristic idea for this -- a function `isStatic :: Path -> Bool`:
>
> * if path `/etc/foo` is a file, return True iff it's a symlink to `/etc/static/foo`.
> * if path is a directory, return True iff for all items in it `isStatic` is True.
>
> On any conflicts, if old path is static, it's safe to replace and/or
> delete stale. Otherwise make a backup and notify the user via a
> journal entry and console output.

The only difference here -- it will not replace user configs.

This also fixes https://github.com/NixOS/nixpkgs/issues/16978.
Diffstat (limited to 'pkgs')
0 files changed, 0 insertions, 0 deletions