This patch should fix the failing rdup build.  I'm sending it to the list
because I wonder if there's a better way to handle the missing script
shebangs?

`~Eric
From d27203fa893bba8c263aa519124af3cbb3178cee Mon Sep 17 00:00:00 2001
From: Eric Bavier <bav...@member.fsf.org>
Date: Wed, 4 Jun 2014 23:45:31 -0500
Subject: [PATCH] gnu: rdup: Fix check phase.

* gnu/packages/backup.scm (rdup) [arguments]: Add pre-check phase.
---
 gnu/packages/backup.scm |   23 ++++++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/backup.scm b/gnu/packages/backup.scm
index 069baa8..c1d4828 100644
--- a/gnu/packages/backup.scm
+++ b/gnu/packages/backup.scm
@@ -21,6 +21,7 @@
   #:use-module ((guix licenses)
                 #:renamer (symbol-prefix-proc 'license:))
   #:use-module (guix download)
+  #:use-module (guix build utils)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system python)
   #:use-module (gnu packages)
@@ -199,7 +200,27 @@ random access nor for in-place modification.")
                  (lambda _
                    (substitute* "GNUmakefile"
                      (("^(CFLAGS=.*)-Werror" _ front) front)))
-                 %standard-phases)))
+                 (alist-cons-before
+                  'check 'pre-check
+                  (lambda _
+                    (setenv "HOME" (getcwd))
+                    (substitute* "testsuite/rdup/rdup.rdup-up-t-with-file.exp"
+                       (("/bin/cat") (which "cat")))
+                    ;; Some test scripts are missing shebangs, which cause
+                    ;; "could not execute" errors.  Add shebangs.
+                    (for-each
+                     (lambda (testscript)
+                       (with-atomic-file-replacement
+                        (string-append "testsuite/rdup/" testscript)
+                        (lambda (in out)
+                          (begin
+                            (format out "#!~a\n" (which "sh"))
+                            (dump-port in out)))))
+                     '("rdup.hardlink.helper"
+                       "rdup.hardlink-strip.helper"
+                       "rdup.hardlink-strip2.helper"
+                       "rdup.pipeline.helper")))
+                  %standard-phases))))
     (home-page "http://archive.miek.nl/projects/rdup/index.html";)
     (synopsis "Provide a list of files to backup")
     (description
-- 
1.7.10.4

Reply via email to