Commit Graph

11 Commits (a5b2570a1c10f1fbdcbbc173378ce0bdb090250d)

Author SHA1 Message Date
Ludovic Courtès 369755847b guix-register: Perform deduplication even when --prefix is passed.
Fixes <http://bugs.gnu.org/19044>.

* nix/guix-register/guix-register.cc (register_validity): Change the (optimize
  && prefix.empty ()) condition to just (optimize).  Change settings.nixStore
  around the loop.  Prepend PREFIX to the argument passed to 'optimisePath'.
* tests/guix-register.sh: Use 'guix-register -p' with duplicate files, and
  make sure they are deduplicated on the target.  Adjust existing tests.
2015-06-10 13:47:58 +02:00
Ludovic Courtès 4ae1fe14b9 tests: Make the daemon socket explicit in guix-register test.
* tests/guix-register.sh: Define GUIX_DAEMON_SOCKET.  Pass it explicitly to
  'open-connection'.
2015-06-10 11:11:52 +02:00
Ludovic Courtès bd98ad1fbc tests: Skip 'guix-register' when the socket name length is exceeded.
* tests/guix-register.sh: Before running 'guix-daemon', check whether
  the socket name length exceeds the system limitation.
2015-02-02 12:46:36 +01:00
Ludovic Courtès c6df09941b 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.
2014-08-25 00:16:49 +02:00
Ludovic Courtès 58f485cc80 build: Fix typo that would lead to hitting the socket name length limit.
* tests/guix-register.sh: Remove redundant $new_store in $NIX_STATE_DIR,
  introduced in 689142cd ("guix-register: Add '--state-directory'
  parameter.")  Reported by Eric Bavier <ericbavier@gmail.com> and
  Alen Skondro <askondro@gmail.com>.
2014-07-20 22:39:02 +02:00
Ludovic Courtès 689142cd75 guix-register: Add '--state-directory' parameter.
* nix/guix-register/guix-register.cc (GUIX_OPT_STATE_DIRECTORY): New
  macro.
  (parse_opt): Honor it.
* tests/guix-register.sh: Add test with '--state-directory'.
* guix/store.scm (register-path): Add #:state-directory parameter.
2014-07-18 20:40:51 +02:00
Ludovic Courtès 8ad49499b9 build: Support running the test suite from a directory with symlinks.
Fixes <http://bugs.gnu.org/17935>.
Reported by Alex Kost <alezost@gmail.com>.

* test-env.in: Canonicalize $NIX_STORE_DIR, and remove
  $NIX_IGNORE_SYMLINK_STORE setting.
* tests/guix-register.sh: Likewise, canonicalize $new_store_dir and
  $new_store and leave $NIX_IGNORE_SYMLINK_STORE unchanged.
2014-07-05 19:15:08 +02:00
Ludovic Courtès aa2480e50d build: Fix test failures due to the nix -> guix directory name change.
Reported by Nikita Karetnikov <nikita@karetnikov.org>
and Pierre-Antoine Rault <par@rigelk.eu>.

* test-env.in: Change 'NIX_LOG_DIR' in accordance with f5768af.
* tests/guix-register.sh: Likewise for 'NIX_LOG_DIR' and 'NIX_DB_DIR'.
2014-03-17 23:30:42 +01:00
Ludovic Courtès 349fd3b11f guix-register: Support registration in the current store, without '--prefix'.
* nix/guix-register/guix-register.cc (register_validity): Leave
  'info.path' unmodified when PREFIX is empty.
  (main): Call 'settings.processEnvironment' early on.
  Leave 'settings.nixStore' unmodified when PREFIX is empty.
2014-01-24 00:01:49 +01:00
Ludovic Courtès caf96debc2 guix-register: Expect closures to refer to the original store.
* nix/guix-register/guix-register.cc (prefix): New variable.
  (parse_opt): Use it.
  (register_validity): Change 'info.path' to the final store name.
  Hash the final under its real path.
* tests/guix-register.sh: Adjust the contents of $closure accordingly.
  Rename 'NIX_LOCALSTATE_DIR' to 'NIX_STATE_DIR'.  Don't try to call
  'valid-path?'.  Add test using 'sqlite3'.
2013-09-23 23:56:35 +02:00
Ludovic Courtès a7a4e6a4f7 Add 'guix-register'.
* nix/guix-register/guix-register.cc, tests/guix-register.sh: New
  files.
* Makefile.am (SH_TESTS)[BUILD_DAEMON]: Add tests/guix-register.sh.
* daemon.am (sbin_PROGRAMS, guix_register_SOURCES,
  guix_register_CPPFLAGS, guix_register_LDADD): New variables.
* test-env.in: Export 'storedir', 'prefix', 'datarootdir', 'datadir',
  and 'localstatedir'.
2013-09-23 00:33:50 +02:00