From c6df09941b9fb225788e9efa276b7aa92e19d3c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Mon, 25 Aug 2014 00:16:49 +0200 Subject: guix-register: By default, attempt to deduplicate registered items. * nix/guix-register/guix-register.cc (GUIX_OPT_DEDUPLICATE): New macro. (options): Add --no-deduplication. (deduplication): New variable. (parse_opt): Handle GUIX_OPT_DEDUPLICATE. (register_validity): Add 'optimize' parameter and honor it. (main): Move 'store' instanatiation after 'settings.nixStore' assignment. * tests/guix-register.sh: Add test for deduplication. * guix/nar.scm (finalize-store-file): Update comment above 'register-path' call. --- tests/guix-register.sh | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'tests/guix-register.sh') diff --git a/tests/guix-register.sh b/tests/guix-register.sh index 3f261d7bef..e99f5c6075 100644 --- a/tests/guix-register.sh +++ b/tests/guix-register.sh @@ -43,13 +43,28 @@ $new_file 0 EOF -# Make sure it's valid, and delete it. +# Register an idendical file, and make sure it gets deduplicated. +new_file2="$new_file-duplicate" +cat "$new_file" > "$new_file2" +guix-register <