From d6e1828c13bb3f0c1b1b0d31fdabce9eb3647b1e Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Sat, 22 Mar 2008 16:04:38 +0000 Subject: [PATCH] * Speed up activating the configuration: don't do a find on all of /etc, skip /etc/nixos. (Actually, the NixOS/Nixpkgs sources probably shouldn't be stored in /etc...) svn path=/nixos/trunk/; revision=11261 --- system/activate-configuration.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/system/activate-configuration.sh b/system/activate-configuration.sh index 47fe684a8aa..fd901c8aca6 100644 --- a/system/activate-configuration.sh +++ b/system/activate-configuration.sh @@ -37,8 +37,9 @@ done # Remove dangling symlinks that point to /etc/static. These are # configuration files that existed in a previous configuration but not -# in the current one. -for i in $(find /etc/ -type l); do +# in the current one. For efficiency, don't look under /etc/nixos +# (where all the NixOS sources live). +for i in $(find /etc/ \( -path /etc/nixos -prune \) -o -type l); do target=$(readlink "$i") if test "${target:0:${#staticEtc}}" = "$staticEtc" -a ! -e "$i"; then rm -f "$i"