unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] gnu: rdup: Fix check phase.
@ 2014-06-07  4:26 Eric Bavier
  2014-06-07 13:55 ` Ludovic Courtès
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Bavier @ 2014-06-07  4:26 UTC (permalink / raw)
  To: guix-devel


[-- Attachment #1.1: Type: text/plain, Size: 162 bytes --]

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

[-- Attachment #1.2: Type: text/html, Size: 215 bytes --]

[-- Attachment #2: 0001-gnu-rdup-Fix-check-phase.patch --]
[-- Type: text/x-patch, Size: 2273 bytes --]

From d27203fa893bba8c263aa519124af3cbb3178cee Mon Sep 17 00:00:00 2001
From: Eric Bavier <bavier@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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] gnu: rdup: Fix check phase.
  2014-06-07  4:26 [PATCH] gnu: rdup: Fix check phase Eric Bavier
@ 2014-06-07 13:55 ` Ludovic Courtès
  0 siblings, 0 replies; 2+ messages in thread
From: Ludovic Courtès @ 2014-06-07 13:55 UTC (permalink / raw)
  To: Eric Bavier; +Cc: guix-devel

Eric Bavier <ericbavier@gmail.com> skribis:

> This patch should fix the failing rdup build.

Seems to me that the test suite was bound to fail in a chroot setup, no?

> I'm sending it to the list because I wonder if there's a better way to
> handle the missing script shebangs?

[...]

> +                 (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")))

That looks like the right approach to me.

It would be even nicer to make it a ‘snippet’ in the ‘origin’ structure;
the only difference is that the snippet would use “#!/bin/sh” (that
would later be patched in the patch-shebangs anyway.)  Same for
s,/bin/cat,cat,g.

The advantage is that ‘guix build -S’ would return something equivalent
to what we’re actually building.

Could you try that?

Thanks,
Ludo’.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-06-07 13:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-07  4:26 [PATCH] gnu: rdup: Fix check phase Eric Bavier
2014-06-07 13:55 ` Ludovic Courtès

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).