[arch-commits] Commit in vagrant/trunk (PKGBUILD ruby-2.7-fixes.patch)
Anatol Pomozov
anatolik at archlinux.org
Mon Mar 9 02:35:25 UTC 2020
Date: Monday, March 9, 2020 @ 02:35:24
Author: anatolik
Revision: 592735
upgpkg: vagrant 2.2.7-3: Add fix for ruby27 warnings
Added:
vagrant/trunk/ruby-2.7-fixes.patch
Modified:
vagrant/trunk/PKGBUILD
----------------------+
PKGBUILD | 11 +-
ruby-2.7-fixes.patch | 218 +++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 226 insertions(+), 3 deletions(-)
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2020-03-09 02:28:01 UTC (rev 592734)
+++ PKGBUILD 2020-03-09 02:35:24 UTC (rev 592735)
@@ -10,7 +10,7 @@
pkgname=vagrant
pkgver=2.2.7
-pkgrel=2
+pkgrel=3
pkgdesc="Build and distribute virtualized development environments"
arch=('x86_64')
url="https://vagrantup.com"
@@ -22,9 +22,12 @@
conflicts=('vagrant-substrate')
replaces=('vagrant-substrate')
source=($pkgname-$pkgver.tar.gz::https://github.com/mitchellh/$pkgname/archive/v$pkgver.tar.gz
- "git+https://github.com/mitchellh/vagrant-installers.git#commit=7b7fb86")
+ "git+https://github.com/mitchellh/vagrant-installers.git#commit=7b7fb86"
+ ruby-2.7-fixes.patch
+ )
md5sums=('45147c55d560f3c91654e2c5535e7f58'
- 'SKIP')
+ 'SKIP'
+ '2e987a1d46a4c36e3d33d9f5aec21424')
prepare() {
cd $pkgname-$pkgver
@@ -31,6 +34,8 @@
# relax ruby version requirements so this package can be built with the latest ruby
sed 's/s.required_ruby_version = "~> 2.4", "< 2.7"//' -i vagrant.gemspec
+
+ patch -p1 < ../ruby-2.7-fixes.patch
}
build() {
Added: ruby-2.7-fixes.patch
===================================================================
--- ruby-2.7-fixes.patch (rev 0)
+++ ruby-2.7-fixes.patch 2020-03-09 02:35:24 UTC (rev 592735)
@@ -0,0 +1,218 @@
+From 1ad9724c74d1b24d9a27fe18f03e8111d9f5ef61 Mon Sep 17 00:00:00 2001
+From: Anatol Pomozov <anatol.pomozov at gmail.com>
+Date: Sun, 8 Mar 2020 19:29:06 -0700
+Subject: [PATCH] Ruby 2.7 fixes
+
+Combination of upstream PRs from:
+
+https://github.com/hashicorp/vagrant/pull/11347
+https://github.com/hashicorp/vagrant/pull/11437
+https://github.com/hashicorp/vagrant/pull/11307
+---
+ bin/vagrant | 2 +-
+ lib/vagrant/action/builtin/box_add.rb | 9 +++++----
+ lib/vagrant/box.rb | 2 +-
+ lib/vagrant/bundler.rb | 2 +-
+ lib/vagrant/errors.rb | 2 +-
+ lib/vagrant/ui.rb | 10 +++++-----
+ lib/vagrant/util/downloader.rb | 5 +++--
+ plugins/kernel_v2/config/vm.rb | 2 +-
+ plugins/providers/virtualbox/action/forward_ports.rb | 2 +-
+ plugins/provisioners/shell/provisioner.rb | 2 +-
+ 10 files changed, 20 insertions(+), 18 deletions(-)
+
+diff --git a/bin/vagrant b/bin/vagrant
+index 0e6abdcef..b47557113 100755
+--- a/bin/vagrant
++++ b/bin/vagrant
+@@ -202,7 +202,7 @@ rescue Exception => e
+
+ if env
+ opts = { prefix: false }
+- env.ui.error e.message, opts if e.message
++ env.ui.error e.message, **opts if e.message
+ env.ui.machine("error-exit", e.class.to_s, e.message.to_s)
+ else
+ $stderr.puts "Vagrant failed to initialize at a very early stage:\n\n"
+diff --git a/lib/vagrant/action/builtin/box_add.rb b/lib/vagrant/action/builtin/box_add.rb
+index dcd3a8ce4..134ffe4fb 100644
+--- a/lib/vagrant/action/builtin/box_add.rb
++++ b/lib/vagrant/action/builtin/box_add.rb
+@@ -2,6 +2,7 @@ require "digest/sha1"
+ require "log4r"
+ require "pathname"
+ require "uri"
++require "cgi"
+
+ require "vagrant/box_metadata"
+ require "vagrant/util/downloader"
+@@ -44,7 +45,7 @@ module Vagrant
+ u = u.gsub("\\", "/")
+ if Util::Platform.windows? && u =~ /^[a-z]:/i
+ # On Windows, we need to be careful about drive letters
+- u = "file:///#{URI.escape(u)}"
++ u = "file:///#{CGI::escape(u)}"
+ end
+
+ if u =~ /^[a-z0-9]+:.*$/i && !u.start_with?("file://")
+@@ -53,9 +54,9 @@ module Vagrant
+ end
+
+ # Expand the path and try to use that, if possible
+- p = File.expand_path(URI.unescape(u.gsub(/^file:\/\//, "")))
++ p = File.expand_path(CGI::unescape(u.gsub(/^file:\/\//, "")))
+ p = Util::Platform.cygwin_windows_path(p)
+- next "file://#{URI.escape(p.gsub("\\", "/"))}" if File.file?(p)
++ next "file://#{p.gsub("\\", "/")}" if File.file?(p)
+
+ u
+ end
+@@ -494,7 +495,7 @@ module Vagrant
+ url ||= uri.opaque
+ #7570 Strip leading slash left in front of drive letter by uri.path
+ Util::Platform.windows? && url.gsub!(/^\/([a-zA-Z]:)/, '\1')
+- url = URI.unescape(url)
++ url = CGI::unescape(url)
+
+ begin
+ File.open(url, "r") do |f|
+diff --git a/lib/vagrant/box.rb b/lib/vagrant/box.rb
+index 2f12775f5..0ebeb6fdc 100644
+--- a/lib/vagrant/box.rb
++++ b/lib/vagrant/box.rb
+@@ -165,7 +165,7 @@ module Vagrant
+ version += ", " if version
+ version ||= ""
+ version += "> #{@version}"
+- md = self.load_metadata(download_options)
++ md = self.load_metadata(**download_options)
+ newer = md.version(version, provider: @provider)
+ return nil if !newer
+
+diff --git a/lib/vagrant/bundler.rb b/lib/vagrant/bundler.rb
+index 7ba48435f..62ac456f1 100644
+--- a/lib/vagrant/bundler.rb
++++ b/lib/vagrant/bundler.rb
+@@ -425,7 +425,7 @@ module Vagrant
+ runtime_dependencies.each { |d| gem d.name, *d.requirement.as_list }
+ # discover all the gems we have available
+ list = {}
+- directories = [Gem::Specification.default_specifications_dir]
++ directories = [Gem.default_specifications_dir]
+ Gem::Specification.find_all{true}.each do |spec|
+ list[spec.full_name] = spec
+ end
+diff --git a/lib/vagrant/errors.rb b/lib/vagrant/errors.rb
+index 90e5c42c1..8e29ebeeb 100644
+--- a/lib/vagrant/errors.rb
++++ b/lib/vagrant/errors.rb
+@@ -100,7 +100,7 @@ module Vagrant
+
+ def translate_error(opts)
+ return nil if !opts[:_key]
+- I18n.t("#{opts[:_namespace]}.#{opts[:_key]}", opts)
++ I18n.t("#{opts[:_namespace]}.#{opts[:_key]}", **opts)
+ end
+ end
+
+diff --git a/lib/vagrant/ui.rb b/lib/vagrant/ui.rb
+index ee3547fc8..76c3fbb6c 100644
+--- a/lib/vagrant/ui.rb
++++ b/lib/vagrant/ui.rb
+@@ -148,9 +148,9 @@ module Vagrant
+ # to `say`.
+ [:detail, :info, :warn, :error, :output, :success].each do |method|
+ class_eval <<-CODE
+- def #{method}(message, *args)
++ def #{method}(message, **args)
+ super(message)
+- say(#{method.inspect}, message, *args)
++ say(#{method.inspect}, message, **args)
+ end
+ CODE
+ end
+@@ -168,7 +168,7 @@ module Vagrant
+ opts[:prefix] = false if !opts.key?(:prefix)
+
+ # Output the data
+- say(:info, message, opts)
++ say(:info, message, **opts)
+
+ input = nil
+ if opts[:echo] || !@stdin.respond_to?(:noecho)
+@@ -179,10 +179,10 @@ module Vagrant
+
+ # Output a newline because without echo, the newline isn't
+ # echoed either.
+- say(:info, "\n", opts)
++ say(:info, "\n", **opts)
+ rescue Errno::EBADF
+ # This means that stdin doesn't support echoless input.
+- say(:info, "\n#{I18n.t("vagrant.stdin_cant_hide_input")}\n ", opts)
++ say(:info, "\n#{I18n.t("vagrant.stdin_cant_hide_input")}\n ", **opts)
+
+ # Ask again, with echo enabled
+ input = ask(message, opts.merge(echo: true))
+diff --git a/lib/vagrant/util/downloader.rb b/lib/vagrant/util/downloader.rb
+index 71c06769c..5c46d2cd2 100644
+--- a/lib/vagrant/util/downloader.rb
++++ b/lib/vagrant/util/downloader.rb
+@@ -1,4 +1,5 @@
+ require "uri"
++require "cgi"
+
+ require "log4r"
+ require "digest"
+@@ -41,8 +42,8 @@ module Vagrant
+ begin
+ url = URI.parse(@source)
+ if url.scheme && url.scheme.start_with?("http") && url.user
+- auth = "#{URI.unescape(url.user)}"
+- auth += ":#{URI.unescape(url.password)}" if url.password
++ auth = "#{CGI::unescape(url.user)}"
++ auth += ":#{CGI::unescape(url.password)}" if url.password
+ url.user = nil
+ url.password = nil
+ options[:auth] ||= auth
+diff --git a/plugins/kernel_v2/config/vm.rb b/plugins/kernel_v2/config/vm.rb
+index 7c0e4e423..a0389bb5e 100644
+--- a/plugins/kernel_v2/config/vm.rb
++++ b/plugins/kernel_v2/config/vm.rb
+@@ -376,7 +376,7 @@ module VagrantPlugins
+ prov.preserve_order = !!options.delete(:preserve_order) if \
+ options.key?(:preserve_order)
+ prov.run = options.delete(:run) if options.key?(:run)
+- prov.add_config(options, &block)
++ prov.add_config(**options, &block)
+ nil
+ end
+
+diff --git a/plugins/providers/virtualbox/action/forward_ports.rb b/plugins/providers/virtualbox/action/forward_ports.rb
+index aac663918..d62718a37 100644
+--- a/plugins/providers/virtualbox/action/forward_ports.rb
++++ b/plugins/providers/virtualbox/action/forward_ports.rb
+@@ -48,7 +48,7 @@ module VagrantPlugins
+ # bridged networking don't require port-forwarding and establishing
+ # forwarded ports on these attachment types has uncertain behaviour.
+ @env[:ui].detail(I18n.t("vagrant.actions.vm.forward_ports.forwarding_entry",
+- message_attributes))
++ **message_attributes))
+
+ # Verify we have the network interface to attach to
+ if !interfaces[fp.adapter]
+diff --git a/plugins/provisioners/shell/provisioner.rb b/plugins/provisioners/shell/provisioner.rb
+index 8175d82b7..726456fb3 100644
+--- a/plugins/provisioners/shell/provisioner.rb
++++ b/plugins/provisioners/shell/provisioner.rb
+@@ -53,7 +53,7 @@ module VagrantPlugins
+ options = {}
+ options[:color] = color if !config.keep_color
+
+- @machine.ui.detail(data.chomp, options)
++ @machine.ui.detail(data.chomp, **options)
+ end
+ end
+
+--
+2.25.1
+
More information about the arch-commits
mailing list