[arch-commits] Commit in ruby/repos (3 files)

Anatol Pomozov anatolik at archlinux.org
Wed Sep 30 22:13:09 UTC 2020


    Date: Wednesday, September 30, 2020 @ 22:13:09
  Author: anatolik
Revision: 397017

archrelease: copy trunk to testing-x86_64

Added:
  ruby/repos/testing-x86_64/
  ruby/repos/testing-x86_64/PKGBUILD
    (from rev 397016, ruby/trunk/PKGBUILD)
  ruby/repos/testing-x86_64/webrick.patch
    (from rev 397016, ruby/trunk/webrick.patch)

---------------+
 PKGBUILD      |  101 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 webrick.patch |   40 ++++++++++++++++++++++
 2 files changed, 141 insertions(+)

Copied: ruby/repos/testing-x86_64/PKGBUILD (from rev 397016, ruby/trunk/PKGBUILD)
===================================================================
--- testing-x86_64/PKGBUILD	                        (rev 0)
+++ testing-x86_64/PKGBUILD	2020-09-30 22:13:09 UTC (rev 397017)
@@ -0,0 +1,101 @@
+# Contributor: Thomas Dziedzic <gostrc at gmail.com>
+# Contributor: Allan McRae <allan at archlinux.org>
+# Contributor: John Proctor <jproctor at prium.net>
+# Contributor: Jeramy Rutley <jrutley at gmail.com>
+
+pkgname=(ruby ruby-docs)
+pkgver=2.7.1
+pkgrel=4
+arch=(x86_64)
+url='https://www.ruby-lang.org/en/'
+license=(BSD custom)
+depends=(libxcrypt)
+makedepends=(gdbm openssl libffi doxygen graphviz libyaml ttf-dejavu tk)
+options=(!emptydirs)
+source=(https://cache.ruby-lang.org/pub/ruby/${pkgver:0:3}/ruby-${pkgver}.tar.xz
+        webrick.patch) # simplified upstream patch https://github.com/ruby/ruby/commit/828c34e58b63d64558ec0f2d1d7ae401c5e6b21f
+sha512sums=('79f98b1ea98e0b10ec79da1883e8fc84d48ffe5c09ae945cbebde94365e35a589d919aac965f74d70ca7e21370ecee631ac5a8f9c4eac61d62f5aa629f27bf31'
+            '60688c02bdbed087dc41613e335abd5602964f13e0cdf900ed2f7a830eb4d10a93396e8ef6e87a5c17aa6c50f63098199aa729302c8e6cf44505eecec2aed9e2')
+
+prepare() {
+  cd ruby-${pkgver}
+  # remove bundled gems, we are going to ship them as separate packages
+  rm -rf gems/
+
+  patch -p1 < ../webrick.patch # FS#68051   CVE-2020-25613
+}
+
+build() {
+  cd ruby-${pkgver}
+
+  ./configure \
+    --prefix=/usr \
+    --sysconfdir=/etc \
+    --localstatedir=/var \
+    --sharedstatedir=/var/lib \
+    --libexecdir=/usr/lib/ruby \
+    --enable-shared \
+    --disable-rpath \
+    --with-dbm-type=gdbm_compat
+
+  make
+}
+
+check() {
+  cd ruby-${pkgver}
+
+  make test
+}
+
+package_ruby() {
+  pkgdesc='An object-oriented language for quick and easy programming'
+  depends=(gdbm openssl libffi libyaml gmp zlib rubygems ruby-irb)
+  optdepends=(
+      'ruby-docs: Ruby documentation'
+      'tk: for Ruby/TK'
+  )
+
+  cd ruby-${pkgver}
+
+  make DESTDIR="${pkgdir}" install-nodoc
+
+  install -D -m644 COPYING "${pkgdir}/usr/share/licenses/ruby/LICENSE"
+  install -D -m644 BSDL "${pkgdir}/usr/share/licenses/ruby/BSDL"
+
+  rubyver=${pkgver:0:3}.0
+
+  # remove rubygems as it shipped as a separate package
+  rm -r "${pkgdir}"/usr/lib/ruby/${rubyver}/{rubygems,rubygems.rb}
+  rm "${pkgdir}"/usr/bin/gem
+
+  # remove bundler as it shipped as a separate package
+  rm -r "${pkgdir}"/usr/lib/ruby/${rubyver}/{bundler,bundler.rb}
+  rm "${pkgdir}"/usr/bin/{bundle,bundler}
+  rm "${pkgdir}"/usr/lib/ruby/gems/${rubyver}/specifications/default/bundler-*.gemspec
+  rm "${pkgdir}"/usr/share/man/man1/{bundle,bundle-*}.1
+
+  # remove bundled rdoc gem
+  rm -r "${pkgdir}"/usr/lib/ruby/${rubyver}/{rdoc,rdoc.rb}
+  rm "${pkgdir}"/usr/bin/{rdoc,ri}
+  rm "${pkgdir}"/usr/lib/ruby/gems/${rubyver}/specifications/default/rdoc-*.gemspec
+
+  # remove irb as it is a separate package now
+  rm -r "${pkgdir}"/usr/lib/ruby/${rubyver}/{irb,irb.rb}
+  rm "${pkgdir}"/usr/bin/irb
+  rm "${pkgdir}"/usr/lib/ruby/gems/${rubyver}/specifications/default/irb-*.gemspec
+  rm "${pkgdir}"/usr/share/man/man1/irb.1
+
+  # remove all bundled gems to avoid conflicts with ruby-* Arch packages
+  rm -r "${pkgdir}"/usr/lib/ruby/gems/${rubyver}/gems/*
+}
+
+package_ruby-docs() {
+  pkgdesc='Documentation files for ruby'
+
+  cd ruby-${pkgver}
+
+  make DESTDIR="${pkgdir}" install-doc install-capi
+
+  install -D -m644 COPYING "${pkgdir}/usr/share/licenses/ruby-docs/LICENSE"
+  install -D -m644 BSDL "${pkgdir}/usr/share/licenses/ruby-docs/BSDL"
+}

Copied: ruby/repos/testing-x86_64/webrick.patch (from rev 397016, ruby/trunk/webrick.patch)
===================================================================
--- testing-x86_64/webrick.patch	                        (rev 0)
+++ testing-x86_64/webrick.patch	2020-09-30 22:13:09 UTC (rev 397017)
@@ -0,0 +1,40 @@
+From 828c34e58b63d64558ec0f2d1d7ae401c5e6b21f Mon Sep 17 00:00:00 2001
+From: nagachika <nagachika at ruby-lang.org>
+Date: Tue, 29 Sep 2020 22:46:14 +0900
+Subject: [PATCH] merge revision(s) d23d2f3f6fbb5d787b0dd80675c489a692be23e2:
+
+	[ruby/webrick] Make it more strict to interpret some headers
+
+	Some regexps were too tolerant.
+
+	https://github.com/ruby/webrick/commit/8946bb38b4
+---
+ lib/webrick/httprequest.rb | 6 +++---
+ version.h                  | 2 +-
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/lib/webrick/httprequest.rb b/lib/webrick/httprequest.rb
+index 87dc879175c0..6af0cee97dbf 100644
+--- a/lib/webrick/httprequest.rb
++++ b/lib/webrick/httprequest.rb
+@@ -226,9 +226,9 @@ def parse(socket=nil)
+         raise HTTPStatus::BadRequest, "bad URI `#{@unparsed_uri}'."
+       end
+ 
+-      if /close/io =~ self["connection"]
++      if /\Aclose\z/io =~ self["connection"]
+         @keep_alive = false
+-      elsif /keep-alive/io =~ self["connection"]
++      elsif /\Akeep-alive\z/io =~ self["connection"]
+         @keep_alive = true
+       elsif @http_version < "1.1"
+         @keep_alive = false
+@@ -503,7 +503,7 @@ def read_body(socket, block)
+       return unless socket
+       if tc = self['transfer-encoding']
+         case tc
+-        when /chunked/io then read_chunked(socket, block)
++        when /\Achunked\z/io then read_chunked(socket, block)
+         else raise HTTPStatus::NotImplemented, "Transfer-Encoding: #{tc}."
+         end
+       elsif self['content-length'] || @remaining_size



More information about the arch-commits mailing list