aboutsummaryrefslogtreecommitdiff
From 1da99396dc65993ba34ac0370ca5d6acda6a3322 Mon Sep 17 00:00:00 2001
From: Mark H Weaver <mhw@netris.org>
Date: Sun, 18 Mar 2018 07:02:37 -0400
Subject: [PATCH] Add support for gdbm-1.14.

As of gdbm-1.14, 'gdbm_errno' no longer exists as a binary interface.
It has been replaced by 'gdbm_errno_location', a function that returns
int*.  We now use this new interface if it's available.
---
 gdbm.scm | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/gdbm.scm b/gdbm.scm
index b92992f..4d38cc3 100644
--- a/gdbm.scm
+++ b/gdbm.scm
@@ -17,6 +17,9 @@
 ;; You should have received a copy of the GNU General Public License
 ;; along with this program. If not, see <http://www.gnu.org/licenses/>.
 
+;; Modified by Mark H Weaver <mhw@netris.org> in March 2018 to support
+;; gdbm-1.14 with its new 'gdbm_errno_location' interface.
+
 (define-module (gdbm)
   #:use-module (system foreign)
   #:use-module (rnrs bytevectors)
@@ -151,10 +154,21 @@
 
 ;;; errors
 
-(define %errno (dynamic-pointer "gdbm_errno" libgdbm))
+(define %list-int
+  (list int))
+
+(define (dereference-int ptr)
+  (apply (lambda (errno) errno)
+         (parse-c-struct ptr %list-int)))
+
+(define %errno-location
+  (or (false-if-exception
+       (let ((func (dynamic-func "gdbm_errno_location" libgdbm)))
+         (pointer->procedure '* func '())))
+      (const (dynamic-pointer "gdbm_errno" libgdbm))))
 
 (define (gdbm-errno)
-  (pointer-address (dereference-pointer %errno)))
+  (dereference-int (%errno-location)))
 
 (define (gdbm-error)
   (error (pointer->string (%gdbm-strerror (gdbm-errno)))))
-- 
2.16.2

git-authenticate.sh, tests/guix-graph.sh, tests/guix-hash.sh, tests/guix-home.sh, tests/guix-pack-relocatable.sh, tests/guix-pack.sh, tests/guix-package-aliases.sh, tests/guix-package-net.sh, tests/guix-package.sh, tests/guix-refresh.sh, tests/guix-shell.sh, tests/guix-style.sh, tests/guix-system.sh: Replace uses of '! ...' with '... && false' or `test ! ...` as appropriate. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Eric Bavier 2023-02-27pack: Adjust shell tests to read-only tarball root....Fixes <https://issues.guix.gnu.org/61853>. Fixes a regression introduced in 68380db4c40a2ee1156349a87254fd7b1f1a52d5, whereby the tarball's root entry is now read-only, due to the creation of "profile-directory" in the store. * tests/guix-pack.sh: Remove and recreate $test_directory before transformation option test. * tests/guix-pack-relocatable.sh: Add "chmod +w $test_directory" lines before attempts to write to it. Ludovic Courtès 2022-11-15shell: Detect --symlink spec problems early....* guix/scripts/pack.scm (symlink-spec-option-parser): Remove extraneous char-set. Raise an exception when the target is an absolute file name. (guix-pack): Move with-error-handler earlier. * guix/scripts/shell.scm (guix-shell): Likewise. * guix/scripts/environment.scm (guix-environment): Wrap the whole guix-environment* call with the with-error-handling handler. * tests/guix-environment-container.sh: Add tests. * tests/guix-pack.sh: Adjust symlink spec. Maxim Cournoyer 2022-05-25tests: Fix wrong target triplets....* tests/gexp.scm (ungexp + ungexp-native, input list + ungexp-native, input list splicing + ungexp-native-splicing, gexp list splicinng + ungexp-splicing, gexp->derivation, cross-compilation, gexp->derivation, ungexp-native, gexp->derivation, ungexp + ungexp-native, gexp->derivation, ungexp-native + composed gexps): Change mips64el-linux to mips64el-linux-gnu. * tests/guix-pack.sh: Change arm-unknown-linux-gnueabihf to arm-linux-gnueabihf. Signed-off-by: Mathieu Othacehe <othacehe@gnu.org> Josselin Poiret 2022-02-18profiles: 'profile-derivation' rejects unsupported packages....Previously user-facing commands would happily start building packages even if they do not support that system. With this change, all the user-facing commands reject unsupported packages without going further. * guix/profiles.scm (profile-derivation): Add #:allow-unsupported-packages?. Define 'check-supported-packages' and honor #:allow-unsupported-packages?. * tests/guix-pack.sh, tests/guix-package.sh, tests/guix-shell.sh: Ensure that unsupported packages are rejected. * tests/guix-system.sh: Pass "--system=armhf-linux" when attempting to build gnu/system/examples/asus-c201.tmpl. Ludovic Courtès