aboutsummaryrefslogtreecommitdiff
path: root/tests/cpio.scm
blob: 516de0655b3cec47b19e270734c99a2e50959a04 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2015 Ludovic Courtès <ludo@gnu.org>
;;;
;;; This file is part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

(define-module (test-cpio)
  #:use-module (guix cpio)
  #:use-module (guix tests)
  #:use-module ((guix build utils) #:select (which))
  #:use-module ((guix utils) #:select (call-with-temporary-output-file))
  #:use-module (ice-9 match)
  #:use-module (ice-9 popen)
  #:use-module (rnrs io ports)
  #:use-module (srfi srfi-1)
  #:use-module (srfi srfi-26)
  #:use-module (srfi srfi-64))

(define %cpio-program
  (which "cpio"))


(test-begin "cpio")

(test-assert "file->cpio-header + write-cpio-header + read-cpio-header"
  (let* ((file   (search-path %load-path "guix.scm"))
         (header (file->cpio-header file)))
    (call-with-values
        (lambda ()
          (open-bytevector-output-port))
      (lambda (port get-bv)
        (write-cpio-header header port)
        (let ((port (open-bytevector-input-port (get-bv))))
          (equal? header (read-cpio-header port)))))))

(unless %cpio-program (test-skip 1))
(test-assert "bit-identical to GNU cpio's output"
  (call-with-temporary-output-file
   (lambda (link _)
     (delete-file link)
     (symlink "chbouib" link)

     (let ((files (cons* "/"
                         (canonicalize-path
                          (dirname (search-path %load-path "guix.scm")))
                         link
                         (map (compose canonicalize-path
                                       (cut search-path %load-path <>))
                              '("guix.scm" "guix/build/syscalls.scm"
                                "guix/packages.scm")))))
       (call-with-temporary-output-file
        (lambda (ref-file _)
          (let ((pipe (open-pipe* OPEN_WRITE %cpio-program "-o" "-O" ref-file
                                  "-H" "newc" "--null")))
            (for-each (lambda (file)
                        (format pipe "~a\0" file))
                      files)
            (and (zero? (close-pipe pipe))
                 (call-with-temporary-output-file
                  (lambda (file port)
                    (write-cpio-archive files port)
                    (close-port port)
                    (or (file=? ref-file file)
                        (throw 'cpio-archives-differ files
                               ref-file file
                               (stat:size (stat ref-file))
                               (stat:size (stat file))))))))))))))

(test-end "cpio")
eaders-6.10, linux-libre-6.10): New variables. * gnu/packages/aux-files/linux-libre/6.10-arm.conf, gnu/packages/aux-files/linux-libre/6.10-arm64.conf, gnu/packages/aux-files/linux-libre/6.10-i686.conf, gnu/packages/aux-files/linux-libre/6.10-x86.conf: New files. * Makefile.am (AUX_FILES): Add them. Change-Id: If62ec2e8029ebd7531d3b4ba9a666c0b5f3b0f4c Signed-off-by: Leo Famulari <leo@famulari.name> Wilko Meyer 2024-07-07gnu: emacs-next: Update to 30.0.60-1.4e22ef8....* gnu/packages/aux-files/emacs/comp-integrity-next.el: New file. * Makefile.am (AUX_FILES): Register it here. * gnu/packages/emacs.scm (emacs-next-minimal): Update to 30.0.60-1.4e22ef8. (emacs->emacs-next)[arguments]: Swap out ‘validate-comp-integrity’ phase, so as to refer to the new integrity check. Liliana Marie Prikler 2024-06-17gnu: Remove linux-libre 6.8....* gnu/packages/linux.scm (linux-libre-6.8-version, linux-libre-6.8-gnu-revision, deblob-scripts-6.8, linux-libre-6.8-pristine-source, linux-libre-6.8-source, linux-libre-headers-6.8, linux-libre-6.8): Remove variables. * gnu/packages/aux-files/linux-libre/6.8-arm.conf, gnu/packages/aux-files/linux-libre/6.8-arm64.conf, gnu/packages/aux-files/linux-libre/6.8-riscv.conf gnu/packages/aux-files/linux-libre/6.8-i686.conf, gnu/packages/aux-files/linux-libre/6.8-x86_64.conf: Delete files. * Makefile.am (AUX_FILES): Remove aforementioned .conf files. Signed-off-by: Leo Famulari <leo@famulari.name> Change-Id: Ib94c61f629721f94a307e51b449e5ccd117a2f9a Wilko Meyer 2024-06-06gnu: linux-libre: Add 6.9-riscv.conf...* gnu/packages/aux-files/linux-libre/6.9-riscv.conf: New file. * Makefile.am (AUX_FILES): Register it. Change-Id: I1f5e24726c3a59bec73805068548ce5916b427f8 Signed-off-by: Zheng Junjie <zhengjunjie@iscas.ac.cn> Zheng Junjie 2024-05-26gnu: Add linux-libre 6.9....Big thanks to Dariqq <dariqq@posteo.net> for debugging and communicating upstream about a problem with the deblobbing scripts in this kernel series! * gnu/packages/linux.scm (linux-libre-6.9-version, linux-libre-6.9-gnu-revision, deblob-scripts-6.9, linux-libre-6.9-pristine-source, linux-libre-6.9-source, linux-libre-headers-6.9, linux-libre-6.9): New variables. * gnu/packages/aux-files/linux-libre/6.9-arm.conf, gnu/packages/aux-files/linux-libre/6.9-arm64.conf, gnu/packages/aux-files/linux-libre/6.9-i686.conf, gnu/packages/aux-files/linux-libre/6.9-x86.conf: New files. * Makefile.am (AUX_FILES): Add them. Signed-off-by: Leo Famulari <leo@famulari.name> Change-Id: I8dc011a603684f0be88766b7881aa6c560b94443 Wilko Meyer 2024-05-22gnu: linux-libre-6.8: Add riscv config....* gnu/packages/aux-files/linux-libre/6.8-riscv.conf: New files. * Makefile.am (AUX_FILES): Add it. Change-Id: I293912d4f7fe09e281432b0f973999d9d8db582a Zheng Junjie 2024-04-30gnu: Remove linux-libre 6.7....* gnu/packages/linux.scm (linux-libre-6.7-version, linux-libre-6.7-gnu-revision, deblob-scripts-6.7, linux-libre-6.7-pristine-source, linux-libre-6.7-source, linux-libre-headers-6.7, linux-libre-6.7): Remove variables. * gnu/packages/aux-files/linux-libre/6.7-arm.conf, gnu/packages/aux-files/linux-libre/6.7-arm64.conf, gnu/packages/aux-files/linux-libre/6.7-i686.conf, gnu/packages/aux-files/linux-libre/6.7-x86_64.conf: Delete files. * Makefile.am (AUX_FILES): Remove aforementioned .conf files. Change-Id: Ic69a65e1fbfa59d893e85d26950f33195ea9fbe1 Signed-off-by: Leo Famulari <leo@famulari.name> Wilko Meyer 2024-03-27Merge branch 'master' into emacs-teamLiliana Marie Prikler 2024-03-22gnu: Add linux-libre 6.8....* gnu/packages/linux.scm (linux-libre-6.8-version, linux-libre-6.8-gnu-revision, deblob-scripts-6.8, linux-libre-6.8-pristine-source, linux-libre-6.8-source, linux-libre-headers-6.8, linux-libre-6.8): New variables. * gnu/packages/aux-files/linux-libre/6.8-arm.conf, gnu/packages/aux-files/linux-libre/6.8-arm64.conf, gnu/packages/aux-files/linux-libre/6.8-i686.conf, gnu/packages/aux-files/linux-libre/6.8-x86.conf: New files. * Makefile.am (AUX_FILES): Add them. Signed-off-by: Leo Famulari <leo@famulari.name> Change-Id: I338eb725e0b991c67e4d98bd1ef0c441d3d8f0c6 Wilko Meyer 2024-03-22gnu: emacs: Only verify integrity of bound symbols....Some variants, like emacs-no-x, come with a reduced set of preloaded symbols, so don't expect them to always be native. * gnu/packages/aux-files/emacs/comp-integrity.el (expect-native-if-bound): New function. (x-setup-function-keys, dynamic-setting-handle-config-changed-event) (fontset-plain-name, fringe-mode, image-type, regexp-opt, scroll-bar-scale): Use ‘expect-native-if-bound’. (x-handle-no-bitmap-icon): Likewise, was already conditional. Liliana Marie Prikler 2024-03-04aux-files: comp-integrity: Adjust for emacs-pgtk....* gnu/packages/aux-files/emacs/comp-integrity.el (x-dnd-init-frame): Require x-dnd. (x-handle-no-bitmap-icon): Only test this if it's bound. Liliana Marie Prikler 2024-03-02gnu: emacs-next-minimal: Update to 30.0.50-2.170c655....* gnu/packages/emacs.scm (emacs-next-minimal): Update to 30.0.50-2.170c655. * gnu/packages/aux-files/emacs/comp-integrity.el: Adjust accordingly. Liliana Marie Prikler 2024-03-02Merge branch 'master' into emacs-teamLiliana Marie Prikler 2024-02-25gnu: renpy: Update to 8.2.0....* gnu/packages/aux-files/renpy/renpy.in (path-to-saves): Honour RENPY_PATH_TO_SAVES. (path_to_logdir, predefined_searchpath): New procedures. * gnu/packages/game-development.scm (python-renpy): Update to 8.2.0. Liliana Marie Prikler 2024-02-24gnu: emacs: Check integrity of native-compiled files....In the previous commit, we've added a patch that potentially messes with how built-in (especially preloaded) Lisp libraries are loaded. Thus, we might want to assert that these files still load fine, as reported when querying the builtin documentation of functions provided by them. * gnu/packages/aux-files/emacs/comp-integrity.el: New file. * gnu/Makefile.am (dist_noinst_DATA): Register it here. * gnu/packages/emacs.scm (emacs-no-x)[#:phases]: Add ‘validate-comp-integrity’. Liliana Marie Prikler 2024-02-20gnu: linux-libre 6.7: Modify .conf files....* gnu/packages/aux-files/linux-libre/6.7-arm.conf, gnu/packages/aux-files/linux-libre/6.7-arm64.conf: Add platform support. Change-Id: I90dee088ab11a31cb526b396d675e7bc22d67297 Signed-off-by: Leo Famulari <leo@famulari.name> Wilko Meyer 2024-01-22gnu: Remove linux-libre 4.14....* gnu/packages/linux.scm (linux-libre-4.14-version, linux-libre-4.14-gnu-revision, deblob-scripts-4.14, linux-libre-4.14-pristine-source, linux-libre-4.14-source, linux-libre-headers-4.14, linux-libre-4.14, linux-libre-arm-generic-4.14, linux-libre-arm-omap2plus-4.14): Remove variables. * gnu/packages/aux-files/linux-libre/4.14-arm.conf, gnu/packages/aux-files/linux-libre/4.14-i686.conf, gnu/packages/aux-files/linux-libre/4.14-x86_64.conf: Delete files. * Makefile.am (AUX_FILES): Remove aforementioned .conf files. * gnu/tests/base.scm (%test-linux-libre-4.14): Remove variable. Change-Id: I40393b5f46b989848d569c929f1d9c986736553e Wilko Meyer