From 83305987401f215100847ad16a51716b8bcc7d7c Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Tue, 30 Sep 2025 16:02:27 +0900 Subject: [PATCH] tests/pack: Fix rpm tests. The rpm-for-tests would no longer build, due to the parent package having migrated to CMake. Use the --dbpath argument instead of a variant test package. * tests/pack.scm (rpm-for-tests): Delete variable. (rpm archive can be installed/uninstalled): Invoke rpm, not rpm-for-tests, but with the --dbpath location specified. Change-Id: I1b578db3ef8f1309c32c6ef92615814ca49fd22c --- tests/pack.scm | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/tests/pack.scm b/tests/pack.scm index ce94d9bc581..d0a1b72eb94 100644 --- a/tests/pack.scm +++ b/tests/pack.scm @@ -1,7 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2017-2021, 2023, 2024 Ludovic Courtès ;;; Copyright © 2018 Ricardo Wurmus -;;; Copyright © 2021, 2023 Maxim Cournoyer +;;; Copyright © 2021, 2023, 2025 Maxim Cournoyer ;;; Copyright © 2023 Oleg Pykhalov ;;; Copyright © 2024 Noé Lopez ;;; @@ -61,17 +61,6 @@ (define %ar-bootstrap %bootstrap-binutils) -;;; This is a variant of the RPM package configured so that its database can -;;; be created on a writable location readily available inside the build -;;; container ("/tmp"). -(define rpm-for-tests - (package - (inherit rpm) - (arguments (substitute-keyword-arguments (package-arguments rpm) - ((#:configure-flags flags '()) - #~(cons "--localstatedir=/tmp" - (delete "--localstatedir=/var" #$flags))))))) - (test-begin "pack") @@ -517,14 +506,15 @@ (use-modules (guix build utils)) (define fakeroot #+(file-append fakeroot "/bin/fakeroot")) - (define rpm #+(file-append rpm-for-tests "/bin/rpm")) - (mkdir-p "/tmp/lib/rpm") + (define rpm #+(file-append rpm "/bin/rpm")) + (define dbpath (string-append (getcwd) "/var/lib/rpm")) + (mkdir-p dbpath) ;; Install the RPM package. This causes RPM to validate the ;; signatures, header as well as the file digests, which ;; makes it a rather thorough test. (mkdir "test-prefix") - (invoke fakeroot rpm "--install" + (invoke fakeroot rpm "--dbpath" dbpath "--install" (string-append "--prefix=" (getcwd) "/test-prefix") #$rpm-pack) @@ -532,7 +522,8 @@ (invoke "./test-prefix/bin/guile" "--version") ;; Uninstall the RPM package. - (invoke fakeroot rpm "--erase" "guile-bootstrap") + (invoke fakeroot rpm "--dbpath" dbpath + "--erase" "guile-bootstrap") ;; Required so the above is run. (mkdir #$output))))))