rmdir: avoid failing when directory did not exist

I bet nobody has `environment.usrbinenv = null`, it would fail on the second activation trying to `rmdir` inexisting `/usr/bin`
This commit is contained in:
volth 2019-09-19 00:32:35 +00:00 committed by GitHub
parent af665d822a
commit 45db499d2d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -205,7 +205,7 @@ in
''
else ''
rm -f /usr/bin/env
rmdir --ignore-fail-on-non-empty /usr/bin /usr
rmdir -p /usr/bin || true
'';
system.activationScripts.ld-linux =
@ -218,7 +218,7 @@ in
mv -f ${target}.tmp ${target} # atomically replace
'' else ''
rm -f ${target}
rmdir --ignore-fail-on-non-empty $(dirname ${target})
rmdir $(dirname ${target}) || true
'')
{
"i686-linux" ."/lib/ld-linux.so.2" = "${pkgs.glibc.out}/lib/ld-linux.so.2";