>From 7646691c77c9a01e620e5f0c4695db8abb276863 Mon Sep 17 00:00:00 2001 From: Andy Patterson Date: Fri, 7 Oct 2016 03:19:26 -0400 Subject: [PATCH v3 12/12] gnu: ecl: Fix `truename' on long target files. When the target of a symbolic link exceeded 128 characters, `truename' would unexpectedly fail. * gnu/packages/patches/ecl-fix-si-readlink.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. --- gnu/local.mk | 1 + gnu/packages/lisp.scm | 4 +++- gnu/packages/patches/ecl-fix-si-readlink.patch | 20 ++++++++++++++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/ecl-fix-si-readlink.patch diff --git a/gnu/local.mk b/gnu/local.mk index 206b794..d057d20 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -497,6 +497,7 @@ dist_patch_DATA = \ %D%/packages/patches/doxygen-test.patch \ %D%/packages/patches/duplicity-piped-password.patch \ %D%/packages/patches/duplicity-test_selection-tmp.patch \ + %D%/packages/patches/ecl-fix-si-readlink.patch \ %D%/packages/patches/elfutils-tests-ptrace.patch \ %D%/packages/patches/elixir-disable-failing-tests.patch \ %D%/packages/patches/einstein-build.patch \ diff --git a/gnu/packages/lisp.scm b/gnu/packages/lisp.scm index 458862c..7068800 100644 --- a/gnu/packages/lisp.scm +++ b/gnu/packages/lisp.scm @@ -130,7 +130,9 @@ interface to the Tk widget system.") (snippet ;; Add ecl-bundle-systems to 'default-system-source-registry'. `(substitute* "contrib/asdf/asdf.lisp" - ,@(asdf-substitutions name))))) + ,@(asdf-substitutions name))) + (patches + (search-patches "ecl-fix-si-readlink.patch")))) (build-system gnu-build-system) ;; src/configure uses 'which' to confirm the existence of 'gzip'. (native-inputs `(("which" ,which))) diff --git a/gnu/packages/patches/ecl-fix-si-readlink.patch b/gnu/packages/patches/ecl-fix-si-readlink.patch new file mode 100644 index 0000000..5cd0efc --- /dev/null +++ b/gnu/packages/patches/ecl-fix-si-readlink.patch @@ -0,0 +1,20 @@ +--- a/src/c/unixfsys.d 2016-02-25 02:06:19.000000000 -0500 ++++ b/src/c/unixfsys.d 2016-10-07 00:50:20.172282246 -0400 +@@ -236,15 +236,15 @@ static cl_object + si_readlink(cl_object filename) { + /* Given a filename which is a symlink, this routine returns + * the value of this link in the form of a pathname. */ +- cl_index size = 128, written; ++ cl_index size = 0, written; + cl_object output, kind; + do { ++ size += 128; + output = ecl_alloc_adjustable_base_string(size); + ecl_disable_interrupts(); + written = readlink((char*)filename->base_string.self, + (char*)output->base_string.self, size); + ecl_enable_interrupts(); +- size += 256; + } while (written == size); + output->base_string.self[written] = '\0'; + kind = file_kind((char*)output->base_string.self, FALSE); -- 2.10.0