From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Thompson, David" Subject: Re: [PATCH] gnu: Add ruby-rack. Date: Mon, 7 Sep 2015 13:45:28 -0400 Message-ID: References: <87twr9ykn7.fsf@izanagi.i-did-not-set--mail-host-address--so-tickle-me> <87613mtdyh.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:49698) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZ0U0-00087A-UA for guix-devel@gnu.org; Mon, 07 Sep 2015 13:45:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZZ0Tx-0000Uf-37 for guix-devel@gnu.org; Mon, 07 Sep 2015 13:45:32 -0400 Received: from mail-yk0-f176.google.com ([209.85.160.176]:33383) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZ0Tw-0000UT-W1 for guix-devel@gnu.org; Mon, 07 Sep 2015 13:45:29 -0400 Received: by ykei199 with SMTP id i199so87057709yke.0 for ; Mon, 07 Sep 2015 10:45:28 -0700 (PDT) In-Reply-To: <87613mtdyh.fsf@gnu.org> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: =?UTF-8?Q?Ludovic_Court=C3=A8s?= Cc: guix-devel On Mon, Sep 7, 2015 at 12:02 PM, Ludovic Court=C3=A8s wrote: > David Thompson skribis: > >> From a740a5ca98c02bd0e9c792677dfc8ff8464c8365 Mon Sep 17 00:00:00 2001 >> From: David Thompson >> Date: Fri, 4 Sep 2015 16:47:52 -0400 >> Subject: [PATCH] gnu: Add ruby-rack. >> >> * gnu/packages/ruby.scm (ruby-rack): New variable. > > [...] > >> + (add-before 'check 'fix-tests >> + (lambda _ >> + ;; A few of the tests use the length of a file on disk for >> + ;; Content-Length and Content-Range headers. However, thi= s file >> + ;; has a shebang in it which an earlier phase patches, gro= wing >> + ;; the file size from 193 to 239 bytes. >> + (substitute* '("test/spec_file.rb") >> + (("193") "239") > > I think this phase should use the actual length of the shebang, in case > the store is not at /gnu/store, with something like: > > (- (string-length (which "ruby")) (string-length "/usr/bin/ruby")) > > Could you look into it? Good point. It was easy to implement, too: (let ((size-diff (- (string-length (which "ruby")) (string-length "/usr/bin/env ruby")))) (substitute* '("test/spec_file.rb") (("193") (number->string (+ 193 size-diff))) (("bytes(.)22-33" all delimiter) (string-append "bytes" delimiter (number->string (+ 22 size-diff)) "-" (number->string (+ 33 size-diff)))))) Pushed, thanks! - Dave