From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id yOg0FaWH3WMuUgAAbAwnHQ (envelope-from ) for ; Fri, 03 Feb 2023 23:16:05 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id EAtdFKWH3WPhkAAAG6o9tA (envelope-from ) for ; Fri, 03 Feb 2023 23:16:05 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 005D912FA9 for ; Fri, 3 Feb 2023 23:16:04 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pO4L0-0007BA-0M; Fri, 03 Feb 2023 17:15:18 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pO4Km-00076F-EV for guix-patches@gnu.org; Fri, 03 Feb 2023 17:15:04 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pO4Kl-00032S-VN for guix-patches@gnu.org; Fri, 03 Feb 2023 17:15:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pO4Kl-00057s-Qr for guix-patches@gnu.org; Fri, 03 Feb 2023 17:15:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#61255] [PATCH 4/5] tests: pack: Fix indentation. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 03 Feb 2023 22:15:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61255 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 61255@debbugs.gnu.org Cc: Maxim Cournoyer Received: via spool by 61255-submit@debbugs.gnu.org id=B61255.167546249519639 (code B ref 61255); Fri, 03 Feb 2023 22:15:03 +0000 Received: (at 61255) by debbugs.gnu.org; 3 Feb 2023 22:14:55 +0000 Received: from localhost ([127.0.0.1]:40091 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pO4Kc-00056g-Ib for submit@debbugs.gnu.org; Fri, 03 Feb 2023 17:14:55 -0500 Received: from mail-qt1-f178.google.com ([209.85.160.178]:46781) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pO4KZ-000569-Iq for 61255@debbugs.gnu.org; Fri, 03 Feb 2023 17:14:53 -0500 Received: by mail-qt1-f178.google.com with SMTP id g8so7168358qtq.13 for <61255@debbugs.gnu.org>; Fri, 03 Feb 2023 14:14:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=2WA28OG7KuMKicNv+26GLxGfN39FAoFy9wRJf4/yw/c=; b=ioO26jGAOKR2duczsWp3/xkKDKzjUTq1ddElGoNV6h3I7cAJnj7PyZF4YUdtliGS9o 5vf7NZB54ctFmrM2Q1VQAqwXvct1uQy6SP4t87TJesJ54rGVoQoNcSGjpjsUb0VyQRFn LdjSJwUiYYk0a5dif1yxPQKuaqxNZhR73Nvr63LyNhM5doQkuZZlnKaeqYfVGSz0tHEh QcKk6qqUk4UonbfHYKamW3Hm53ZDIqnHKS4c2FdlIWZJ0WzwGP9nNR6y8+4p6kaDoesg IV1KJf/YJgLdp+xIipJ/H1QkkCft2Q01d4IFPp/5ZjMN5IerzYxEP5XHn/waFwrskSKj jUcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2WA28OG7KuMKicNv+26GLxGfN39FAoFy9wRJf4/yw/c=; b=gssKxjjSVopcnSb9LwpcDfkX0ufLqymzj04K9jwH2jRCJKvonqo1iS9Tx2a4v/MKKv PYxLQjI7xs5pNeyKpwgqg3RCovh1TZ5gx2fazknUfn0R3Ujo1wbMhDHThoY9p/0ntqAv wyznYDnJlcjdlSit85JGQRxIn4TcXy4aUOLUMVGx5WG8ar5KGdb0h+rY+/J/0So5jUUc QIhFJsroeVjhD2bGVMDq+XFNK99MkoS4pcrHdfPXtrmK6uBoN6Lf5f7N4g2PXot080Wj 2g5dhwLQmKd2+Q2wYyE6JGDSEm22euhKL0658IUzXzPFx2HZ0ZQqF0/OAej3Jw/mLSR8 90UA== X-Gm-Message-State: AO0yUKU77nFcCGnvr3fYqZKXnw8tnQpnuv/XdL3aO3mTC37ZIaMs+ef2 wO4Y04vwtJaT9xHtBMZiLxP5WunVRCw= X-Google-Smtp-Source: AK7set+suworZ1bpzQZc75LCN2YgZScSUrqgU0JSEYnuKjQqZkqXIGyFkrjIMXVJ3p5Txd2gEkA+vA== X-Received: by 2002:ac8:5955:0:b0:3b6:2bbf:581e with SMTP id 21-20020ac85955000000b003b62bbf581emr20779861qtz.35.1675462485795; Fri, 03 Feb 2023 14:14:45 -0800 (PST) Received: from localhost.localdomain (dsl-10-136-177.b2b2c.ca. [72.10.136.177]) by smtp.gmail.com with ESMTPSA id bp41-20020a05620a45a900b00725d8d6983asm1430594qkb.61.2023.02.03.14.14.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Feb 2023 14:14:45 -0800 (PST) From: Maxim Cournoyer Date: Fri, 3 Feb 2023 17:14:07 -0500 Message-Id: <20230203221409.15886-5-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230203221409.15886-2-maxim.cournoyer@gmail.com> References: <20230203221409.15886-2-maxim.cournoyer@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1675462565; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=2WA28OG7KuMKicNv+26GLxGfN39FAoFy9wRJf4/yw/c=; b=KI4e/rA6Ce50mERpBfJ5YqyU2nzOFAbA5wblcUavTAwijIJ8sCJTUYOLy7MPJJlbze3HQ0 q0RjtIIV6k+6jRFH3tbgP4zTePvfc8FVFYcbohKk16AAk9uK2HDCq2SNCUGSv5pF+uselA PK6J9gGQR3H1NDN2HIDCcApBaQ7z9JyNls4Z6KNOY08Ru0pcgCPYOmxuarGBEbtoVsP/Ah qbgNyv04eC1LmRcwISAJOxl9qB15RCMJW115VUSuoq5kukmQso+f2lVVEWuUxHZnLx2azf UzuzncVHs8R0VRBxF6P5mPKVvzbbwexUoMafyi2jERcF0lvipAGSbBOTQereTg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=ioO26jGA; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1675462565; a=rsa-sha256; cv=none; b=UVGiVFrChTOtQpK30FG41GAUZ7xVKKG7YrOFV90NRNrAHsq50g8SIIeglnbMYnlZuYanx6 bAkCCdfeETZcd/+1vOe91WM3iq6R/YnA5DavfC+VTn4sHwM97XL2Msqpy5IhooROTzcAoo Av9py1TiHi4rt2q3xxU1CvHOhPdOkgmXjcsEQdia/NbZ3rSS4bl8yUqjIFT5c6FqNLMgH3 jpGnX10SWUzEPi8FAtmqIRuNyqYVGPHgR3p1xH4fsyQdtCYktfPB9LHbJfra4sJgceEVhL 7bvcOemILnBC8uCSoSMRa1ehaqkg2++hiXqRk5zftb/HU7GpuDYBtpSD7k8g8w== X-Migadu-Queue-Id: 005D912FA9 X-Migadu-Scanner: scn0.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=ioO26jGA; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 4.32 X-Spam-Score: 4.32 X-TUID: rJWOh/oeko9F * tests/pack.scm: Fix indentation. --- tests/pack.scm | 274 ++++++++++++++++++++++++------------------------- 1 file changed, 137 insertions(+), 137 deletions(-) diff --git a/tests/pack.scm b/tests/pack.scm index a4c388d93e..2e3b9d0ca4 100644 --- a/tests/pack.scm +++ b/tests/pack.scm @@ -75,43 +75,43 @@ (define %ar-bootstrap %bootstrap-binutils) #:compressor %gzip-compressor #:archiver %tar-bootstrap)) (check (gexp->derivation - "check-tarball" - (with-imported-modules '((guix build utils)) - #~(begin - (use-modules (guix build utils) - (srfi srfi-1)) - - (define store - ;; The unpacked store. - (string-append "." (%store-directory) "/")) - - (define (canonical? file) - ;; Return #t if FILE is read-only and its mtime is 1. - (let ((st (lstat file))) - (or (not (string-prefix? store file)) - (eq? 'symlink (stat:type st)) - (and (= 1 (stat:mtime st)) - (zero? (logand #o222 - (stat:mode st))))))) - - (define bin - (string-append "." #$profile "/bin")) - - (setenv "PATH" - (string-append #$%tar-bootstrap "/bin")) - (system* "tar" "xvf" #$tarball) - (mkdir #$output) - (exit - (and (file-exists? (string-append bin "/guile")) - (file-exists? store) - (every canonical? - (find-files "." (const #t) - #:directories? #t)) - (string=? (string-append #$%bootstrap-guile "/bin") - (readlink bin)) - (string=? (string-append ".." #$profile - "/bin/guile") - (readlink "bin/Guile"))))))))) + "check-tarball" + (with-imported-modules '((guix build utils)) + #~(begin + (use-modules (guix build utils) + (srfi srfi-1)) + + (define store + ;; The unpacked store. + (string-append "." (%store-directory) "/")) + + (define (canonical? file) + ;; Return #t if FILE is read-only and its mtime is 1. + (let ((st (lstat file))) + (or (not (string-prefix? store file)) + (eq? 'symlink (stat:type st)) + (and (= 1 (stat:mtime st)) + (zero? (logand #o222 + (stat:mode st))))))) + + (define bin + (string-append "." #$profile "/bin")) + + (setenv "PATH" + (string-append #$%tar-bootstrap "/bin")) + (system* "tar" "xvf" #$tarball) + (mkdir #$output) + (exit + (and (file-exists? (string-append bin "/guile")) + (file-exists? store) + (every canonical? + (find-files "." (const #t) + #:directories? #t)) + (string=? (string-append #$%bootstrap-guile "/bin") + (readlink bin)) + (string=? (string-append ".." #$profile + "/bin/guile") + (readlink "bin/Guile"))))))))) (built-derivations (list check)))) ;; The following test needs guile-sqlite3, libgcrypt, etc. as a consequence of @@ -132,16 +132,16 @@ (define bin (tarball (self-contained-tarball "tar-pack" profile #:localstatedir? #t)) (check (gexp->derivation - "check-tarball" - #~(let ((bin (string-append "." #$profile "/bin"))) - (setenv "PATH" - (string-append #$%tar-bootstrap "/bin")) - (system* "tar" "xvf" #$tarball) - (mkdir #$output) - (exit - (and (file-exists? "var/guix/db/db.sqlite") - (string=? (string-append #$%bootstrap-guile "/bin") - (readlink bin)))))))) + "check-tarball" + #~(let ((bin (string-append "." #$profile "/bin"))) + (setenv "PATH" + (string-append #$%tar-bootstrap "/bin")) + (system* "tar" "xvf" #$tarball) + (mkdir #$output) + (exit + (and (file-exists? "var/guix/db/db.sqlite") + (string=? (string-append #$%bootstrap-guile "/bin") + (readlink bin)))))))) (built-derivations (list check)))) (unless store (test-skip 1)) @@ -155,44 +155,44 @@ (define bin (tarball (self-contained-tarball "tar-pack" tree #:localstatedir? #t)) (check (gexp->derivation - "check-tarball" - (with-extensions (list guile-sqlite3 guile-gcrypt) - (with-imported-modules (source-module-closure - '((guix store database))) - #~(begin - (use-modules (guix store database) - (rnrs io ports) - (srfi srfi-1)) - - (define (valid-file? basename data) - (define file - (string-append "./" #$tree "/" basename)) - - (string=? (call-with-input-file (pk 'file file) - get-string-all) - data)) - - (setenv "PATH" - (string-append #$%tar-bootstrap "/bin")) - (system* "tar" "xvf" #$tarball) - - (sql-schema - #$(local-file (search-path %load-path - "guix/store/schema.sql"))) - (with-database "var/guix/db/db.sqlite" db - ;; Make sure non-ASCII file names are properly - ;; handled. - (setenv "GUIX_LOCPATH" - #+(file-append glibc-utf8-locales - "/lib/locale")) - (setlocale LC_ALL "en_US.utf8") - - (mkdir #$output) - (exit - (and (every valid-file? - '("α" "λ") - '("alpha" "lambda")) - (integer? (path-id db #$tree))))))))))) + "check-tarball" + (with-extensions (list guile-sqlite3 guile-gcrypt) + (with-imported-modules (source-module-closure + '((guix store database))) + #~(begin + (use-modules (guix store database) + (rnrs io ports) + (srfi srfi-1)) + + (define (valid-file? basename data) + (define file + (string-append "./" #$tree "/" basename)) + + (string=? (call-with-input-file (pk 'file file) + get-string-all) + data)) + + (setenv "PATH" + (string-append #$%tar-bootstrap "/bin")) + (system* "tar" "xvf" #$tarball) + + (sql-schema + #$(local-file (search-path %load-path + "guix/store/schema.sql"))) + (with-database "var/guix/db/db.sqlite" db + ;; Make sure non-ASCII file names are properly + ;; handled. + (setenv "GUIX_LOCPATH" + #+(file-append glibc-utf8-locales + "/lib/locale")) + (setlocale LC_ALL "en_US.utf8") + + (mkdir #$output) + (exit + (and (every valid-file? + '("α" "λ") + '("alpha" "lambda")) + (integer? (path-id db #$tree))))))))))) (built-derivations (list check)))) (unless store (test-skip 1)) @@ -207,33 +207,33 @@ (define file #:symlinks '(("/bin/Guile" -> "bin/guile")) #:localstatedir? #t)) (check (gexp->derivation - "check-tarball" - (with-imported-modules '((guix build utils)) - #~(begin - (use-modules (guix build utils) - (ice-9 match)) - - (define bin - (string-append "." #$profile "/bin")) - - (setenv "PATH" (string-append #$%tar-bootstrap "/bin")) - (mkdir "base") - (with-directory-excursion "base" - (invoke "tar" "xvf" #$tarball)) - - (match (find-files "base" "layer.tar") - ((layer) - (invoke "tar" "xvf" layer))) - - (when - (and (file-exists? (string-append bin "/guile")) - (file-exists? "var/guix/db/db.sqlite") - (file-is-directory? "tmp") - (string=? (string-append #$%bootstrap-guile "/bin") - (pk 'binlink (readlink bin))) - (string=? (string-append #$profile "/bin/guile") - (pk 'guilelink (readlink "bin/Guile")))) - (mkdir #$output))))))) + "check-tarball" + (with-imported-modules '((guix build utils)) + #~(begin + (use-modules (guix build utils) + (ice-9 match)) + + (define bin + (string-append "." #$profile "/bin")) + + (setenv "PATH" (string-append #$%tar-bootstrap "/bin")) + (mkdir "base") + (with-directory-excursion "base" + (invoke "tar" "xvf" #$tarball)) + + (match (find-files "base" "layer.tar") + ((layer) + (invoke "tar" "xvf" layer))) + + (when + (and (file-exists? (string-append bin "/guile")) + (file-exists? "var/guix/db/db.sqlite") + (file-is-directory? "tmp") + (string=? (string-append #$%bootstrap-guile "/bin") + (pk 'binlink (readlink bin))) + (string=? (string-append #$profile "/bin/guile") + (pk 'guilelink (readlink "bin/Guile")))) + (mkdir #$output))))))) (built-derivations (list check)))) (unless store (test-skip 1)) @@ -248,31 +248,31 @@ (define bin #:symlinks '(("/bin" -> "bin")) #:localstatedir? #t)) (check (gexp->derivation - "check-tarball" - (with-imported-modules '((guix build utils)) - #~(begin - (use-modules (guix build utils) - (ice-9 match)) - - (define bin - (string-append "." #$profile "/bin")) - - (setenv "PATH" - (string-append #$squashfs-tools "/bin")) - (invoke "unsquashfs" #$image) - (with-directory-excursion "squashfs-root" - (when (and (file-exists? (string-append bin - "/guile")) - (file-exists? "var/guix/db/db.sqlite") - (string=? (string-append #$%bootstrap-guile "/bin") - (pk 'binlink (readlink bin))) - - ;; This is a relative symlink target. - (string=? (string-drop - (string-append #$profile "/bin") - 1) - (pk 'guilelink (readlink "bin")))) - (mkdir #$output)))))))) + "check-tarball" + (with-imported-modules '((guix build utils)) + #~(begin + (use-modules (guix build utils) + (ice-9 match)) + + (define bin + (string-append "." #$profile "/bin")) + + (setenv "PATH" + (string-append #$squashfs-tools "/bin")) + (invoke "unsquashfs" #$image) + (with-directory-excursion "squashfs-root" + (when (and (file-exists? (string-append bin + "/guile")) + (file-exists? "var/guix/db/db.sqlite") + (string=? (string-append #$%bootstrap-guile "/bin") + (pk 'binlink (readlink bin))) + + ;; This is a relative symlink target. + (string=? (string-drop + (string-append #$profile "/bin") + 1) + (pk 'guilelink (readlink "bin")))) + (mkdir #$output)))))))) (built-derivations (list check)))) (unless store (test-skip 1)) -- 2.39.1