From 47e643db107d4c4569fe2195c5369d748169ae47 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sun, 2 Nov 2014 21:38:23 +0100 Subject: guix-register: Do not attempt to create NIX_STORE_DIR. Fixes . Reported by Philip Woods . * nix/guix-register/guix-register.cc (main): Move 'store' instantiation above 'settings.nixStore' assignment. --- nix/guix-register/guix-register.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'nix/guix-register/guix-register.cc') diff --git a/nix/guix-register/guix-register.cc b/nix/guix-register/guix-register.cc index 92eedab9f5..f5c610fde0 100644 --- a/nix/guix-register/guix-register.cc +++ b/nix/guix-register/guix-register.cc @@ -224,16 +224,16 @@ main (int argc, char *argv[]) { argp_parse (&argp, argc, argv, 0, 0, 0); + /* Instantiate the store. This creates any missing directories among + 'settings.nixStore', 'settings.nixDBPath', etc. */ + LocalStore store; + if (!prefix.empty ()) /* Under the --prefix tree, the final name of the store will be NIX_STORE_DIR. Set it here so that the database uses file names prefixed by NIX_STORE_DIR and not PREFIX + NIX_STORE_DIR. */ settings.nixStore = NIX_STORE_DIR; - /* Instantiate the store. This creates any missing directories among - 'settings.nixStore', 'settings.nixDBPath', etc. */ - LocalStore store; - register_validity (&store, *input, deduplication); } catch (std::exception &e) -- cgit v1.2.3