1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2025-03-13 20:30:02 +00:00

etc: make link warnings more noticable

Hopefully this helps to make it more obvious that the file will not be
created by nix-darwin. See #65
This commit is contained in:
Daiderd Jordan 2018-01-08 19:08:02 +01:00
parent ac840a44b4
commit 3bedff357a
No known key found for this signature in database
GPG key ID: D02435D05B810C96

View file

@ -45,14 +45,14 @@ in
ln -sfn "$(readlink -f $systemConfig/etc)" /etc/static
for f in $(find /etc/static/* -type l); do
l="$(echo $f | sed 's,/etc/static/,/etc/,')"
d="$(dirname $l)"
l=/etc/''${f#/etc/static/}
d=''${l%/*}
if [ ! -e "$d" ]; then
mkdir -p "$d"
fi
if [ -e "$l" ]; then
if [ "$(readlink $l)" != "$f" ]; then
echo "warning: not linking $l because $l exists, skipping..." >&2
echo "warning: not linking environment.etc.\"''${l#/etc/}\" because $l exists, skipping..." >&2
fi
else
ln -s "$f" "$l"
@ -61,6 +61,7 @@ in
for l in $(find /etc/* -type l 2> /dev/null); do
f="$(echo $l | sed 's,/etc/,/etc/static/,')"
f=/etc/static/''${l#/etc/}
if [ "$(readlink $l)" = "$f" -a ! -e "$(readlink -f $l)" ]; then
rm "$l"
fi