From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rob Syme Subject: [PATCH] Upgrade ruby to 2.3.1 (including symlink patch) Date: Thu, 28 Apr 2016 12:06:05 +0800 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a1148578c5d0a69053183a680 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:39083) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1avdDf-0008DC-9D for guix-devel@gnu.org; Thu, 28 Apr 2016 00:06:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1avdDd-0000gK-S7 for guix-devel@gnu.org; Thu, 28 Apr 2016 00:06:27 -0400 Received: from mail-io0-x22f.google.com ([2607:f8b0:4001:c06::22f]:36749) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1avdDd-0000gE-L5 for guix-devel@gnu.org; Thu, 28 Apr 2016 00:06:25 -0400 Received: by mail-io0-x22f.google.com with SMTP id u185so76555523iod.3 for ; Wed, 27 Apr 2016 21:06:25 -0700 (PDT) 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" To: "guix-devel@gnu.org" --001a1148578c5d0a69053183a680 Content-Type: text/plain; charset=UTF-8 * 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 --001a1148578c5d0a69053183a680 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
* gnu/packages/patches/ruby-symlinkfix.patch: New patch to= fix issue #1448.
* gnu/packages/ruby.scm (ruby): Update to 2.3.1 includ= ing symlink patch.

---
=C2=A0gnu/packages/patches/ruby-symlinkfix= .patch | 53 ++++++++++++++++++++++++++++++
=C2=A0gnu/packages/ruby.scm = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0| =C2=A05 +--
=C2=A02 files changed, 56 insertions(+), 2 deletions(-)=
=C2=A0create 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..16b= eecc
--- /dev/null
+++ b/gnu/packages/patches/ruby-symlinkfix.patch@@ -0,0 +1,53 @@
+Fix symlinks to '..' to fix rubygems imprope= rly expanding symlinked
+paths. Without this fix, some gems fail to inst= all. This patch is applied in
+rubygems 2.5.2, but ruby version 2.3.1 bu= ndles an older version of rubygems
+(2.5.1).
+
+--- a/lib/rubygems= /package.rb
++++ b/lib/rubygems/package.rb
+@@ -383,7 +383,7 @@ def e= xtract_tar_gz io, destination_dir, pattern =3D "*" # :nodoc:
+= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 FileUtils.chmod entry.header.mode, dest= ination
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 end if entry.file?
+
+- =C2= =A0 =C2=A0 =C2=A0 =C2=A0File.symlink(install_location(entry.header.linkname= , destination_dir), destination) if entry.symlink?
++ =C2=A0 =C2=A0 =C2= =A0 =C2=A0File.symlink(entry.header.linkname, destination) if entry.symlink= ?
+
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 verbose destination
+ =C2=A0 =C2= =A0 =C2=A0 end
+diff --git a/test/rubygems/test_gem_package.rb b/test/ru= bygems/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
+ =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"#{@destination} i= s not allowed", e.message)
+ =C2=A0 end
+
+- =C2=A0def test_e= xtract_tar_gz_symlink_absolute
++ =C2=A0def test_extract_tar_gz_symlink_= relative_path
++ =C2=A0 =C2=A0skip 'symlink not supported' if Ge= m.win_platform?
++
+ =C2=A0 =C2=A0 package =3D Gem::Package.new @gem<= br>+
+ =C2=A0 =C2=A0 tgz_io =3D util_tar_gz do |tar|
+- =C2=A0 =C2=A0= =C2=A0tar.add_symlink 'code.rb', '/absolute.rb', 0644
+= + =C2=A0 =C2=A0 =C2=A0tar.add_file =C2=A0 =C2=A0'relative.rb', 0644= do |io| io.write 'hi' end
++ =C2=A0 =C2=A0 =C2=A0tar.mkdir =C2= =A0 =C2=A0 =C2=A0 'lib', =C2=A0 =C2=A0 =C2=A0 =C2=A0 0755
++ =C2= =A0 =C2=A0 =C2=A0tar.add_symlink 'lib/foo.rb', '../relative.rb&= #39;, 0644
+ =C2=A0 =C2=A0 end
+
+- =C2=A0 =C2=A0e =3D assert_rais= es Gem::Package::PathError do
+- =C2=A0 =C2=A0 =C2=A0package.extract_tar= _gz tgz_io, @destination
+- =C2=A0 =C2=A0end
++ =C2=A0 =C2=A0package.= extract_tar_gz tgz_io, @destination
+
+- =C2=A0 =C2=A0assert_equal(&q= uot;installing into parent path /absolute.rb of " +
+- =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "#{@destination} is not = allowed", e.message)
++ =C2=A0 =C2=A0extracted =3D File.join @desti= nation, 'lib/foo.rb'
++ =C2=A0 =C2=A0assert_path_exists extracte= d
++ =C2=A0 =C2=A0assert_equal '../relative.rb',
++ =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 File.readlink(extracted)++ =C2=A0 =C2=A0assert_equal 'hi',
++ =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 File.read(extracted)
+ =C2=A0 end
++ =C2=A0 def test_extract_tar_gz_directory
diff --git a/gnu/packages/r= uby.scm b/gnu/packages/ruby.scm
index bafa7e3..b8a6d01 100644
--- a/g= nu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -46,7 +46,7 @@=C2=A0(define-public ruby
=C2=A0 =C2=A0(package
=C2=A0 =C2=A0 =C2=A0= (name "ruby")
- =C2=A0 =C2=A0(version "2.3.0")
+ = =C2=A0 =C2=A0(version "2.3.1")
=C2=A0 =C2=A0 =C2=A0(source
= =C2=A0 =C2=A0 =C2=A0 (origin
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (method url-fet= ch)
@@ -55,8 +55,9 @@
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "/ruby-" ver= sion ".tar.xz"))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (sha256
=C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0(base32
- =C2=A0 =C2=A0 =C2=A0 =C2=A0 "= 15s0dsb5ynf3d2w5gzawnszq5594fqvapv2y7a0qw16przq5l4kh"))
+ =C2=A0 = =C2=A0 =C2=A0 =C2=A0 "0f3395q7pd2hrl2gv26bib80038sjawxgmhl9zn22fjs9m9v= a9b7"))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (modules '((guix build util= s)))
+ =C2=A0 =C2=A0 =C2=A0 (patches (search-patches "ruby-symlinkf= ix.patch"))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (snippet `(begin
=C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ;; Remove bu= ndled libffi
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 (delete-file-recursively
--
2.7.4
--001a1148578c5d0a69053183a680--