locate: fix creation of the parent directory of of locate database

This commit is contained in:
romildo 2017-05-28 15:21:57 -03:00
parent 90b08c29d2
commit c06a10e05f

View file

@ -131,7 +131,7 @@ in {
path = mkIf (!isMLocate) [ pkgs.su ];
script =
''
install -m ${if isMLocate then "0750" else "0755"} -o root -g ${if isMLocate then "mlocate" else "root"} -d $(dirname ${cfg.output})
mkdir -m 0755 -p ${dirOf cfg.output}
exec ${cfg.locate}/bin/updatedb \
${optionalString (cfg.localuser != null) ''--localuser=${cfg.localuser}''} \
--output=${toString cfg.output} ${concatStringsSep " " cfg.extraFlags}