aboutsummaryrefslogtreecommitdiff
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2015, 2022, 2024 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 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"))

(define %test-file
  (search-path %load-path "guix.scm"))


(test-begin "cpio")

;; The cpio format expects 'ino' to fit in 32 bits.  If we have a bigger inode
;; number, skip this test.
(test-skip
 (if (>= (stat:ino (lstat %test-file)) (expt 2 32)) 1 0))
(test-assert "file->cpio-header + write-cpio-header + read-cpio-header"
  (let* ((header (file->cpio-header %test-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")
o-github-com-go-openapi-validate): Likewise. * gnu/packages/golang.scm (go-github-com-charmbracelet-glamour): Likewise. * gnu/packages/textutils.scm (vale): Likewise. Change-Id: Ic2ec01c8caf86f3ae69d7a1812c1e0b78a549e91 Sharlatan Hellseher 2024-11-09gnu: restic-rest-server: Fix build....Fix the build as senn in <https://ci.guix.gnu.org/build/5805924/log/raw>. * gnu/packages/backup.scm (restic-rest-server): Fix build. [arguments]: <#:phases>: Add 'fix-embed-files. Change-Id: I84454cddcd39c32f7b87d13d6ea9433c86426c8c Sharlatan Hellseher 2024-09-25gnu: vorta: Update to 0.9.1....* gnu/packages/backup.scm (vorta): Update to 0.9.1. [source]: Update origin url. [build-system]: Use pyproject-build-system. [arguments]: Disable tests that require an X server, update module imports, and move check phase to before check phase. [native-inputs]: Add python-platformdirs. [inputs]: Use qt 6 version of inputs. Change-Id: I9f56d892d2a0284ebe1a38d80705fbc03f18e4a2 jgart 2024-09-09gnu: borgmatic: Update to 1.8.14....* gnu/packages/backup.scm (borgmatic): Update to 1.8.14. Change-Id: I8e5ea77c5880cafbb65ea00785f1e0f931fc0142 Steve George 2024-08-31gnu: borg: Fix build....* gnu/packages/backup.scm (borg)[arguments]: Don't refer to nonexistent 'install-docs' phase. Change-Id: If7c1a99ee0dc08a2a0649c78505de432cf996e9c 宋文武 2024-08-31gnu: libarchive: Ungraft....* gnu/packages/backup.scm (libarchive)[replacement]: Remove. [source]: Add ‘patches’. (libarchive/fixed): Remove. Change-Id: I32b717c2166a6683043e0169b96f383dc9404b96 Ludovic Courtès 2024-08-31gnu: dirvish: Add 'bash' input for 'wrap-program'....It is required for cross-compilation. * gnu/packages/backup.scm (dirvish)[inputs]: Add 'bash-minimal'. Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com> Change-Id: Iedf6818bd15cd6bab97ace14dee1964b4fec6dc6 Maxime Devos 2024-08-31gnu: dirvish: Import the correct set of modules....* gnu/packages/backup.scm (dirvish) [arguments] <modules>: Replace %default-gnu-imported-modules with %default-gnu-modules. Delete trailing #t. Change-Id: I041a65441055a21f141bb7ea4a563e2624cd783c Maxim Cournoyer 2024-08-31build-systems: gnu: Export %default-gnu-imported-modules and %default-gnu-mod......Until now users would have to cargo cult or inspect the private %default-modules variable of (guix build-systems gnu) to discover which modules to include when extending the used modules via the #:modules argument. The renaming was automated via the command: $ git grep -l %gnu-build-system-modules | xargs sed 's/%gnu-build-system-modules/%default-gnu-imported-modules/' -i * guix/build-system/gnu.scm (%gnu-build-system-modules): Rename to... (%default-gnu-imported-modules): ... this. (%default-modules): Rename to... (%default-gnu-modules): ... this. Export. (dist-package, gnu-build, gnu-cross-build): Adjust accordingly. Change-Id: Idef307fff13cb76f3182d782b26e1cd3a5c757ee Maxim Cournoyer 2024-08-27gnu: borgmatic: Update to 1.8.13....* gnu/packages/backup.scm (borgmatic): Update to 1.8.13. Change-Id: Ia4bbc5cf81577d4092bdaa882eed45c6bf56bdc9 Signed-off-by: Leo Famulari <leo@famulari.name> Wilko Meyer 2024-07-25gnu: go-github-com-prometheus-client-golang: Move to prometheus....* gnu/packages/golang.scm (go-github-com-prometheus-client-golang): Move from here ... * gnu/packages/prometheus.scm: ... to here. * gnu/packages/backup.scm: Add (gnu packages prometheus) module. * gnu/packages/golang-xyz.scm: Likewise. * gnu/packages/ipfs.scm: Likewise. * gnu/packages/irc.scm: Likewise. * gnu/packages/web.scm: Likewise. Change-Id: If3d78d31b1491f8a95616e59f50371c2914242d9 Sharlatan Hellseher 2024-07-24gnu: borg: Update to 1.4.0....* gnu/packages/backup.scm (borg): Update to 1.4.0. [source]: Remove obsolete snippet components. [arguments]: Export a newly required environment variable in the 'set-env' phase. Adjust the custom 'install-doc' phase to install miscellaneous documentation into a directory named after the package name and version. Change-Id: I688bb4e6c67506226418b6b4a47595f2a10c10ae Leo Famulari