summary refs log tree commit diff
path: root/gnu/packages
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2015-02-27 14:37:03 +0100
committerLudovic Courtès <ludo@gnu.org>2015-02-27 15:08:37 +0100
commite8c9f0498f9f3ead4ea345d49f1c5e630ff158f8 (patch)
treea728ddeebf736ca5115f0e38203ebd602c2ab720 /gnu/packages
parent50915d2c2ed050c40db51988106ad46d61039d56 (diff)
downloadguix-e8c9f0498f9f3ead4ea345d49f1c5e630ff158f8.tar.gz
gnu: gettext: Set encoding to ISO-8859-1 when modifying files.
* gnu/packages/gettext.scm (gnu-gettext)[arguments] <patch-tests>: Set
  %default-port-encoding.  Fixes test failures at
  <http://hydra.gnu.org/build/262586>.
Diffstat (limited to 'gnu/packages')
-rw-r--r--gnu/packages/gettext.scm30
1 files changed, 17 insertions, 13 deletions
diff --git a/gnu/packages/gettext.scm b/gnu/packages/gettext.scm
index af8876f9d6..27b5fb5f55 100644
--- a/gnu/packages/gettext.scm
+++ b/gnu/packages/gettext.scm
@@ -51,21 +51,25 @@
                  'check 'patch-tests
                  (lambda* (#:key inputs #:allow-other-keys)
                    (let* ((bash (which "sh")))
-                     (substitute*
-                         (find-files "gettext-tools/tests"
-                                     "^(lang-sh|msg(exec|filter)-[0-9])")
-                       (("#![[:blank:]]/bin/sh")
-                        (format #f "#!~a" bash)))
+                     ;; Some of the files we're patching are
+                     ;; ISO-8859-1-encoded, so choose it as the default
+                     ;; encoding so the byte encoding is preserved.
+                     (with-fluids ((%default-port-encoding #f))
+                       (substitute*
+                           (find-files "gettext-tools/tests"
+                                       "^(lang-sh|msg(exec|filter)-[0-9])")
+                         (("#![[:blank:]]/bin/sh")
+                          (format #f "#!~a" bash)))
 
-                     (substitute* (cons "gettext-tools/src/msginit.c"
-                                        (find-files "gettext-tools/gnulib-tests"
-                                                    "posix_spawn"))
-                       (("/bin/sh")
-                        bash))
+                       (substitute* (cons "gettext-tools/src/msginit.c"
+                                          (find-files "gettext-tools/gnulib-tests"
+                                                      "posix_spawn"))
+                         (("/bin/sh")
+                          bash))
 
-                     (substitute* "gettext-tools/src/project-id"
-                       (("/bin/pwd")
-                        "pwd"))))
+                       (substitute* "gettext-tools/src/project-id"
+                         (("/bin/pwd")
+                          "pwd")))))
                  %standard-phases)
 
        ;; When tests fail, we want to know the details.