summaryrefslogtreecommitdiff
path: root/guix/nar.scm
Commit message (Collapse)AuthorAge
* utils: Move 'fcntl-flock' to (guix build syscalls).Ludovic Courtès2016-05-06
| | | | | | | | | | | * guix/utils.scm (%struct-flock, F_SETLKW, F_SETLK, F_xxLCK) (fcntl-flock): Move to... * guix/build/syscalls.scm: ... here. New variables. * guix/nar.scm: Adjust imports accordingly. * tests/utils.scm ("fcntl-flock wait", "fcntl-flock non-blocking"): Move to... * tests/syscalls.scm: ... here. New tests. (temp-file): New variable.
* nar: Read archive signatures as Latin-1 strings.Ludovic Courtès2015-01-18
| | | | | | | | Fixes <http://bugs.gnu.org/19610>. Reported by Mark H Weaver <mhw@netris.org>. * guix/nar.scm (restore-one-item): Use 'read-latin1-string' to read the signature.
* Break module cycle involving (guix store) and (guix ui).Ludovic Courtès2014-10-09
| | | | | | | | | | | | | | | | | | | | Before, there was a cycle along the lines of: (guix store) -> (guix nar) -> (guix ui) -> (guix store) This caused problems, as discussed at: http://lists.gnu.org/archive/html/guix-devel/2014-10/msg00109.html This patch removes cycles in the (guix ...) modules. * guix/nar.scm (&nar-error, &nar-read-error, dump, write-contents, read-contents, %archive-version-1, write-file, restore-file): Move to... * guix/serialization.scm: ... here. * guix/store.scm: Remove dependency on (guix nar). * guix/scripts/hash.scm, guix/scripts/offload.scm, guix/scripts/substitute-binary.scm, tests/nar.scm, tests/store.scm, tests/substitute-binary.scm: Adjust accordingly.
* guix-register: By default, attempt to deduplicate registered items.Ludovic Courtès2014-08-25
| | | | | | | | | | | | | * 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.
* pk-crypto: Add pretty-printer to 'gcry-error' exceptions.Ludovic Courtès2014-04-22
| | | | | | | | | | | | | * guix/pk-crypto.scm (string->canonical-sexp, sign, generate-key): Pass the procedure name as the first argument to 'throw'. (gcrypt-error-printer): New procedure. <top level>: Add call to 'set-exception-printer!'. * guix/nar.scm (restore-one-item): Add 'proc' parameter to 'catch' handler for 'gcry-error. * guix/scripts/archive.scm (%options, generate-key-pair, authorize-key): Likewise. * guix/scripts/substitute-binary.scm (narinfo-signature->canonical-sexp): Likewise.
* nar: Really really protect the temporary store directory from GC.Ludovic Courtès2014-04-21
| | | | | | | | | | | | | This is a follow-up to 6071b55e10b7b6e67d77ae058c8744834889e0b4. See <https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00167.html> for the original report, and <https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00198.html> for an alternate solution that has been discussed. * guix/nar.scm (temporary-store-file): Remove call to 'add-permanent-root'; don't loop. (with-temporary-store-file): Rewrite using 'with-store' and 'add-temp-root'.
* nar: Really protect the temporary store directory from GC.Ludovic Courtès2014-04-12
| | | | | | | | | | | | | | Prevents garbage collection of the temporary store directory while restoring a file set, as it could previously happen: <https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00167.html>. * guix/nar.scm (temporary-store-directory): Rename to... (temporary-store-file): ... this. Use 'add-permanent-root' instead of 'add-indirect-root'. (with-temporary-store-file): New macro. (restore-one-item): New procedure, with code formerly in 'restore-file-set'. Use 'with-temporary-store-file'. (restore-file-set): Use it.
* nar: 'restore-file-set' registers the temporary result as a GC root.Ludovic Courtès2014-04-09
| | | | | | * guix/nar.scm (temporary-store-directory): Use 'add-indirect-root', not 'add-temp-root'. Reported by Andreas Enge <andreas@enge.fr> at <https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00161.html>.
* Work around behavior of old 'scandir' in Guile 2.0.5.Mark H Weaver2014-04-07
| | | | | | | Problem reported by John Darrington <john@darrington.wattle.id.au>. * guix/nar.scm (write-file): Filter out "." and ".." from the result of 'scandir'. Previously we did this by passing a suitable predicate.
* Use 'signature-case' in (guix nar) and 'substitute-binary'.Ludovic Courtès2014-03-31
| | | | | | | | | | | | | | | | | | | * guix/nar.scm (restore-file-set)[assert-valid-signature]: Rewrite in terms of 'signature-case'. * guix/scripts/substitute-binary.scm (narinfo-signature->canonical-sexp): Call 'leave' instead of 'raise' when SIGNATURE is invalid. (&nar-signature-error, &nar-invalid-hash-error): Remove. (assert-valid-signature): Add 'narinfo' parameter; remove 'port'. Rewrite in terms of 'signature-case' and 'leave'. Mention NARINFO's URI in error messages. Adjust caller. (narinfo-sha256): New procedure. (assert-valid-narinfo): Use it. (valid-narinfo?): Rewrite using 'narinfo-sha256' and 'signature-case'. * tests/substitute-binary.scm (assert-valid-signature, test-error-condition): Remove. ("corrupt signature data", "unauthorized public key", "invalid signature"): Remove.
* nar: Clarify that 'assert-valid-signature' accepts a string.Nikita Karetnikov2014-03-30
| | | | * guix/nar.scm (assert-valid-signature): Improve the wording.
* nar: Produce archives with files sorted in C collation order.Ludovic Courtès2014-02-21
| | | | | | | * guix/nar.scm (write-file) <directory>: Pass 'string<?' as the second argument to 'scandir'. * tests/nar.scm ("write-file puts file in C locale collation order"): New test.
* guix hash: Add '--recursive'.Ludovic Courtès2014-02-21
| | | | | | | | | | | | * guix/scripts/hash.scm (show-help): Add --recursive. (%options): Likewise. (guix-hash)[file-hash]: New procedure. Honor --recursive. Use it. * guix/nar.scm (write-file): Add missing field to the &nar-error condition raised upon unsupported file type; change its message to be more descriptive. * tests/guix-hash.sh: Add tests with -r. * doc/guix.texi (Invoking guix hash): Document --recursive.
* nar: 'write-file' can write to non-file ports.Ludovic Courtès2014-02-21
| | | | | | * guix/nar.scm (write-contents): Use 'sendfile' only when P is a file port. * tests/nar.scm ("write-file supports non-file output ports"): New test.
* nar: Add 'restore-file-set', for use by build hooks.Ludovic Courtès2014-01-24
| | | | | | | | | | | | | | | * guix/nar.scm (&nar-invalid-hash-error, &nar-signature-error): New condition types. (&nar-error): Add 'file' and 'port' fields. (&nar-read-error): Remove 'port' and 'file' fields. (lock-store-file, unlock-store-file, finalize-store-file, temporary-store-directory, restore-file-set): New procedures. * tests/nar.scm (%seed): New variable. (random-text): New procedure. ("restore-file-set (signed, valid)", "restore-file-set (missing signature)", "restore-file-set (corrupt)"): New tests. * po/Makevars (XGETTEXT_OPTIONS): Add '--keyword=message'.nar fixes * po/POTFILES.in: Add guix/nar.scm.
* nar: Fix file descriptor leak when writing a Nar.Ludovic Courtès2013-09-23
| | | | | * guix/nar.scm (write-contents)[call-with-binary-input-file]: Always close PORT.
* nar: Add support for symlinks.Ludovic Courtès2013-04-12
| | | | | | | | | | | * guix/nar.scm (write-file): Add case for type `symlink'. (restore-file): Likewise. * tests/nar.scm (random-file-size, make-file-tree, delete-file-tree, with-file-tree, file-tree-equal?, make-random-bytevector, populate-file): New procedures. (%test-dir): New variable. ("write-file + restore-file"): Use `%test-dir' and `file-tree-equal?'. ("write-file + restore-file with symlinks"): New test.
* nar: Implement restoration from Nar.Ludovic Courtès2013-04-08
| | | | | | | | * guix/nar.scm (&nar-error, &nar-read-error): New condition types. (dump): New procedure. (write-contents)[dump]: Remove. Use the one above instead. (read-contents, write-file, restore-file): New procedures. (%archive-version-1): New variable.
* Add (guix nar) and (guix serialization).Ludovic Courtès2013-04-04
* guix/store.scm (write-int, read-int, write-long-long, read-long-long, write-padding, write-string, read-string, read-latin1-string, write-string-list, read-string-list, write-store-path, read-store-path, write-store-path-list, read-store-path-list): Move to serialization.scm. (write-contents, write-file): Move to nar.scm. * guix/nar.scm, guix/serialization.scm: New files. * Makefile.am (MODULES): Add them.