all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Rob Syme <rob.syme@gmail.com>
To: "guix-devel@gnu.org" <guix-devel@gnu.org>
Subject: [PATCH] Upgrade ruby to 2.3.1 (including symlink patch)
Date: Thu, 28 Apr 2016 12:06:05 +0800	[thread overview]
Message-ID: <CAEf4xgfaxG3r6Kcq_JkcWx12o63Jv7iFSEGfaKxLPXnOsEzkdg@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 3494 bytes --]

* gnu/packages/patches/ruby-symlinkfix.patch: New patch to fix issue #1448.
* gnu/packages/ruby.scm (ruby): Update to 2.3.1 including symlink patch.

---
 gnu/packages/patches/ruby-symlinkfix.patch | 53
++++++++++++++++++++++++++++++
 gnu/packages/ruby.scm                      |  5 +--
 2 files changed, 56 insertions(+), 2 deletions(-)
 create mode 100644 gnu/packages/patches/ruby-symlinkfix.patch

diff --git a/gnu/packages/patches/ruby-symlinkfix.patch
b/gnu/packages/patches/ruby-symlinkfix.patch
new file mode 100644
index 0000000..16beecc
--- /dev/null
+++ b/gnu/packages/patches/ruby-symlinkfix.patch
@@ -0,0 +1,53 @@
+Fix symlinks to '..' to fix rubygems improperly expanding symlinked
+paths. Without this fix, some gems fail to install. This patch is applied
in
+rubygems 2.5.2, but ruby version 2.3.1 bundles an older version of rubygems
+(2.5.1).
+
+--- a/lib/rubygems/package.rb
++++ b/lib/rubygems/package.rb
+@@ -383,7 +383,7 @@ def extract_tar_gz io, destination_dir, pattern = "*"
# :nodoc:
+           FileUtils.chmod entry.header.mode, destination
+         end if entry.file?
+
+-        File.symlink(install_location(entry.header.linkname,
destination_dir), destination) if entry.symlink?
++        File.symlink(entry.header.linkname, destination) if entry.symlink?
+
+         verbose destination
+       end
+diff --git a/test/rubygems/test_gem_package.rb
b/test/rubygems/test_gem_package.rb
+index 7848bc2..f287bd3 100644
+--- a/test/rubygems/test_gem_package.rb
++++ b/test/rubygems/test_gem_package.rb
+@@ -428,19 +428,25 @@ def test_extract_tar_gz_absolute
+                  "#{@destination} is not allowed", e.message)
+   end
+
+-  def test_extract_tar_gz_symlink_absolute
++  def test_extract_tar_gz_symlink_relative_path
++    skip 'symlink not supported' if Gem.win_platform?
++
+     package = Gem::Package.new @gem
+
+     tgz_io = util_tar_gz do |tar|
+-      tar.add_symlink 'code.rb', '/absolute.rb', 0644
++      tar.add_file    'relative.rb', 0644 do |io| io.write 'hi' end
++      tar.mkdir       'lib',         0755
++      tar.add_symlink 'lib/foo.rb', '../relative.rb', 0644
+     end
+
+-    e = assert_raises Gem::Package::PathError do
+-      package.extract_tar_gz tgz_io, @destination
+-    end
++    package.extract_tar_gz tgz_io, @destination
+
+-    assert_equal("installing into parent path /absolute.rb of " +
+-                 "#{@destination} is not allowed", e.message)
++    extracted = File.join @destination, 'lib/foo.rb'
++    assert_path_exists extracted
++    assert_equal '../relative.rb',
++                 File.readlink(extracted)
++    assert_equal 'hi',
++                 File.read(extracted)
+   end
+
+   def test_extract_tar_gz_directory
diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index bafa7e3..b8a6d01 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -46,7 +46,7 @@
 (define-public ruby
   (package
     (name "ruby")
-    (version "2.3.0")
+    (version "2.3.1")
     (source
      (origin
        (method url-fetch)
@@ -55,8 +55,9 @@
                            "/ruby-" version ".tar.xz"))
        (sha256
         (base32
-         "15s0dsb5ynf3d2w5gzawnszq5594fqvapv2y7a0qw16przq5l4kh"))
+         "0f3395q7pd2hrl2gv26bib80038sjawxgmhl9zn22fjs9m9va9b7"))
        (modules '((guix build utils)))
+       (patches (search-patches "ruby-symlinkfix.patch"))
        (snippet `(begin
                    ;; Remove bundled libffi
                    (delete-file-recursively
--
2.7.4

[-- Attachment #2: Type: text/html, Size: 4223 bytes --]

             reply	other threads:[~2016-04-28  4:06 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-28  4:06 Rob Syme [this message]
2016-04-28  5:19 ` [PATCH] Upgrade ruby to 2.3.1 (including symlink patch) Ricardo Wurmus
2016-04-28  5:26   ` Ben Woodcroft
2016-04-28  6:06     ` Rob Syme
2016-04-28  6:27     ` Ricardo Wurmus
2016-04-28 11:56       ` Ben Woodcroft
2016-04-29 23:52         ` Ben Woodcroft
2016-04-30  6:32           ` Ricardo Wurmus
2016-04-30  6:35             ` Rob Syme

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAEf4xgfaxG3r6Kcq_JkcWx12o63Jv7iFSEGfaKxLPXnOsEzkdg@mail.gmail.com \
    --to=rob.syme@gmail.com \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.