deduplicate: Create the '.links' directory lazily.
authorLudovic Courtès <ludo@gnu.org>
Fri, 11 Dec 2020 14:48:02 +0000 (15:48 +0100)
committerLudovic Courtès <ludo@gnu.org>
Tue, 15 Dec 2020 16:32:12 +0000 (17:32 +0100)
commit7530e491b517497b7b8166b5ccecdc3d4cdb468d
treef228a2bcadb518ba8e948652ec41f41aafed1c51
parent9e6fe0e08fda67ab298ca33ef00ffbf078ce4dd9
deduplicate: Create the '.links' directory lazily.

This avoids repeated (mkdir-p "/gnu/store/.links") calls when
deduplicating lots of files.

* guix/store/deduplication.scm (deduplicate): Remove initial call to
'mkdir-p'.  Add ENOENT case in 'link' exception handler.  Reindent.
* tests/store-deduplication.scm ("deduplicate, ENOSPC"): Check
for (<= links 4) to account for the initial 'link' call.
guix/store/deduplication.scm
tests/store-deduplication.scm