From bf688f2182719181e9d72051be2d0b091f83baaa Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 27 Jul 2017 21:08:42 +0000 Subject: [PATCH 01/83] - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild --- vagrant.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vagrant.spec b/vagrant.spec index a957766..c649708 100644 --- a/vagrant.spec +++ b/vagrant.spec @@ -4,7 +4,7 @@ Name: vagrant Version: 1.9.1 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Build and distribute virtualized development environments Group: Development/Languages License: MIT @@ -308,6 +308,9 @@ end %changelog +* Thu Jul 27 2017 Fedora Release Engineering +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + * Tue Feb 28 2017 Vít Ondruch - 1.9.1-2 - Obsolete vagrant-atomic, since it is now merged in Vagrant. From 42da19c59a173d0b2cbe54249e8054fe3b9a2462 Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Thu, 20 Jul 2017 14:56:25 +0200 Subject: [PATCH 02/83] Update to Vagrant 1.9.8. Remove Nokogiri dependency. Use current vagrant-spec. Use unrestricted version for rubygem(rspec) BuildRequire (RSpec 3 as of now). Add rubygem(rspec-its) BuildRequire. --- .gitignore | 4 ++ sources | 4 +- vagrant-1.8.1-disable-winrm-tests.patch | 12 ++-- ...ch => vagrant-1.9.8-fix-dependencies.patch | 58 +++++++++++-------- vagrant.spec | 19 +++--- 5 files changed, 56 insertions(+), 41 deletions(-) rename vagrant-1.9.1-fix-dependencies.patch => vagrant-1.9.8-fix-dependencies.patch (56%) diff --git a/.gitignore b/.gitignore index 2e313d3..fec04bd 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,7 @@ /vagrant-1.8.6.tar.gz /vagrant-1.8.7.tar.gz /vagrant-1.9.1.tar.gz +/vagrant-1.9.7.tar.gz +/vagrant-spec-2f0fb10862b2d19861c584be9d728080ba1f5d33.tar.gz +/vagrant-1.9.8.tar.gz +/vagrant-spec-e623a5694912c539ac2657e38a372d5e8c93441d.tar.gz diff --git a/sources b/sources index 5600481..eeb2cc8 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (vagrant-1.9.1.tar.gz) = 07ea6e2d881806ce61395a30abdaa7b4f7c2c39bb909d6c6e0aa14101945a9a26078ed18ebb8e238d97f05ee060564fb290615ac4868b80ee29b64b88a666452 -SHA512 (vagrant-spec-9bba7e1228379c0a249a06ce76ba8ea7d276afbe.tar.gz) = eda90b5e05c04c7c690bf4579931a0aa2a418ca6f3f1f9b0c18770e4d09fcea2f081f817604ed73c84cb33c437674e315b0ecbdfa7dc24ca94713bb179cb3544 +SHA512 (vagrant-1.9.8.tar.gz) = d22cc0a6800aa5ef84085c750f5ec8729f7b3adefd9a5df1a1fcaf60d1219e781869ede4f57ce4fdeb269224603dfc3a8024545a0250ebd9e144745ce9aa670b +SHA512 (vagrant-spec-e623a5694912c539ac2657e38a372d5e8c93441d.tar.gz) = dd480f06b3be740f368354a3d15bf4bba2982d72c6368c10b72596e8263c2c2fb5179c07f8aea8d9e77e9e2b7792e6f8562a9abb3c2e8861969effb5825a908c diff --git a/vagrant-1.8.1-disable-winrm-tests.patch b/vagrant-1.8.1-disable-winrm-tests.patch index 95192cc..ed8b9a3 100644 --- a/vagrant-1.8.1-disable-winrm-tests.patch +++ b/vagrant-1.8.1-disable-winrm-tests.patch @@ -2,7 +2,7 @@ diff --git a/test/unit/plugins/provisioners/ansible/provisioner_test.rb b/test/u index 31354a7..f2dfd0f 100644 --- a/test/unit/plugins/provisioners/ansible/provisioner_test.rb +++ b/test/unit/plugins/provisioners/ansible/provisioner_test.rb -@@ -498,55 +498,6 @@ VF +@@ -497,55 +497,6 @@ VF end end @@ -31,13 +31,13 @@ index 31354a7..f2dfd0f 100644 - - it "generates an inventory with winrm connection settings" do - -- expect(Vagrant::Util::Subprocess).to receive(:execute).with { |*args| +- expect(Vagrant::Util::Subprocess).to receive(:execute).with(any_args) { |*args| - expect(config.inventory_path).to be_nil -- expect(File.exists?(generated_inventory_file)).to be_true +- expect(File.exists?(generated_inventory_file)).to be(true) - inventory_content = File.read(generated_inventory_file) - - expect(inventory_content).to include("machine1 ansible_connection=winrm ansible_ssh_host=127.0.0.1 ansible_ssh_port=55986 ansible_ssh_user='winner' ansible_ssh_pass='winword'\n") -- } +- }.and_return(default_execute_result) - end - - describe "with force_remote_user option disabled" do @@ -46,12 +46,12 @@ index 31354a7..f2dfd0f 100644 - end - - it "doesn't set the ansible remote user in inventory and use '--user' argument with the vagrant ssh username" do -- expect(Vagrant::Util::Subprocess).to receive(:execute).with { |*args| +- expect(Vagrant::Util::Subprocess).to receive(:execute).with(any_args) { |*args| - inventory_content = File.read(generated_inventory_file) - - expect(inventory_content).to include("machine1 ansible_connection=winrm ansible_ssh_host=127.0.0.1 ansible_ssh_port=55986 ansible_ssh_pass='winword'\n") - expect(args).to include("--user=testuser") -- } +- }.and_return(default_execute_result) - end - end - end diff --git a/vagrant-1.9.1-fix-dependencies.patch b/vagrant-1.9.8-fix-dependencies.patch similarity index 56% rename from vagrant-1.9.1-fix-dependencies.patch rename to vagrant-1.9.8-fix-dependencies.patch index 1548a3e..6081fe5 100644 --- a/vagrant-1.9.1-fix-dependencies.patch +++ b/vagrant-1.9.8-fix-dependencies.patch @@ -1,13 +1,12 @@ -From 8d5d208fbc4a9b87c6f1f9991dbbf65d5cb5bfbb Mon Sep 17 00:00:00 2001 -From: Tomas Hrcka -Date: Wed, 27 Jan 2016 10:20:34 +0100 -Subject: [PATCH] fix dependencies +From 7486aa2ce950f55a4be9049d514c412d7e45ddef Mon Sep 17 00:00:00 2001 +From: Pavel Valena +Date: Thu, 20 Jul 2017 15:01:06 +0200 +Subject: [PATCH] Fix dependencies for Vagrant 1.9.7. --- - lib/vagrant/bundler.rb | 2 +- - lib/vagrant/util/downloader.rb | 5 +++-- - vagrant.gemspec | 41 ++++++++++++++++++++--------------------- - 3 files changed, 24 insertions(+), 24 deletions(-) + lib/vagrant/util/downloader.rb | 5 +++-- + vagrant.gemspec | 23 +++++++++++++---------- + 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/lib/vagrant/util/downloader.rb b/lib/vagrant/util/downloader.rb index 03e6238..9a02a85 100644 @@ -26,33 +25,42 @@ index 03e6238..9a02a85 100644 return [options, subprocess_options] diff --git a/vagrant.gemspec b/vagrant.gemspec -index 078add3..d1dd7bd 100644 +index c92ca17..aeee52f 100644 --- a/vagrant.gemspec +++ b/vagrant.gemspec -@@ -22,23 +22,27 @@ Gem::Specification.new do |s| +@@ -12,31 +12,34 @@ Gem::Specification.new do |s| + s.summary = "Build and distribute virtualized development environments." + s.description = "Vagrant is a tool for building and distributing virtualized development environments." + +- s.required_ruby_version = "~> 2.2", "< 2.4" ++ s.required_ruby_version = "~> 2.2" + s.required_rubygems_version = ">= 1.3.6" + s.rubyforge_project = "vagrant" + +- s.add_dependency "childprocess", "~> 0.6.0" ++ s.add_dependency "childprocess", "~> 0.5.0" + s.add_dependency "erubis", "~> 2.7.0" + s.add_dependency "i18n", ">= 0.6.0", "<= 0.8.0" s.add_dependency "listen", "~> 3.1.5" s.add_dependency "hashicorp-checkpoint", "~> 0.1.1" s.add_dependency "log4r", "~> 1.1.9", "< 1.1.11" -- s.add_dependency "net-ssh", "~> 3.0.1" -+ s.add_dependency "net-ssh", ">= 3.0" +- s.add_dependency "net-ssh", "~> 4.1.0" ++ s.add_dependency "net-ssh", ">= 4.1.0" s.add_dependency "net-sftp", "~> 2.1" -- s.add_dependency "net-scp", "~> 1.1.0" +- s.add_dependency "net-scp", "~> 1.2.0" - s.add_dependency "rb-kqueue", "~> 0.2.0" -+ s.add_dependency "net-scp", ">= 1.1.0" -+ # Remove BSD specific dependency. ++ s.add_dependency "net-scp", ">= 1.2.0" ++ # Remove Windows specific dependency. + # s.add_dependency "rb-kqueue", "~> 0.2.0" s.add_dependency "rest-client", ">= 1.6.0", "< 3.0" - s.add_dependency "wdm", "~> 0.1.0" -- s.add_dependency "winrm", "~> 1.6" -- s.add_dependency "winrm-fs", "~> 0.3.0" -+ # Remove Windows specific dependency. +- s.add_dependency "winrm", "~> 2.1" +- s.add_dependency "winrm-fs", "~> 1.0" +- s.add_dependency "winrm-elevated", "~> 1.1" + # s.add_dependency "wdm", "~> 0.1.0" -+ # s.add_dependency "winrm", "~> 1.6" -+ # s.add_dependency "winrm-fs", "~> 0.3.0" - - # We lock this down to avoid compilation issues. -- s.add_dependency "nokogiri", "= 1.6.7.1" -+ s.add_dependency "nokogiri" ++ # s.add_dependency "winrm", "~> 2.1" ++ # s.add_dependency "winrm-fs", "~> 1.0" ++ # s.add_dependency "winrm-elevated", "~> 1.1" # NOTE: The ruby_dep gem is an implicit dependency from the listen gem. Later versions # of the ruby_dep gem impose an aggressive constraint on the required ruby version (>= 2.2.5). @@ -66,5 +74,5 @@ index 078add3..d1dd7bd 100644 # Constraint rake to properly handle deprecated method usage # from within rspec -- -2.5.0 +2.7.5 diff --git a/vagrant.spec b/vagrant.spec index c649708..95ddab2 100644 --- a/vagrant.spec +++ b/vagrant.spec @@ -1,10 +1,10 @@ %global bashcompletion_dir %(pkg-config --variable=completionsdir bash-completion 2> /dev/null || :) -%global vagrant_spec_commit 9bba7e1228379c0a249a06ce76ba8ea7d276afbe +%global vagrant_spec_commit e623a5694912c539ac2657e38a372d5e8c93441d Name: vagrant -Version: 1.9.1 -Release: 3%{?dist} +Version: 1.9.8 +Release: 1%{?dist} Summary: Build and distribute virtualized development environments Group: Development/Languages License: MIT @@ -14,7 +14,7 @@ Source0: https://github.com/mitchellh/%{name}/archive/v%{version}/%{name}-%{vers Source1: binstub # The library has no official release yet. But since it is just test # dependency, it should be fine to include the source right here. -# wget https://github.com/mitchellh/vagrant-spec/archive/9bba7e1228379c0a249a06ce76ba8ea7d276afbe/vagrant-spec-9bba7e1228379c0a249a06ce76ba8ea7d276afbe.tar.gz +# wget https://github.com/mitchellh/vagrant-spec/archive/2f0fb10862b2d19861c584be9d728080ba1f5d33/vagrant-spec-2f0fb10862b2d19861c584be9d728080ba1f5d33.tar.gz Source2: https://github.com/mitchellh/%{name}-spec/archive/%{vagrant_spec_commit}/%{name}-spec-%{vagrant_spec_commit}.tar.gz # Monkey-patching needed for Vagrant to work until the respective patches # for RubyGems and Bundler are in place @@ -24,7 +24,7 @@ Source4: macros.vagrant # fails on older Fedoras. %{?load:%{SOURCE4}} -Patch0: vagrant-1.9.1-fix-dependencies.patch +Patch0: vagrant-1.9.8-fix-dependencies.patch # Disable ansible winrm tests Patch1: vagrant-1.8.1-disable-winrm-tests.patch @@ -52,7 +52,6 @@ Requires: rubygem(log4r) >= 1.1.9 Requires: rubygem(log4r) < 1.1.11 Requires: rubygem(net-ssh) >= 3.0 Requires: rubygem(net-scp) >= 1.1.0 -Requires: rubygem(nokogiri) >= 1.6 Requires: rubygem(net-sftp) >= 2.1 Requires: rubygem(net-sftp) < 3 Requires: rubygem(rest-client) < 3.0 @@ -71,11 +70,11 @@ BuildRequires: rubygem(hashicorp-checkpoint) BuildRequires: rubygem(log4r) BuildRequires: rubygem(net-ssh) BuildRequires: rubygem(net-scp) -BuildRequires: rubygem(nokogiri) BuildRequires: rubygem(i18n) BuildRequires: rubygem(json) BuildRequires: rubygem(erubis) -BuildRequires: rubygem(rspec) < 3 +BuildRequires: rubygem(rspec) +BuildRequires: rubygem(rspec-its) BuildRequires: rubygem(net-sftp) BuildRequires: rubygem(rest-client) BuildRequires: rubygem(thor) @@ -308,6 +307,10 @@ end %changelog +* Thu Aug 24 2017 Pavel Valena - 1.9.8-1 +- Update to Vagrant 1.9.8 (rhbz#1427505). +- Remove Nokogiri dependency. + * Thu Jul 27 2017 Fedora Release Engineering - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild From 9c727af07eb9a4b8fb82cb41aab3e67bd02aa15f Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Mon, 28 Aug 2017 17:38:33 +0200 Subject: [PATCH 03/83] Fix typos in binstub. --- binstub | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/binstub b/binstub index 2891527..9a4c71f 100644 --- a/binstub +++ b/binstub @@ -1,11 +1,11 @@ #!/usr/bin/env bash # # This is a wrapper to properly execute Vagrant within the embedded -# Vagrant installation directory. This sets up proper environmental variables +# Vagrant installation directory. This sets up proper environment variables # so that everything loads and compiles to proper directories. # Export gem paths so that we use the isolated gems. -# TODO: Should be repalced from .spec file. +# TODO: Should be replaced from .spec file. # ruby -e "print Gem.path.join(':')" export GEM_PATH="/usr/share/gems:/usr/share/vagrant/gems" @@ -22,7 +22,7 @@ export GEM_HOME="$VAGRANT_HOME/gems" # SSL certs export SSL_CERT_FILE="${SSL_CERT_FILE:-/etc/pki/tls/cert.pem}" -# Export an enviromental variable to say we're in a Vagrant +# Export an enviroment variable to say we're in a Vagrant # installer created environment. export VAGRANT_INSTALLER_ENV=1 # This is currently used only in Vagrant::Plugin::Manager.system_plugins_file @@ -35,7 +35,7 @@ export VAGRANT_INSTALLER_VERSION="2" # because uname dependencies can conflict on some platforms. OS=$(uname -s 2>/dev/null) -# Export the OS as an environmental variable that Vagrant can access +# Export the OS as an environment variable that Vagrant can access # so that it can behave better. export VAGRANT_DETECTED_OS="${OS}" From dfbe70f6ed7a9736ca05ef77104f65ff40ec2c7a Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Mon, 28 Aug 2017 17:45:25 +0200 Subject: [PATCH 04/83] Use VAGRANT_PREFERRED_PROVIDERS in binstub instead of VAGRANT_DEFAULT_PROVIDER. To support docker provider(also enables preset in Vagrantfile). https://bugzilla.redhat.com/show_bug.cgi?id=1444492 --- binstub | 12 +++++++++--- vagrant.spec | 1 + 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/binstub b/binstub index 9a4c71f..1e98928 100644 --- a/binstub +++ b/binstub @@ -4,6 +4,11 @@ # Vagrant installation directory. This sets up proper environment variables # so that everything loads and compiles to proper directories. +# Load defaults, especially VAGRANT_PREFERRED_PROVIDERS +if [ -r /etc/default/vagrant ]; then + source /etc/default/vagrant +fi + # Export gem paths so that we use the isolated gems. # TODO: Should be replaced from .spec file. # ruby -e "print Gem.path.join(':')" @@ -42,10 +47,11 @@ export VAGRANT_DETECTED_OS="${OS}" # Export the VAGRANT_EXECUTABLE so that pre-rubygems can optimize a bit export VAGRANT_EXECUTABLE="${VAGRANT_INSTALLER_EMBEDDED_DIR}/gems/bin/vagrant" -# libvirt provider as a default -if [ -z $VAGRANT_DEFAULT_PROVIDER ]; then - export VAGRANT_DEFAULT_PROVIDER=libvirt +# Set providers' preferred order(priority) if not already set +if [ -z ${VAGRANT_PREFERRED_PROVIDERS+empty} ]; then + VAGRANT_PREFERRED_PROVIDERS=libvirt,docker fi +export VAGRANT_PREFERRED_PROVIDERS # Call the actual Vagrant bin with our arguments exec ruby "${VAGRANT_EXECUTABLE}" "$@" diff --git a/vagrant.spec b/vagrant.spec index 95ddab2..0593e7e 100644 --- a/vagrant.spec +++ b/vagrant.spec @@ -310,6 +310,7 @@ end * Thu Aug 24 2017 Pavel Valena - 1.9.8-1 - Update to Vagrant 1.9.8 (rhbz#1427505). - Remove Nokogiri dependency. +- Use VAGRANT_PREFERRED_PROVIDERS in binstub instead of VAGRANT_DEFAULT_PROVIDER. * Thu Jul 27 2017 Fedora Release Engineering - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild From b2a86b6f732aa21016301b3322330ca01a60c35a Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Mon, 4 Sep 2017 17:53:23 +0200 Subject: [PATCH 05/83] binstub: set VAGRANT_HOME in better way; use /bin/bash directly --- binstub | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/binstub b/binstub index 1e98928..cebe8fa 100644 --- a/binstub +++ b/binstub @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/usr/bin/bash # # This is a wrapper to properly execute Vagrant within the embedded # Vagrant installation directory. This sets up proper environment variables @@ -18,9 +18,7 @@ export GEM_PATH="/usr/share/gems:/usr/share/vagrant/gems" # # This needs to be set because Bundler includes gem paths # from RubyGems' Gem.paths. -if [ -z $VAGRANT_HOME ]; then - VAGRANT_HOME=$(eval echo "~/.vagrant.d") -fi +VAGRANT_HOME=${VAGRANT_HOME:-~/.vagrant.d} export GEM_HOME="$VAGRANT_HOME/gems" From 363de6e1ca0ae4cfafd58b4341d9d4b57ca6ccbd Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Mon, 4 Sep 2017 18:09:54 +0200 Subject: [PATCH 06/83] Use system certificates- split to standalone patch Extracted from vagrant-1.9.1-fix-dependencies.patch at commit 630247626bf1353c463184f1bca6c59a246d33e2 --- vagrant-1.9.8-fix-dependencies.patch | 21 ++-------------- vagrant-1.9.8-use-system-certificates.patch | 27 +++++++++++++++++++++ vagrant.spec | 4 +++ 3 files changed, 33 insertions(+), 19 deletions(-) create mode 100644 vagrant-1.9.8-use-system-certificates.patch diff --git a/vagrant-1.9.8-fix-dependencies.patch b/vagrant-1.9.8-fix-dependencies.patch index 6081fe5..f1796bf 100644 --- a/vagrant-1.9.8-fix-dependencies.patch +++ b/vagrant-1.9.8-fix-dependencies.patch @@ -4,26 +4,9 @@ Date: Thu, 20 Jul 2017 15:01:06 +0200 Subject: [PATCH] Fix dependencies for Vagrant 1.9.7. --- - lib/vagrant/util/downloader.rb | 5 +++-- - vagrant.gemspec | 23 +++++++++++++---------- - 2 files changed, 16 insertions(+), 12 deletions(-) + vagrant.gemspec | 23 +++++++++++++---------- + 1 file changed, 13 insertions(+), 10 deletions(-) -diff --git a/lib/vagrant/util/downloader.rb b/lib/vagrant/util/downloader.rb -index 03e6238..9a02a85 100644 ---- a/lib/vagrant/util/downloader.rb -+++ b/lib/vagrant/util/downloader.rb -@@ -297,8 +297,9 @@ module Vagrant - # If we're in Vagrant, then we use the packaged CA bundle - if Vagrant.in_installer? - subprocess_options[:env] ||= {} -- subprocess_options[:env]["CURL_CA_BUNDLE"] = -- File.expand_path("cacert.pem", ENV["VAGRANT_INSTALLER_EMBEDDED_DIR"]) -+ #Use system certificates. -+ #subprocess_options[:env]["CURL_CA_BUNDLE"] = -+ # File.expand_path("cacert.pem", ENV["VAGRANT_INSTALLER_EMBEDDED_DIR"]) - end - - return [options, subprocess_options] diff --git a/vagrant.gemspec b/vagrant.gemspec index c92ca17..aeee52f 100644 --- a/vagrant.gemspec diff --git a/vagrant-1.9.8-use-system-certificates.patch b/vagrant-1.9.8-use-system-certificates.patch new file mode 100644 index 0000000..1e73c65 --- /dev/null +++ b/vagrant-1.9.8-use-system-certificates.patch @@ -0,0 +1,27 @@ +From 7486aa2ce950f55a4be9049d514c412d7e45ddef Mon Sep 17 00:00:00 2001 +From: Pavel Valena +Date: Thu, 20 Jul 2017 15:01:06 +0200 +Subject: [PATCH] Use system certificates + +--- + lib/vagrant/util/downloader.rb | 5 +++-- + 1 files changed, 3 insertions(+), 2 deletions(-) + +diff --git a/lib/vagrant/util/downloader.rb b/lib/vagrant/util/downloader.rb +index 03e6238..9a02a85 100644 +--- a/lib/vagrant/util/downloader.rb ++++ b/lib/vagrant/util/downloader.rb +@@ -297,8 +297,9 @@ module Vagrant + # If we're in Vagrant, then we use the packaged CA bundle + if Vagrant.in_installer? + subprocess_options[:env] ||= {} +- subprocess_options[:env]["CURL_CA_BUNDLE"] = +- File.expand_path("cacert.pem", ENV["VAGRANT_INSTALLER_EMBEDDED_DIR"]) ++ #Use system certificates. ++ #subprocess_options[:env]["CURL_CA_BUNDLE"] = ++ # File.expand_path("cacert.pem", ENV["VAGRANT_INSTALLER_EMBEDDED_DIR"]) + end + + return [options, subprocess_options] +-- +2.5.0 diff --git a/vagrant.spec b/vagrant.spec index 0593e7e..9f6c641 100644 --- a/vagrant.spec +++ b/vagrant.spec @@ -33,6 +33,9 @@ Patch1: vagrant-1.8.1-disable-winrm-tests.patch # https://github.com/mitchellh/vagrant/pull/8284 Patch2: vagrant-1.9.1-Fix-Ruby-2.4-compatibility.patch +# Use system certificates(split to standalone patch) +Patch3: vagrant-1.9.8-use-system-certificates.patch + Requires: ruby(release) Requires: ruby(rubygems) >= 1.3.6 # Explicitly specify MRI, since Vagrant does not work with JRuby ATM. @@ -112,6 +115,7 @@ Documentation for %{name}. %patch0 -p1 %patch1 -p1 %patch2 -p1 +%patch3 -p1 %build gem build %{name}.gemspec From 5953c4abc2e279134075011d04be9fec3b47d303 Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Wed, 6 Sep 2017 14:32:01 +0200 Subject: [PATCH 07/83] Update dependencies to reflect .gemspec Except for rubygem(childproccess). https://bugzilla.redhat.com/show_bug.cgi?id=1427505#c28 --- vagrant.spec | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/vagrant.spec b/vagrant.spec index 9f6c641..154cfb0 100644 --- a/vagrant.spec +++ b/vagrant.spec @@ -41,23 +41,16 @@ Requires: ruby(rubygems) >= 1.3.6 # Explicitly specify MRI, since Vagrant does not work with JRuby ATM. Requires: ruby Requires: rubygem(hashicorp-checkpoint) >= 0.1.1 -Requires: rubygem(hashicorp-checkpoint) < 0.2 Requires: rubygem(childprocess) >= 0.5.0 -Requires: rubygem(childprocess) < 0.6 Requires: rubygem(erubis) >= 2.7.0 -Requires: rubygem(erubis) < 2.8 Requires: rubygem(i18n) >= 0.6.0 -Requires: rubygem(i18n) <= 0.8.0 Requires: rubygem(json) Requires: rubygem(listen) >= 3.1.5 -Requires: rubygem(listen) < 3.2 Requires: rubygem(log4r) >= 1.1.9 -Requires: rubygem(log4r) < 1.1.11 -Requires: rubygem(net-ssh) >= 3.0 -Requires: rubygem(net-scp) >= 1.1.0 +Requires: rubygem(net-ssh) >= 4.1.0 +Requires: rubygem(net-scp) >= 1.2.0 Requires: rubygem(net-sftp) >= 2.1 -Requires: rubygem(net-sftp) < 3 -Requires: rubygem(rest-client) < 3.0 +Requires: rubygem(rest-client) >= 1.6.0 Requires: bsdtar Requires: curl @@ -315,6 +308,7 @@ end - Update to Vagrant 1.9.8 (rhbz#1427505). - Remove Nokogiri dependency. - Use VAGRANT_PREFERRED_PROVIDERS in binstub instead of VAGRANT_DEFAULT_PROVIDER. +- Use only bottom contstraint for Requires. * Thu Jul 27 2017 Fedora Release Engineering - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild From 99a2bac36fe4d840ce5faafc376667b58d3d625d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ondruch?= Date: Tue, 12 Dec 2017 12:30:11 +0100 Subject: [PATCH 08/83] Fix plugin registration issues caused by changes in RPM (rhbz#1523296). Originally, the transaction file triggers provided just list of filenames, but that was not intentional and the list now contains also directory entries. Fortunatelly, these entries can be filtered out if the path end withi '/'. --- vagrant.spec | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/vagrant.spec b/vagrant.spec index 154cfb0..70f71e3 100644 --- a/vagrant.spec +++ b/vagrant.spec @@ -4,7 +4,7 @@ Name: vagrant Version: 1.9.8 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Build and distribute virtualized development environments Group: Development/Languages License: MIT @@ -209,7 +209,7 @@ rescue => e puts "Vagrant plugin.json is not properly initialized: #{e}" end -%transfiletriggerin -p %{_bindir}/ruby -- %{dirname:%{vagrant_plugin_spec}} +%transfiletriggerin -p %{_bindir}/ruby -- %{dirname:%{vagrant_plugin_spec}}/ begin $LOAD_PATH.unshift "%{vagrant_dir}/lib" begin @@ -228,7 +228,7 @@ rescue => e puts "Vagrant plugin register error: #{e}" end -%transfiletriggerun -p %{_bindir}/ruby -- %{dirname:%{vagrant_plugin_spec}} +%transfiletriggerun -p %{_bindir}/ruby -- %{dirname:%{vagrant_plugin_spec}}/ begin $LOAD_PATH.unshift "%{vagrant_dir}/lib" begin @@ -304,6 +304,9 @@ end %changelog +* Tue Dec 12 2017 Vít Ondruch - 1.9.8-2 +- Fix plugin registration issues caused by changes in RPM (rhbz#1523296). + * Thu Aug 24 2017 Pavel Valena - 1.9.8-1 - Update to Vagrant 1.9.8 (rhbz#1427505). - Remove Nokogiri dependency. From c4d6537a3f1480c58c5c5ff476fed41d377058d4 Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Mon, 11 Sep 2017 17:19:39 +0200 Subject: [PATCH 09/83] Update to Vagrant 2.0.1. Replace vagrant-1.8.1-disable-winrm-tests.patch with sed command. Update to latest vagrant-spec commit. Execute test suite properly. Remove 'Use system certificates' patch - not needed anymore. Add `ssh` BuildRequire for tests. Disable tests that require bundler. --- sources | 4 +- vagrant-1.8.1-disable-winrm-tests.patch | 63 ------- ...ant-1.9.1-Fix-Ruby-2.4-compatibility.patch | 171 ------------------ vagrant-1.9.8-use-system-certificates.patch | 27 --- ...ch => vagrant-2.0.1-fix-dependencies.patch | 18 +- vagrant.spec | 42 +++-- 6 files changed, 35 insertions(+), 290 deletions(-) delete mode 100644 vagrant-1.8.1-disable-winrm-tests.patch delete mode 100644 vagrant-1.9.1-Fix-Ruby-2.4-compatibility.patch delete mode 100644 vagrant-1.9.8-use-system-certificates.patch rename vagrant-1.9.8-fix-dependencies.patch => vagrant-2.0.1-fix-dependencies.patch (80%) diff --git a/sources b/sources index eeb2cc8..558b7ff 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (vagrant-1.9.8.tar.gz) = d22cc0a6800aa5ef84085c750f5ec8729f7b3adefd9a5df1a1fcaf60d1219e781869ede4f57ce4fdeb269224603dfc3a8024545a0250ebd9e144745ce9aa670b -SHA512 (vagrant-spec-e623a5694912c539ac2657e38a372d5e8c93441d.tar.gz) = dd480f06b3be740f368354a3d15bf4bba2982d72c6368c10b72596e8263c2c2fb5179c07f8aea8d9e77e9e2b7792e6f8562a9abb3c2e8861969effb5825a908c +SHA512 (vagrant-2.0.1.tar.gz) = 4458fd819cfcbf732dcbb5e334986afc986e3da4f4ea883260ed9b7ff8dd90ef9b0078c067a1bf7fbf51562f235ab447234762a38aa0ac539974f6205f6d9cfd +SHA512 (vagrant-spec-7ac8b4191de578e345b29acaf62ecc72c8e73be1.tar.gz) = 49482df5a17f0a01b6e1645b2f9fbc1bac2c7e04d7c41f00284b52336513ef1876845e09ba21af3de196b196faa29809ac00655fe61d4ab4d800b8d83df8c6cc diff --git a/vagrant-1.8.1-disable-winrm-tests.patch b/vagrant-1.8.1-disable-winrm-tests.patch deleted file mode 100644 index ed8b9a3..0000000 --- a/vagrant-1.8.1-disable-winrm-tests.patch +++ /dev/null @@ -1,63 +0,0 @@ -diff --git a/test/unit/plugins/provisioners/ansible/provisioner_test.rb b/test/unit/plugins/provisioners/ansible/provisioner_test.rb -index 31354a7..f2dfd0f 100644 ---- a/test/unit/plugins/provisioners/ansible/provisioner_test.rb -+++ b/test/unit/plugins/provisioners/ansible/provisioner_test.rb -@@ -497,55 +497,6 @@ VF - end - end - -- context "with winrm communicator" do -- -- let(:iso_winrm_env) do -- env = isolated_environment -- env.vagrantfile <<-VF --Vagrant.configure("2") do |config| -- config.winrm.username = 'winner' -- config.winrm.password = 'winword' -- config.winrm.transport = :ssl -- -- config.vm.define :machine1 do |machine| -- machine.vm.box = "winbox" -- machine.vm.communicator = :winrm -- end --end --VF -- env.create_vagrant_env -- end -- -- let(:machine) { iso_winrm_env.machine(iso_winrm_env.machine_names[0], :dummy) } -- -- it_should_set_arguments_and_environment_variables -- -- it "generates an inventory with winrm connection settings" do -- -- expect(Vagrant::Util::Subprocess).to receive(:execute).with(any_args) { |*args| -- expect(config.inventory_path).to be_nil -- expect(File.exists?(generated_inventory_file)).to be(true) -- inventory_content = File.read(generated_inventory_file) -- -- expect(inventory_content).to include("machine1 ansible_connection=winrm ansible_ssh_host=127.0.0.1 ansible_ssh_port=55986 ansible_ssh_user='winner' ansible_ssh_pass='winword'\n") -- }.and_return(default_execute_result) -- end -- -- describe "with force_remote_user option disabled" do -- before do -- config.force_remote_user = false -- end -- -- it "doesn't set the ansible remote user in inventory and use '--user' argument with the vagrant ssh username" do -- expect(Vagrant::Util::Subprocess).to receive(:execute).with(any_args) { |*args| -- inventory_content = File.read(generated_inventory_file) -- -- expect(inventory_content).to include("machine1 ansible_connection=winrm ansible_ssh_host=127.0.0.1 ansible_ssh_port=55986 ansible_ssh_pass='winword'\n") -- expect(args).to include("--user=testuser") -- }.and_return(default_execute_result) -- end -- end -- end - - describe "with inventory_path option" do - before do --- -2.5.0 - diff --git a/vagrant-1.9.1-Fix-Ruby-2.4-compatibility.patch b/vagrant-1.9.1-Fix-Ruby-2.4-compatibility.patch deleted file mode 100644 index fc9bba1..0000000 --- a/vagrant-1.9.1-Fix-Ruby-2.4-compatibility.patch +++ /dev/null @@ -1,171 +0,0 @@ -From 3cdd1d09f9617e6005fc643000b5486ffbe22577 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?V=C3=ADt=20Ondruch?= -Date: Tue, 14 Feb 2017 10:13:29 +0100 -Subject: [PATCH 1/2] Use Integer instead of Fixnum for Ruby 2.4+ - compatibility. - ---- - lib/vagrant/cli.rb | 2 +- - lib/vagrant/plugin/v2/communicator.rb | 2 +- - lib/vagrant/registry.rb | 2 +- - plugins/provisioners/shell/config.rb | 4 ++-- - plugins/pushes/local-exec/config.rb | 4 ++-- - test/unit/plugins/provisioners/shell/config_test.rb | 6 +++--- - test/unit/plugins/pushes/local-exec/config_test.rb | 4 ++-- - 7 files changed, 12 insertions(+), 12 deletions(-) - -diff --git a/lib/vagrant/cli.rb b/lib/vagrant/cli.rb -index a6e9655f0..cca8c0184 100644 ---- a/lib/vagrant/cli.rb -+++ b/lib/vagrant/cli.rb -@@ -45,7 +45,7 @@ module Vagrant - result = 1 - end - -- result = 0 if !result.is_a?(Fixnum) -+ result = 0 if !result.is_a?(Integer) - return result - end - -diff --git a/lib/vagrant/plugin/v2/communicator.rb b/lib/vagrant/plugin/v2/communicator.rb -index 511fb6002..41385f486 100644 ---- a/lib/vagrant/plugin/v2/communicator.rb -+++ b/lib/vagrant/plugin/v2/communicator.rb -@@ -50,7 +50,7 @@ module Vagrant - # until then. It will wait up to the given duration or raise an - # exception if something goes wrong. - # -- # @param [Fixnum] duration Timeout in seconds. -+ # @param [Integer] duration Timeout in seconds. - # @return [Boolean] Will return true on successful connection - # or false on timeout. - def wait_for_ready(duration) -diff --git a/lib/vagrant/registry.rb b/lib/vagrant/registry.rb -index d84a745a5..c0c4e1bad 100644 ---- a/lib/vagrant/registry.rb -+++ b/lib/vagrant/registry.rb -@@ -52,7 +52,7 @@ module Vagrant - - # Return the number of elements in this registry. - # -- # @return [Fixnum] -+ # @return [Integer] - def length - @items.keys.length - end -diff --git a/plugins/provisioners/shell/config.rb b/plugins/provisioners/shell/config.rb -index 049eb15d0..05da320e3 100644 ---- a/plugins/provisioners/shell/config.rb -+++ b/plugins/provisioners/shell/config.rb -@@ -106,10 +106,10 @@ module VagrantPlugins - def args_valid? - return true if !args - return true if args.is_a?(String) -- return true if args.is_a?(Fixnum) -+ return true if args.is_a?(Integer) - if args.is_a?(Array) - args.each do |a| -- return false if !a.kind_of?(String) && !a.kind_of?(Fixnum) -+ return false if !a.kind_of?(String) && !a.kind_of?(Integer) - end - - return true -diff --git a/plugins/pushes/local-exec/config.rb b/plugins/pushes/local-exec/config.rb -index d62dfa8fa..9ed466088 100644 ---- a/plugins/pushes/local-exec/config.rb -+++ b/plugins/pushes/local-exec/config.rb -@@ -63,10 +63,10 @@ module VagrantPlugins - def args_valid? - return true if !args - return true if args.is_a?(String) -- return true if args.is_a?(Fixnum) -+ return true if args.is_a?(Integer) - if args.is_a?(Array) - args.each do |a| -- return false if !a.kind_of?(String) && !a.kind_of?(Fixnum) -+ return false if !a.kind_of?(String) && !a.kind_of?(Integer) - end - - return true -diff --git a/test/unit/plugins/provisioners/shell/config_test.rb b/test/unit/plugins/provisioners/shell/config_test.rb -index c4d260b90..905a28b03 100644 ---- a/test/unit/plugins/provisioners/shell/config_test.rb -+++ b/test/unit/plugins/provisioners/shell/config_test.rb -@@ -30,7 +30,7 @@ describe "VagrantPlugins::Shell::Config" do - expect(result["shell provisioner"]).to eq([]) - end - -- it "passes with fixnum args" do -+ it "passes with integer args" do - subject.path = file_that_exists - subject.args = 1 - subject.finalize! -@@ -112,7 +112,7 @@ describe "VagrantPlugins::Shell::Config" do - end - - describe 'finalize!' do -- it 'changes fixnum args into strings' do -+ it 'changes integer args into strings' do - subject.path = file_that_exists - subject.args = 1 - subject.finalize! -@@ -120,7 +120,7 @@ describe "VagrantPlugins::Shell::Config" do - expect(subject.args).to eq '1' - end - -- it 'changes fixnum args in arrays into strings' do -+ it 'changes integer args in arrays into strings' do - subject.path = file_that_exists - subject.args = ["string", 1, 2] - subject.finalize! -diff --git a/test/unit/plugins/pushes/local-exec/config_test.rb b/test/unit/plugins/pushes/local-exec/config_test.rb -index 1bde10d98..9442b6420 100644 ---- a/test/unit/plugins/pushes/local-exec/config_test.rb -+++ b/test/unit/plugins/pushes/local-exec/config_test.rb -@@ -70,7 +70,7 @@ describe VagrantPlugins::LocalExecPush::Config do - expect(errors).to be_empty - end - -- it "passes with fixnum args" do -+ it "passes with integer args" do - subject.args = 1 - expect(errors).to be_empty - end -@@ -118,7 +118,7 @@ describe VagrantPlugins::LocalExecPush::Config do - expect(errors).to be_empty - end - -- it "passes with fixnum args" do -+ it "passes with integer args" do - subject.args = 1 - expect(errors).to be_empty - end --- -2.11.1 - - -From 6d269293e37db86325bec0a17502d68838d28214 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?V=C3=ADt=20Ondruch?= -Date: Tue, 14 Feb 2017 10:33:58 +0100 -Subject: [PATCH 2/2] Do not use deprecated API. - ---- - lib/vagrant/util/keypair.rb | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/lib/vagrant/util/keypair.rb b/lib/vagrant/util/keypair.rb -index 342d3264f..5e3d10ea6 100644 ---- a/lib/vagrant/util/keypair.rb -+++ b/lib/vagrant/util/keypair.rb -@@ -26,7 +26,7 @@ module Vagrant - private_key = rsa_key.to_pem - - if password -- cipher = OpenSSL::Cipher::Cipher.new('des3') -+ cipher = OpenSSL::Cipher.new('des3') - private_key = rsa_key.to_pem(cipher, password) - end - --- -2.11.1 - diff --git a/vagrant-1.9.8-use-system-certificates.patch b/vagrant-1.9.8-use-system-certificates.patch deleted file mode 100644 index 1e73c65..0000000 --- a/vagrant-1.9.8-use-system-certificates.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 7486aa2ce950f55a4be9049d514c412d7e45ddef Mon Sep 17 00:00:00 2001 -From: Pavel Valena -Date: Thu, 20 Jul 2017 15:01:06 +0200 -Subject: [PATCH] Use system certificates - ---- - lib/vagrant/util/downloader.rb | 5 +++-- - 1 files changed, 3 insertions(+), 2 deletions(-) - -diff --git a/lib/vagrant/util/downloader.rb b/lib/vagrant/util/downloader.rb -index 03e6238..9a02a85 100644 ---- a/lib/vagrant/util/downloader.rb -+++ b/lib/vagrant/util/downloader.rb -@@ -297,8 +297,9 @@ module Vagrant - # If we're in Vagrant, then we use the packaged CA bundle - if Vagrant.in_installer? - subprocess_options[:env] ||= {} -- subprocess_options[:env]["CURL_CA_BUNDLE"] = -- File.expand_path("cacert.pem", ENV["VAGRANT_INSTALLER_EMBEDDED_DIR"]) -+ #Use system certificates. -+ #subprocess_options[:env]["CURL_CA_BUNDLE"] = -+ # File.expand_path("cacert.pem", ENV["VAGRANT_INSTALLER_EMBEDDED_DIR"]) - end - - return [options, subprocess_options] --- -2.5.0 diff --git a/vagrant-1.9.8-fix-dependencies.patch b/vagrant-2.0.1-fix-dependencies.patch similarity index 80% rename from vagrant-1.9.8-fix-dependencies.patch rename to vagrant-2.0.1-fix-dependencies.patch index f1796bf..ff7614f 100644 --- a/vagrant-1.9.8-fix-dependencies.patch +++ b/vagrant-2.0.1-fix-dependencies.patch @@ -1,21 +1,21 @@ From 7486aa2ce950f55a4be9049d514c412d7e45ddef Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Thu, 20 Jul 2017 15:01:06 +0200 -Subject: [PATCH] Fix dependencies for Vagrant 1.9.7. +Subject: [PATCH] Fix dependencies for Vagrant 2.0.1. --- - vagrant.gemspec | 23 +++++++++++++---------- - 1 file changed, 13 insertions(+), 10 deletions(-) + vagrant.gemspec | 25 ++++++++++++++----------- + 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/vagrant.gemspec b/vagrant.gemspec index c92ca17..aeee52f 100644 --- a/vagrant.gemspec +++ b/vagrant.gemspec -@@ -12,31 +12,34 @@ Gem::Specification.new do |s| +@@ -12,35 +12,38 @@ Gem::Specification.new do |s| s.summary = "Build and distribute virtualized development environments." s.description = "Vagrant is a tool for building and distributing virtualized development environments." -- s.required_ruby_version = "~> 2.2", "< 2.4" +- s.required_ruby_version = "~> 2.2", "< 2.5" + s.required_ruby_version = "~> 2.2" s.required_rubygems_version = ">= 1.3.6" s.rubyforge_project = "vagrant" @@ -56,6 +56,10 @@ index c92ca17..aeee52f 100644 # Constraint rake to properly handle deprecated method usage # from within rspec +- s.add_development_dependency "rake", "~> 12.0.0" ++ s.add_development_dependency "rake", "~> 12.2.0" + s.add_development_dependency "rspec", "~> 3.5.0" + s.add_development_dependency "rspec-its", "~> 1.2.0" + s.add_development_dependency "webmock", "~> 2.3.1" -- -2.7.5 - +2.13.6 diff --git a/vagrant.spec b/vagrant.spec index 70f71e3..ba2167f 100644 --- a/vagrant.spec +++ b/vagrant.spec @@ -1,10 +1,10 @@ %global bashcompletion_dir %(pkg-config --variable=completionsdir bash-completion 2> /dev/null || :) -%global vagrant_spec_commit e623a5694912c539ac2657e38a372d5e8c93441d +%global vagrant_spec_commit 7ac8b4191de578e345b29acaf62ecc72c8e73be1 Name: vagrant -Version: 1.9.8 -Release: 2%{?dist} +Version: 2.0.1 +Release: 1%{?dist} Summary: Build and distribute virtualized development environments Group: Development/Languages License: MIT @@ -14,7 +14,7 @@ Source0: https://github.com/mitchellh/%{name}/archive/v%{version}/%{name}-%{vers Source1: binstub # The library has no official release yet. But since it is just test # dependency, it should be fine to include the source right here. -# wget https://github.com/mitchellh/vagrant-spec/archive/2f0fb10862b2d19861c584be9d728080ba1f5d33/vagrant-spec-2f0fb10862b2d19861c584be9d728080ba1f5d33.tar.gz +# wget https://github.com/mitchellh/vagrant-spec/archive/7ac8b4191de578e345b29acaf62ecc72c8e73be1/vagrant-spec-7ac8b4191de578e345b29acaf62ecc72c8e73be1.tar.gz Source2: https://github.com/mitchellh/%{name}-spec/archive/%{vagrant_spec_commit}/%{name}-spec-%{vagrant_spec_commit}.tar.gz # Monkey-patching needed for Vagrant to work until the respective patches # for RubyGems and Bundler are in place @@ -24,17 +24,7 @@ Source4: macros.vagrant # fails on older Fedoras. %{?load:%{SOURCE4}} -Patch0: vagrant-1.9.8-fix-dependencies.patch - -# Disable ansible winrm tests -Patch1: vagrant-1.8.1-disable-winrm-tests.patch - -# Use Integer instead of Fixnum for Ruby 2.4+ compatibility. -# https://github.com/mitchellh/vagrant/pull/8284 -Patch2: vagrant-1.9.1-Fix-Ruby-2.4-compatibility.patch - -# Use system certificates(split to standalone patch) -Patch3: vagrant-1.9.8-use-system-certificates.patch +Patch0: vagrant-2.0.1-fix-dependencies.patch Requires: ruby(release) Requires: ruby(rubygems) >= 1.3.6 @@ -77,6 +67,7 @@ BuildRequires: rubygem(thor) BuildRequires: rubygem(webmock) BuildRequires: rubygem(fake_ftp) BuildRequires: pkgconfig(bash-completion) +BuildRequires: %{_bindir}/ssh BuildArch: noarch # vagrant-atomic was retired in F26, since it was merged into Vagrant. @@ -106,9 +97,6 @@ Documentation for %{name}. %setup -q -b2 %patch0 -p1 -%patch1 -p1 -%patch2 -p1 -%patch3 -p1 %build gem build %{name}.gemspec @@ -174,8 +162,12 @@ mv ../vagrant-spec{-%{vagrant_spec_commit},} # Remove the git reference, which is useless in our case. sed -i '/git/ s/^/#/' ../vagrant-spec/vagrant-spec.gemspec -# Relax the thor dependency, since Fedora ships with newer version. +# Relax the dependencies, since Fedora ships with newer versions. sed -i '/thor/ s/~>/>=/' ../vagrant-spec/vagrant-spec.gemspec +sed -i '/rspec/ s/~>/>=/' ./vagrant.gemspec +sed -i '/rspec/ s/~>/>=/' ../vagrant-spec/vagrant-spec.gemspec +# TODO: package newer childproccess +sed -i '/childprocess/ s/~>/<=/' ../vagrant-spec/vagrant-spec.gemspec #Insert new test dependencies sed -i '25 i\ spec.add_dependency "webmock"' ../vagrant-spec/vagrant-spec.gemspec @@ -185,9 +177,16 @@ sed -i '26 i\ spec.add_dependency "fake_ftp"' ../vagrant-spec/vagrant-spec.gems rm -rf test/unit/plugins/communicators/winrm sed -i '/it "eager loads WinRM" do/,/^ end$/ s/^/#/' test/unit/vagrant/machine_test.rb sed -i '/it "should return the specified communicator if given" do/,/^ end$/ s/^/#/' test/unit/vagrant/machine_test.rb +sed -i '/^ context "with winrm communicator" do$/,/^ end$/ s/^/#/' \ + test/unit/plugins/provisioners/ansible/provisioner_test.rb + +# Disable test that requires bundler +# https://github.com/hashicorp/vagrant/issues/9273 +mv test/unit/vagrant/util/env_test.rb{,.disable} # Test suite must be executed in order. -ruby -I.:lib -e 'Dir.glob("test/unit/**/*_test.rb").sort.each &method(:require)' +find test/unit/ -name '*_test.rb' -type f | xargs rspec + %pre getent group vagrant >/dev/null || groupadd -r vagrant @@ -304,6 +303,9 @@ end %changelog +* Mon Dec 18 2017 Pavel Valena - 2.0.1-1 +- Update to Vagrant 2.0.1. + * Tue Dec 12 2017 Vít Ondruch - 1.9.8-2 - Fix plugin registration issues caused by changes in RPM (rhbz#1523296). From f9ac29b0282587aa6e86e29e62a7a44c42c9ac6a Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Wed, 20 Dec 2017 21:17:32 +0100 Subject: [PATCH 10/83] Use rake to run tests to resolve issues with requires. --- vagrant.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vagrant.spec b/vagrant.spec index ba2167f..fba7e78 100644 --- a/vagrant.spec +++ b/vagrant.spec @@ -184,8 +184,8 @@ sed -i '/^ context "with winrm communicator" do$/,/^ end$/ s/^/#/' \ # https://github.com/hashicorp/vagrant/issues/9273 mv test/unit/vagrant/util/env_test.rb{,.disable} -# Test suite must be executed in order. -find test/unit/ -name '*_test.rb' -type f | xargs rspec +# Rake solves the requires issues for tests +rake -f tasks/test.rake test:unit %pre From b2e9d7d062e1d82dc75a7c658d0b5dc52ac8c735 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ondruch?= Date: Tue, 9 Jan 2018 09:06:33 +0100 Subject: [PATCH 11/83] Fix Ruby 2.5 compatibilty. --- macros.vagrant | 1 + vagrant.spec | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/macros.vagrant b/macros.vagrant index 1690a5e..9c6742f 100644 --- a/macros.vagrant +++ b/macros.vagrant @@ -28,6 +28,7 @@ CONFIGURE_ARGS="--with-cflags='%{optflags}' $CONFIGURE_ARGS" \\\ gem install \\\ -V \\\ --local \\\ + --no-user-install \\\ --install-dir %{-d*}%{!?-d:.%{vagrant_plugin_dir}} \\\ --bindir .%{_bindir} \\\ --ignore-dependencies \\\ diff --git a/vagrant.spec b/vagrant.spec index fba7e78..62fb9e6 100644 --- a/vagrant.spec +++ b/vagrant.spec @@ -4,7 +4,7 @@ Name: vagrant Version: 2.0.1 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Build and distribute virtualized development environments Group: Development/Languages License: MIT @@ -101,7 +101,10 @@ Documentation for %{name}. %build gem build %{name}.gemspec -gem install -V --local --install-dir .%{vagrant_plugin_dir} \ +gem install -V --local \ + --no-user-install \ + --install-dir .%{vagrant_plugin_dir} \ + --bindir .%{vagrant_plugin_dir}/bin \ --ignore-dependencies --force --no-document --backtrace \ %{name}-%{version}.gem @@ -303,6 +306,9 @@ end %changelog +* Mon Jan 08 2018 Vít Ondruch - 2.0.1-2 +- Fix Ruby 2.5 compatibilty. + * Mon Dec 18 2017 Pavel Valena - 2.0.1-1 - Update to Vagrant 2.0.1. From 3a4457942fe44a24e8678dae6b08a8a5e89f9e84 Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Wed, 31 Jan 2018 12:24:31 +0100 Subject: [PATCH 12/83] Update to Vagrant 2.0.2. Update to latest vagrant-spec commit. --- .gitignore | 17 ++-------- sources | 4 +-- ...ch => vagrant-2.0.2-fix-dependencies.patch | 9 +++--- ....0.2-use-numerical-instead-localhost.patch | 32 +++++++++++++++++++ vagrant.spec | 23 +++++++++---- 5 files changed, 56 insertions(+), 29 deletions(-) rename vagrant-2.0.1-fix-dependencies.patch => vagrant-2.0.2-fix-dependencies.patch (91%) create mode 100644 vagrant-2.0.2-use-numerical-instead-localhost.patch diff --git a/.gitignore b/.gitignore index fec04bd..ce3853d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,15 +1,2 @@ -/vagrant-1.6.5.tar.gz -/vagrant-spec-c0dafc996165bf1628b672dd533f1858ff66fe4a.tar.gz -/vagrant-1.7.2.tar.gz -/vagrant-1.7.4.tar.gz -/vagrant-spec-f1a18fd3e5387328ca83e016e48373aadb67112a.tar.gz -/vagrant-1.8.1.tar.gz -/vagrant-spec-9bba7e1228379c0a249a06ce76ba8ea7d276afbe.tar.gz -/vagrant-1.8.5.tar.gz -/vagrant-1.8.6.tar.gz -/vagrant-1.8.7.tar.gz -/vagrant-1.9.1.tar.gz -/vagrant-1.9.7.tar.gz -/vagrant-spec-2f0fb10862b2d19861c584be9d728080ba1f5d33.tar.gz -/vagrant-1.9.8.tar.gz -/vagrant-spec-e623a5694912c539ac2657e38a372d5e8c93441d.tar.gz +/vagrant-*.tar.gz +/vagrant-spec-*.tar.gz diff --git a/sources b/sources index 558b7ff..2cba5c6 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (vagrant-2.0.1.tar.gz) = 4458fd819cfcbf732dcbb5e334986afc986e3da4f4ea883260ed9b7ff8dd90ef9b0078c067a1bf7fbf51562f235ab447234762a38aa0ac539974f6205f6d9cfd -SHA512 (vagrant-spec-7ac8b4191de578e345b29acaf62ecc72c8e73be1.tar.gz) = 49482df5a17f0a01b6e1645b2f9fbc1bac2c7e04d7c41f00284b52336513ef1876845e09ba21af3de196b196faa29809ac00655fe61d4ab4d800b8d83df8c6cc +SHA512 (vagrant-2.0.2.tar.gz) = 27e8157cf8a8d102a0ca328403410639bd4a9f7cb90d443f5be3ca912aeb6177208b26ba9751b49d98b5ba1e92f8bec74db0baca4cd22051d5ef6d3aca558f3a +SHA512 (vagrant-spec-f3daedaac493ebc0ba1a96c915423a329e09e84a.tar.gz) = 78dd57932b3a19c410abbac45992251ec5b8a5fa6ba5431fb74187c17a7fe7079d757b1654d674c02d25afb1dbe40d16fb4dd7553517c531a737d7a7998b6f70 diff --git a/vagrant-2.0.1-fix-dependencies.patch b/vagrant-2.0.2-fix-dependencies.patch similarity index 91% rename from vagrant-2.0.1-fix-dependencies.patch rename to vagrant-2.0.2-fix-dependencies.patch index ff7614f..34f0c30 100644 --- a/vagrant-2.0.1-fix-dependencies.patch +++ b/vagrant-2.0.2-fix-dependencies.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Fix dependencies for Vagrant 2.0.1. --- vagrant.gemspec | 25 ++++++++++++++----------- - 1 file changed, 14 insertions(+), 11 deletions(-) + 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/vagrant.gemspec b/vagrant.gemspec index c92ca17..aeee52f 100644 @@ -15,7 +15,7 @@ index c92ca17..aeee52f 100644 s.summary = "Build and distribute virtualized development environments." s.description = "Vagrant is a tool for building and distributing virtualized development environments." -- s.required_ruby_version = "~> 2.2", "< 2.5" +- s.required_ruby_version = "~> 2.2", "< 2.6" + s.required_ruby_version = "~> 2.2" s.required_rubygems_version = ">= 1.3.6" s.rubyforge_project = "vagrant" @@ -25,10 +25,9 @@ index c92ca17..aeee52f 100644 s.add_dependency "erubis", "~> 2.7.0" s.add_dependency "i18n", ">= 0.6.0", "<= 0.8.0" s.add_dependency "listen", "~> 3.1.5" - s.add_dependency "hashicorp-checkpoint", "~> 0.1.1" + s.add_dependency "hashicorp-checkpoint", "~> 0.1.5" s.add_dependency "log4r", "~> 1.1.9", "< 1.1.11" -- s.add_dependency "net-ssh", "~> 4.1.0" -+ s.add_dependency "net-ssh", ">= 4.1.0" + s.add_dependency "net-ssh", "~> 4.2.0" s.add_dependency "net-sftp", "~> 2.1" - s.add_dependency "net-scp", "~> 1.2.0" - s.add_dependency "rb-kqueue", "~> 0.2.0" diff --git a/vagrant-2.0.2-use-numerical-instead-localhost.patch b/vagrant-2.0.2-use-numerical-instead-localhost.patch new file mode 100644 index 0000000..7b7ab2b --- /dev/null +++ b/vagrant-2.0.2-use-numerical-instead-localhost.patch @@ -0,0 +1,32 @@ +From a102bc064f2b0d97cc6e67bb4f5e4a1bd951e311 Mon Sep 17 00:00:00 2001 +From: Pavel Valena +Date: Wed, 31 Jan 2018 19:08:35 +0100 +Subject: [PATCH] Use 127.0.0.1 instead of localhost + +in test is_port_open_test.rb +--- + test/unit/vagrant/util/is_port_open_test.rb | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/test/unit/vagrant/util/is_port_open_test.rb b/test/unit/vagrant/util/is_port_open_test.rb +index 71ee1db3b7..ea70425755 100644 +--- a/test/unit/vagrant/util/is_port_open_test.rb ++++ b/test/unit/vagrant/util/is_port_open_test.rb +@@ -36,7 +36,7 @@ + end + + # Verify that we report the port is open +- expect(klass.is_port_open?("localhost", open_port)).to be ++ expect(klass.is_port_open?("127.0.0.1", open_port)).to be + + # Kill the thread + thr[:die] = true +@@ -47,7 +47,7 @@ + # This CAN fail, since port 52811 might actually be in use, but I'm + # not sure what to do except choose some random port and hope for the + # best, really. +- expect(klass.is_port_open?("localhost", closed_port)).not_to be ++ expect(klass.is_port_open?("127.0.0.1", closed_port)).not_to be + end + end + diff --git a/vagrant.spec b/vagrant.spec index 62fb9e6..cf9af7a 100644 --- a/vagrant.spec +++ b/vagrant.spec @@ -1,10 +1,10 @@ %global bashcompletion_dir %(pkg-config --variable=completionsdir bash-completion 2> /dev/null || :) -%global vagrant_spec_commit 7ac8b4191de578e345b29acaf62ecc72c8e73be1 +%global vagrant_spec_commit f3daedaac493ebc0ba1a96c915423a329e09e84a Name: vagrant -Version: 2.0.1 -Release: 2%{?dist} +Version: 2.0.2 +Release: 1%{?dist} Summary: Build and distribute virtualized development environments Group: Development/Languages License: MIT @@ -14,7 +14,7 @@ Source0: https://github.com/mitchellh/%{name}/archive/v%{version}/%{name}-%{vers Source1: binstub # The library has no official release yet. But since it is just test # dependency, it should be fine to include the source right here. -# wget https://github.com/mitchellh/vagrant-spec/archive/7ac8b4191de578e345b29acaf62ecc72c8e73be1/vagrant-spec-7ac8b4191de578e345b29acaf62ecc72c8e73be1.tar.gz +# wget https://github.com/mitchellh/vagrant-spec/archive/f3daedaac493ebc0ba1a96c915423a329e09e84a/vagrant-spec-f3daedaac493ebc0ba1a96c915423a329e09e84a.tar.gz Source2: https://github.com/mitchellh/%{name}-spec/archive/%{vagrant_spec_commit}/%{name}-spec-%{vagrant_spec_commit}.tar.gz # Monkey-patching needed for Vagrant to work until the respective patches # for RubyGems and Bundler are in place @@ -24,20 +24,24 @@ Source4: macros.vagrant # fails on older Fedoras. %{?load:%{SOURCE4}} -Patch0: vagrant-2.0.1-fix-dependencies.patch +Patch0: vagrant-2.0.2-fix-dependencies.patch + +# Use 127.0.0.1 instead of localhost in tests +# https://github.com/hashicorp/vagrant/pull/9422 +Patch1: vagrant-2.0.2-use-numerical-instead-localhost.patch Requires: ruby(release) Requires: ruby(rubygems) >= 1.3.6 # Explicitly specify MRI, since Vagrant does not work with JRuby ATM. Requires: ruby -Requires: rubygem(hashicorp-checkpoint) >= 0.1.1 +Requires: rubygem(hashicorp-checkpoint) >= 0.1.5 Requires: rubygem(childprocess) >= 0.5.0 Requires: rubygem(erubis) >= 2.7.0 Requires: rubygem(i18n) >= 0.6.0 Requires: rubygem(json) Requires: rubygem(listen) >= 3.1.5 Requires: rubygem(log4r) >= 1.1.9 -Requires: rubygem(net-ssh) >= 4.1.0 +Requires: rubygem(net-ssh) >= 4.2.0 Requires: rubygem(net-scp) >= 1.2.0 Requires: rubygem(net-sftp) >= 2.1 Requires: rubygem(rest-client) >= 1.6.0 @@ -158,6 +162,8 @@ EOF %check +cat %{PATCH1} | patch -p1 + # Adjust the vagrant-spec directory name. rm -rf ../vagrant-spec mv ../vagrant-spec{-%{vagrant_spec_commit},} @@ -306,6 +312,9 @@ end %changelog +* Wed Jan 31 2018 Pavel Valena - 2.0.2-1 +- Update to Vagrant 2.0.2. + * Mon Jan 08 2018 Vít Ondruch - 2.0.1-2 - Fix Ruby 2.5 compatibilty. From 84a0ec282ea3e2aca980c57af8bd0fcba9eaf92f Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Wed, 21 Feb 2018 16:32:49 +0100 Subject: [PATCH 13/83] Allow rubygem-i18n ~> 1.0 as it was updated in Fedora. https://github.com/hashicorp/vagrant/pull/9496 --- vagrant-2.0.2-fix-dependencies.patch | 5 +++-- vagrant.spec | 6 +++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/vagrant-2.0.2-fix-dependencies.patch b/vagrant-2.0.2-fix-dependencies.patch index 34f0c30..d72d6e3 100644 --- a/vagrant-2.0.2-fix-dependencies.patch +++ b/vagrant-2.0.2-fix-dependencies.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Fix dependencies for Vagrant 2.0.1. --- vagrant.gemspec | 25 ++++++++++++++----------- - 1 file changed, 13 insertions(+), 10 deletions(-) + 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/vagrant.gemspec b/vagrant.gemspec index c92ca17..aeee52f 100644 @@ -23,7 +23,8 @@ index c92ca17..aeee52f 100644 - s.add_dependency "childprocess", "~> 0.6.0" + s.add_dependency "childprocess", "~> 0.5.0" s.add_dependency "erubis", "~> 2.7.0" - s.add_dependency "i18n", ">= 0.6.0", "<= 0.8.0" +- s.add_dependency "i18n", ">= 0.6.0", "<= 0.8.0" ++ s.add_dependency "i18n", ">= 0.6.0" s.add_dependency "listen", "~> 3.1.5" s.add_dependency "hashicorp-checkpoint", "~> 0.1.5" s.add_dependency "log4r", "~> 1.1.9", "< 1.1.11" diff --git a/vagrant.spec b/vagrant.spec index cf9af7a..ff43816 100644 --- a/vagrant.spec +++ b/vagrant.spec @@ -4,7 +4,7 @@ Name: vagrant Version: 2.0.2 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Build and distribute virtualized development environments Group: Development/Languages License: MIT @@ -312,6 +312,10 @@ end %changelog +* Wed Feb 21 2018 Pavel Valena - 2.0.2-2 +- Allow rubygem-i18n ~> 1.0 + https://github.com/rails/rails/pull/31991 + * Wed Jan 31 2018 Pavel Valena - 2.0.2-1 - Update to Vagrant 2.0.2. From 2c4a81fd8a498a2ef8b929e3737746d8b2fab08b Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Mon, 26 Mar 2018 17:59:15 +0200 Subject: [PATCH 14/83] Update to Vagrant 2.0.3. --- sources | 2 +- vagrant.spec | 14 +++++--------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/sources b/sources index 2cba5c6..d52d939 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (vagrant-2.0.2.tar.gz) = 27e8157cf8a8d102a0ca328403410639bd4a9f7cb90d443f5be3ca912aeb6177208b26ba9751b49d98b5ba1e92f8bec74db0baca4cd22051d5ef6d3aca558f3a +SHA512 (vagrant-2.0.3.tar.gz) = c62366c2e2b190a19efeae3379573c9e534b296db68152f284f3d80e9fdff4260e246c40206076e222bda3cf8f4ecbd02656c65aa35c15606b8638d7a8fca200 SHA512 (vagrant-spec-f3daedaac493ebc0ba1a96c915423a329e09e84a.tar.gz) = 78dd57932b3a19c410abbac45992251ec5b8a5fa6ba5431fb74187c17a7fe7079d757b1654d674c02d25afb1dbe40d16fb4dd7553517c531a737d7a7998b6f70 diff --git a/vagrant.spec b/vagrant.spec index ff43816..c77e089 100644 --- a/vagrant.spec +++ b/vagrant.spec @@ -3,8 +3,8 @@ %global vagrant_spec_commit f3daedaac493ebc0ba1a96c915423a329e09e84a Name: vagrant -Version: 2.0.2 -Release: 2%{?dist} +Version: 2.0.3 +Release: 1%{?dist} Summary: Build and distribute virtualized development environments Group: Development/Languages License: MIT @@ -26,10 +26,6 @@ Source4: macros.vagrant Patch0: vagrant-2.0.2-fix-dependencies.patch -# Use 127.0.0.1 instead of localhost in tests -# https://github.com/hashicorp/vagrant/pull/9422 -Patch1: vagrant-2.0.2-use-numerical-instead-localhost.patch - Requires: ruby(release) Requires: ruby(rubygems) >= 1.3.6 # Explicitly specify MRI, since Vagrant does not work with JRuby ATM. @@ -162,8 +158,6 @@ EOF %check -cat %{PATCH1} | patch -p1 - # Adjust the vagrant-spec directory name. rm -rf ../vagrant-spec mv ../vagrant-spec{-%{vagrant_spec_commit},} @@ -307,11 +301,13 @@ end %{vagrant_plugin_instdir}/Gemfile %{vagrant_plugin_instdir}/Rakefile %{vagrant_plugin_instdir}/tasks -%{vagrant_plugin_instdir}/test %{vagrant_plugin_instdir}/vagrant-spec.config.example.rb %changelog +* Mon Mar 26 2018 Pavel Valena - 2.0.3-1 +- Update to Vagrant 2.0.3 + * Wed Feb 21 2018 Pavel Valena - 2.0.2-2 - Allow rubygem-i18n ~> 1.0 https://github.com/rails/rails/pull/31991 From 64b439f9374466868f5b367c4151c14273f08fad Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Mon, 23 Apr 2018 14:51:53 +0200 Subject: [PATCH 15/83] Update to Vagrant 2.0.4. --- sources | 2 +- ...ies.patch => vagrant-2.0.4-fix-dependencies.patch | 12 ++++++++---- vagrant.spec | 7 +++++-- 3 files changed, 14 insertions(+), 7 deletions(-) rename vagrant-2.0.2-fix-dependencies.patch => vagrant-2.0.4-fix-dependencies.patch (86%) diff --git a/sources b/sources index d52d939..34d686e 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (vagrant-2.0.3.tar.gz) = c62366c2e2b190a19efeae3379573c9e534b296db68152f284f3d80e9fdff4260e246c40206076e222bda3cf8f4ecbd02656c65aa35c15606b8638d7a8fca200 +SHA512 (vagrant-2.0.4.tar.gz) = ac730dab2fad7cb676d6be73f5a63e883a12a4c054c3848a1918ce59c7a9484aee732c00788547e6efac9c467922ce0ff24be7d4df71b1384425e66e1f05b16f SHA512 (vagrant-spec-f3daedaac493ebc0ba1a96c915423a329e09e84a.tar.gz) = 78dd57932b3a19c410abbac45992251ec5b8a5fa6ba5431fb74187c17a7fe7079d757b1654d674c02d25afb1dbe40d16fb4dd7553517c531a737d7a7998b6f70 diff --git a/vagrant-2.0.2-fix-dependencies.patch b/vagrant-2.0.4-fix-dependencies.patch similarity index 86% rename from vagrant-2.0.2-fix-dependencies.patch rename to vagrant-2.0.4-fix-dependencies.patch index d72d6e3..f78117b 100644 --- a/vagrant-2.0.2-fix-dependencies.patch +++ b/vagrant-2.0.4-fix-dependencies.patch @@ -1,17 +1,17 @@ From 7486aa2ce950f55a4be9049d514c412d7e45ddef Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Thu, 20 Jul 2017 15:01:06 +0200 -Subject: [PATCH] Fix dependencies for Vagrant 2.0.1. +Subject: [PATCH] Fix dependencies for Vagrant 2.0.4. --- - vagrant.gemspec | 25 ++++++++++++++----------- - 1 file changed, 14 insertions(+), 11 deletions(-) + vagrant.gemspec | 29 ++++++++++++++++------------- + 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/vagrant.gemspec b/vagrant.gemspec index c92ca17..aeee52f 100644 --- a/vagrant.gemspec +++ b/vagrant.gemspec -@@ -12,35 +12,38 @@ Gem::Specification.new do |s| +@@ -12,37 +12,40 @@ Gem::Specification.new do |s| s.summary = "Build and distribute virtualized development environments." s.description = "Vagrant is a tool for building and distributing virtualized development environments." @@ -37,10 +37,14 @@ index c92ca17..aeee52f 100644 + # s.add_dependency "rb-kqueue", "~> 0.2.0" s.add_dependency "rest-client", ">= 1.6.0", "< 3.0" - s.add_dependency "wdm", "~> 0.1.0" +- s.add_dependency "win32-file", "~> 0.8.1" +- s.add_dependency "win32-file-security", "~> 1.0.10" - s.add_dependency "winrm", "~> 2.1" - s.add_dependency "winrm-fs", "~> 1.0" - s.add_dependency "winrm-elevated", "~> 1.1" + # s.add_dependency "wdm", "~> 0.1.0" ++ # s.add_dependency "win32-file", "~> 0.8.1" ++ # s.add_dependency "win32-file-security", "~> 1.0.10" + # s.add_dependency "winrm", "~> 2.1" + # s.add_dependency "winrm-fs", "~> 1.0" + # s.add_dependency "winrm-elevated", "~> 1.1" diff --git a/vagrant.spec b/vagrant.spec index c77e089..08bd3b0 100644 --- a/vagrant.spec +++ b/vagrant.spec @@ -3,7 +3,7 @@ %global vagrant_spec_commit f3daedaac493ebc0ba1a96c915423a329e09e84a Name: vagrant -Version: 2.0.3 +Version: 2.0.4 Release: 1%{?dist} Summary: Build and distribute virtualized development environments Group: Development/Languages @@ -24,7 +24,7 @@ Source4: macros.vagrant # fails on older Fedoras. %{?load:%{SOURCE4}} -Patch0: vagrant-2.0.2-fix-dependencies.patch +Patch0: vagrant-2.0.4-fix-dependencies.patch Requires: ruby(release) Requires: ruby(rubygems) >= 1.3.6 @@ -305,6 +305,9 @@ end %changelog +* Mon Apr 23 2018 Pavel Valena - 2.0.4-1 +- Update to Vagrant 2.0.4. + * Mon Mar 26 2018 Pavel Valena - 2.0.3-1 - Update to Vagrant 2.0.3 From c23d757267c58c25324cfa6a07821e97a31ceda2 Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Thu, 7 Jun 2018 13:06:50 +0200 Subject: [PATCH 16/83] Update to Vagrant 2.1.1. --- sources | 4 ++-- ...dencies.patch => vagrant-2.1.1-fix-dependencies.patch | 0 vagrant.spec | 9 ++++++--- 3 files changed, 8 insertions(+), 5 deletions(-) rename vagrant-2.0.4-fix-dependencies.patch => vagrant-2.1.1-fix-dependencies.patch (100%) diff --git a/sources b/sources index 34d686e..b3835a5 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (vagrant-2.0.4.tar.gz) = ac730dab2fad7cb676d6be73f5a63e883a12a4c054c3848a1918ce59c7a9484aee732c00788547e6efac9c467922ce0ff24be7d4df71b1384425e66e1f05b16f -SHA512 (vagrant-spec-f3daedaac493ebc0ba1a96c915423a329e09e84a.tar.gz) = 78dd57932b3a19c410abbac45992251ec5b8a5fa6ba5431fb74187c17a7fe7079d757b1654d674c02d25afb1dbe40d16fb4dd7553517c531a737d7a7998b6f70 +SHA512 (vagrant-2.1.1.tar.gz) = 6cc82b4c33b196fce2bc460447afd152e53c3c17b45db5d80958ff631f6747c386b625ff26e3d8830a88b2feca82d550ad1de32e7c7607dffb25960af43092f5 +SHA512 (vagrant-spec-9413ab298407114528766efefd1fb1ff24589636.tar.gz) = 4dc502e75bb8795953c8c338892346431bbd3120239fa7a25175becf148c999293c264a6bb24c52c2821071303e2b20a8353b197370d595cf2e6bc00569cb631 diff --git a/vagrant-2.0.4-fix-dependencies.patch b/vagrant-2.1.1-fix-dependencies.patch similarity index 100% rename from vagrant-2.0.4-fix-dependencies.patch rename to vagrant-2.1.1-fix-dependencies.patch diff --git a/vagrant.spec b/vagrant.spec index 08bd3b0..10ffc76 100644 --- a/vagrant.spec +++ b/vagrant.spec @@ -1,9 +1,9 @@ %global bashcompletion_dir %(pkg-config --variable=completionsdir bash-completion 2> /dev/null || :) -%global vagrant_spec_commit f3daedaac493ebc0ba1a96c915423a329e09e84a +%global vagrant_spec_commit 9413ab298407114528766efefd1fb1ff24589636 Name: vagrant -Version: 2.0.4 +Version: 2.1.1 Release: 1%{?dist} Summary: Build and distribute virtualized development environments Group: Development/Languages @@ -24,7 +24,7 @@ Source4: macros.vagrant # fails on older Fedoras. %{?load:%{SOURCE4}} -Patch0: vagrant-2.0.4-fix-dependencies.patch +Patch0: vagrant-2.1.1-fix-dependencies.patch Requires: ruby(release) Requires: ruby(rubygems) >= 1.3.6 @@ -305,6 +305,9 @@ end %changelog +* Thu Jun 07 2018 Pavel Valena - 2.1.1-1 +- Update to Vagrant 2.1.1. + * Mon Apr 23 2018 Pavel Valena - 2.0.4-1 - Update to Vagrant 2.0.4. From b64db12a10b84d94ba32898e845871aa7a495bfc Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 14 Jul 2018 08:23:05 +0000 Subject: [PATCH 17/83] - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- vagrant.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vagrant.spec b/vagrant.spec index 10ffc76..9d39caa 100644 --- a/vagrant.spec +++ b/vagrant.spec @@ -4,7 +4,7 @@ Name: vagrant Version: 2.1.1 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Build and distribute virtualized development environments Group: Development/Languages License: MIT @@ -305,6 +305,9 @@ end %changelog +* Sat Jul 14 2018 Fedora Release Engineering +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + * Thu Jun 07 2018 Pavel Valena - 2.1.1-1 - Update to Vagrant 2.1.1. From 81ee9f1a21569f50856ab4630816ff4aa2b2b37b Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Mon, 16 Jul 2018 00:53:56 +0200 Subject: [PATCH 18/83] Update to Vagrant 2.1.2. --- sources | 2 +- ...cies.patch => vagrant-2.1.2-fix-dependencies.patch | 10 +++------- vagrant.spec | 11 +++++++---- 3 files changed, 11 insertions(+), 12 deletions(-) rename vagrant-2.1.1-fix-dependencies.patch => vagrant-2.1.2-fix-dependencies.patch (87%) diff --git a/sources b/sources index b3835a5..afd0194 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (vagrant-2.1.1.tar.gz) = 6cc82b4c33b196fce2bc460447afd152e53c3c17b45db5d80958ff631f6747c386b625ff26e3d8830a88b2feca82d550ad1de32e7c7607dffb25960af43092f5 +SHA512 (vagrant-2.1.2.tar.gz) = d9a2612697842885d23d1a9a452ef9d8b03defa4e6f7a808725ac7c3a87300affcfdd89ee3a42334259601e19f1e56bfd86a5aa7b404eac26bc22dcfd4a57751 SHA512 (vagrant-spec-9413ab298407114528766efefd1fb1ff24589636.tar.gz) = 4dc502e75bb8795953c8c338892346431bbd3120239fa7a25175becf148c999293c264a6bb24c52c2821071303e2b20a8353b197370d595cf2e6bc00569cb631 diff --git a/vagrant-2.1.1-fix-dependencies.patch b/vagrant-2.1.2-fix-dependencies.patch similarity index 87% rename from vagrant-2.1.1-fix-dependencies.patch rename to vagrant-2.1.2-fix-dependencies.patch index f78117b..e3ad35c 100644 --- a/vagrant-2.1.1-fix-dependencies.patch +++ b/vagrant-2.1.2-fix-dependencies.patch @@ -4,14 +4,14 @@ Date: Thu, 20 Jul 2017 15:01:06 +0200 Subject: [PATCH] Fix dependencies for Vagrant 2.0.4. --- - vagrant.gemspec | 29 ++++++++++++++++------------- - 1 file changed, 16 insertions(+), 13 deletions(-) + vagrant.gemspec | 25 ++++++++++++++++------------- + 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/vagrant.gemspec b/vagrant.gemspec index c92ca17..aeee52f 100644 --- a/vagrant.gemspec +++ b/vagrant.gemspec -@@ -12,37 +12,40 @@ Gem::Specification.new do |s| +@@ -12,35 +12,38 @@ Gem::Specification.new do |s| s.summary = "Build and distribute virtualized development environments." s.description = "Vagrant is a tool for building and distributing virtualized development environments." @@ -37,14 +37,10 @@ index c92ca17..aeee52f 100644 + # s.add_dependency "rb-kqueue", "~> 0.2.0" s.add_dependency "rest-client", ">= 1.6.0", "< 3.0" - s.add_dependency "wdm", "~> 0.1.0" -- s.add_dependency "win32-file", "~> 0.8.1" -- s.add_dependency "win32-file-security", "~> 1.0.10" - s.add_dependency "winrm", "~> 2.1" - s.add_dependency "winrm-fs", "~> 1.0" - s.add_dependency "winrm-elevated", "~> 1.1" + # s.add_dependency "wdm", "~> 0.1.0" -+ # s.add_dependency "win32-file", "~> 0.8.1" -+ # s.add_dependency "win32-file-security", "~> 1.0.10" + # s.add_dependency "winrm", "~> 2.1" + # s.add_dependency "winrm-fs", "~> 1.0" + # s.add_dependency "winrm-elevated", "~> 1.1" diff --git a/vagrant.spec b/vagrant.spec index 9d39caa..4012338 100644 --- a/vagrant.spec +++ b/vagrant.spec @@ -3,8 +3,8 @@ %global vagrant_spec_commit 9413ab298407114528766efefd1fb1ff24589636 Name: vagrant -Version: 2.1.1 -Release: 2%{?dist} +Version: 2.1.2 +Release: 1%{?dist} Summary: Build and distribute virtualized development environments Group: Development/Languages License: MIT @@ -14,7 +14,7 @@ Source0: https://github.com/mitchellh/%{name}/archive/v%{version}/%{name}-%{vers Source1: binstub # The library has no official release yet. But since it is just test # dependency, it should be fine to include the source right here. -# wget https://github.com/mitchellh/vagrant-spec/archive/f3daedaac493ebc0ba1a96c915423a329e09e84a/vagrant-spec-f3daedaac493ebc0ba1a96c915423a329e09e84a.tar.gz +# wget https://github.com/mitchellh/vagrant-spec/archive/9413ab298407114528766efefd1fb1ff24589636/vagrant-spec-9413ab298407114528766efefd1fb1ff24589636.tar.gz Source2: https://github.com/mitchellh/%{name}-spec/archive/%{vagrant_spec_commit}/%{name}-spec-%{vagrant_spec_commit}.tar.gz # Monkey-patching needed for Vagrant to work until the respective patches # for RubyGems and Bundler are in place @@ -24,7 +24,7 @@ Source4: macros.vagrant # fails on older Fedoras. %{?load:%{SOURCE4}} -Patch0: vagrant-2.1.1-fix-dependencies.patch +Patch0: vagrant-2.1.2-fix-dependencies.patch Requires: ruby(release) Requires: ruby(rubygems) >= 1.3.6 @@ -305,6 +305,9 @@ end %changelog +* Wed Jul 18 2018 Pavel Valena - 2.1.2-1 +- Update to Vagrant 2.1.2. + * Sat Jul 14 2018 Fedora Release Engineering - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild From e00d21f356f1b4fb95b87dfdfde56890d5e1efb2 Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Wed, 18 Jul 2018 13:42:02 +0200 Subject: [PATCH 19/83] Add manpage generated using man2help. --- vagrant.spec | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/vagrant.spec b/vagrant.spec index 4012338..e01fd9c 100644 --- a/vagrant.spec +++ b/vagrant.spec @@ -67,6 +67,7 @@ BuildRequires: rubygem(thor) BuildRequires: rubygem(webmock) BuildRequires: rubygem(fake_ftp) BuildRequires: pkgconfig(bash-completion) +BuildRequires: help2man BuildRequires: %{_bindir}/ssh BuildArch: noarch @@ -156,6 +157,14 @@ $LOAD_PATH.unshift '%{vagrant_dir}/lib' require 'vagrant/plugin/manager' EOF +# Turn `vagrant --help` into man page. +export GEM_PATH="%{gem_dir}:%{buildroot}/usr/share/vagrant/gems" +# Needed to display help page without a warning. +export VAGRANT_INSTALLER_ENV=1 +mkdir -p %{buildroot}%{_mandir}/man1 +help2man --no-discard-stderr -N -s1 -o %{buildroot}%{_mandir}/man1/%{name}.1 \ + %{buildroot}/usr/share/%{name}/gems/gems/%{name}-%{version}/bin/%{name} + %check # Adjust the vagrant-spec directory name. @@ -302,6 +311,7 @@ end %{vagrant_plugin_instdir}/Rakefile %{vagrant_plugin_instdir}/tasks %{vagrant_plugin_instdir}/vagrant-spec.config.example.rb +%{_mandir}/man1/%{name}.1* %changelog From 9dd8d94baa103b4070b61c31c4e09c1825e7c689 Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Tue, 18 Sep 2018 16:30:39 +0200 Subject: [PATCH 20/83] Fix the change in packaging for nfs in Fedora. Forwardport https://src.fedoraproject.org/rpms/vagrant/pull-request/11 Resolves: rhbz#1620074 --- ...hange-in-packaging-for-nfs-in-Fedora.patch | 42 +++++++++++++++++++ vagrant.spec | 12 +++++- 2 files changed, 52 insertions(+), 2 deletions(-) create mode 100644 vagrant-2.1.3-Fix-change-in-packaging-for-nfs-in-Fedora.patch diff --git a/vagrant-2.1.3-Fix-change-in-packaging-for-nfs-in-Fedora.patch b/vagrant-2.1.3-Fix-change-in-packaging-for-nfs-in-Fedora.patch new file mode 100644 index 0000000..f4cdd6a --- /dev/null +++ b/vagrant-2.1.3-Fix-change-in-packaging-for-nfs-in-Fedora.patch @@ -0,0 +1,42 @@ +From f0b9d025e481eaf03db9a92ed51f3fe07541fa76 Mon Sep 17 00:00:00 2001 +From: langdon +Date: Thu, 14 Jun 2018 15:48:13 -0400 +Subject: [PATCH] Fixes the change in packaging for nfs in f28 (#9878). + However, removed part of the unit test which will be very difficult to fix (I + expect). The unit test is still doing a good test that nfs and rpcbind work + though. If you go far enough back, you need to bury the error out too. + +--- + plugins/guests/redhat/cap/nfs_client.rb | 6 +++++- + test/unit/plugins/guests/redhat/cap/nfs_client_test.rb | 1 - + 2 files changed, 5 insertions(+), 2 deletions(-) + +diff --git a/plugins/guests/redhat/cap/nfs_client.rb b/plugins/guests/redhat/cap/nfs_client.rb +index b1eb4c6e4b..f28a043464 100644 +--- a/plugins/guests/redhat/cap/nfs_client.rb ++++ b/plugins/guests/redhat/cap/nfs_client.rb +@@ -5,7 +5,11 @@ class NFSClient + def self.nfs_client_install(machine) + machine.communicate.sudo <<-EOH.gsub(/^ {12}/, '') + if command -v dnf; then +- dnf -y install nfs-utils nfs-utils-lib portmap ++ if `dnf info -q libnfs-utils > /dev/null 2>&1` ; then ++ dnf -y install nfs-utils libnfs-utils portmap ++ else ++ dnf -y install nfs-utils nfs-utils-lib portmap ++ fi + else + yum -y install nfs-utils nfs-utils-lib portmap + fi +diff --git a/test/unit/plugins/guests/redhat/cap/nfs_client_test.rb b/test/unit/plugins/guests/redhat/cap/nfs_client_test.rb +index a86136e19a..38a9efa69e 100644 +--- a/test/unit/plugins/guests/redhat/cap/nfs_client_test.rb ++++ b/test/unit/plugins/guests/redhat/cap/nfs_client_test.rb +@@ -23,7 +23,6 @@ + + it "installs rsync" do + cap.nfs_client_install(machine) +- expect(comm.received_commands[0]).to match(/install nfs-utils nfs-utils-lib portmap/) + expect(comm.received_commands[0]).to match(/\/bin\/systemctl restart rpcbind nfs/) + end + end diff --git a/vagrant.spec b/vagrant.spec index e01fd9c..74e9f4c 100644 --- a/vagrant.spec +++ b/vagrant.spec @@ -4,7 +4,7 @@ Name: vagrant Version: 2.1.2 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Build and distribute virtualized development environments Group: Development/Languages License: MIT @@ -26,6 +26,10 @@ Source4: macros.vagrant Patch0: vagrant-2.1.2-fix-dependencies.patch +# Handle rename of nfs-utils-lib to libnfs-utils in F28 +# https://github.com/hashicorp/vagrant/pull/9935/commits/f0b9d025e481eaf03db9a92ed51f3fe07541fa76 +Patch1: vagrant-2.1.3-Fix-change-in-packaging-for-nfs-in-Fedora.patch + Requires: ruby(release) Requires: ruby(rubygems) >= 1.3.6 # Explicitly specify MRI, since Vagrant does not work with JRuby ATM. @@ -98,6 +102,7 @@ Documentation for %{name}. %setup -q -b2 %patch0 -p1 +%patch1 -p1 %build gem build %{name}.gemspec @@ -257,7 +262,7 @@ begin rescue => e puts "Vagrant plugin un-register error: #{e}" end - + %files # Explicitly include Vagrant plugins directory strucure to avoid accidentally # packaged content. @@ -315,6 +320,9 @@ end %changelog +* Wed Sep 12 2018 Tobias Jungel - 2.1.2-2 +- handle rename of nfs-utils-lib/libnfs-utils in F28 guests (rhbz#1620074). + * Wed Jul 18 2018 Pavel Valena - 2.1.2-1 - Update to Vagrant 2.1.2. From 6fa066f3b95d2e800bda5b1a8b229120fae6b259 Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Thu, 20 Sep 2018 15:10:24 +0200 Subject: [PATCH 21/83] Update to Vagrant 2.1.5. --- sources | 4 +- ...hange-in-packaging-for-nfs-in-Fedora.patch | 42 ------------------- ...ch => vagrant-2.1.5-fix-dependencies.patch | 2 +- vagrant.spec | 18 ++++---- 4 files changed, 11 insertions(+), 55 deletions(-) delete mode 100644 vagrant-2.1.3-Fix-change-in-packaging-for-nfs-in-Fedora.patch rename vagrant-2.1.2-fix-dependencies.patch => vagrant-2.1.5-fix-dependencies.patch (98%) diff --git a/sources b/sources index afd0194..dfa246e 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (vagrant-2.1.2.tar.gz) = d9a2612697842885d23d1a9a452ef9d8b03defa4e6f7a808725ac7c3a87300affcfdd89ee3a42334259601e19f1e56bfd86a5aa7b404eac26bc22dcfd4a57751 -SHA512 (vagrant-spec-9413ab298407114528766efefd1fb1ff24589636.tar.gz) = 4dc502e75bb8795953c8c338892346431bbd3120239fa7a25175becf148c999293c264a6bb24c52c2821071303e2b20a8353b197370d595cf2e6bc00569cb631 +SHA512 (vagrant-2.1.5.tar.gz) = 544216eb25c06a1ebddbadcc9d2d6a6dd9932e33d2554e3d51dba0e24a339b9afe0b85d1322bdb67c5de3d070aa4c854f1ccc931b23ea80f0625eb4d1f120238 +SHA512 (vagrant-spec-94a9d31ba18b4130b14da12a2f7b4001c3d2ff12.tar.gz) = b95eefa52c21e1020f3f889fc5a72476a3ffb76f780b0254af85bbbc55465c05081f7c18303caa67843bc959326cbf253b57609faa8187fd89188a2488bfe922 diff --git a/vagrant-2.1.3-Fix-change-in-packaging-for-nfs-in-Fedora.patch b/vagrant-2.1.3-Fix-change-in-packaging-for-nfs-in-Fedora.patch deleted file mode 100644 index f4cdd6a..0000000 --- a/vagrant-2.1.3-Fix-change-in-packaging-for-nfs-in-Fedora.patch +++ /dev/null @@ -1,42 +0,0 @@ -From f0b9d025e481eaf03db9a92ed51f3fe07541fa76 Mon Sep 17 00:00:00 2001 -From: langdon -Date: Thu, 14 Jun 2018 15:48:13 -0400 -Subject: [PATCH] Fixes the change in packaging for nfs in f28 (#9878). - However, removed part of the unit test which will be very difficult to fix (I - expect). The unit test is still doing a good test that nfs and rpcbind work - though. If you go far enough back, you need to bury the error out too. - ---- - plugins/guests/redhat/cap/nfs_client.rb | 6 +++++- - test/unit/plugins/guests/redhat/cap/nfs_client_test.rb | 1 - - 2 files changed, 5 insertions(+), 2 deletions(-) - -diff --git a/plugins/guests/redhat/cap/nfs_client.rb b/plugins/guests/redhat/cap/nfs_client.rb -index b1eb4c6e4b..f28a043464 100644 ---- a/plugins/guests/redhat/cap/nfs_client.rb -+++ b/plugins/guests/redhat/cap/nfs_client.rb -@@ -5,7 +5,11 @@ class NFSClient - def self.nfs_client_install(machine) - machine.communicate.sudo <<-EOH.gsub(/^ {12}/, '') - if command -v dnf; then -- dnf -y install nfs-utils nfs-utils-lib portmap -+ if `dnf info -q libnfs-utils > /dev/null 2>&1` ; then -+ dnf -y install nfs-utils libnfs-utils portmap -+ else -+ dnf -y install nfs-utils nfs-utils-lib portmap -+ fi - else - yum -y install nfs-utils nfs-utils-lib portmap - fi -diff --git a/test/unit/plugins/guests/redhat/cap/nfs_client_test.rb b/test/unit/plugins/guests/redhat/cap/nfs_client_test.rb -index a86136e19a..38a9efa69e 100644 ---- a/test/unit/plugins/guests/redhat/cap/nfs_client_test.rb -+++ b/test/unit/plugins/guests/redhat/cap/nfs_client_test.rb -@@ -23,7 +23,6 @@ - - it "installs rsync" do - cap.nfs_client_install(machine) -- expect(comm.received_commands[0]).to match(/install nfs-utils nfs-utils-lib portmap/) - expect(comm.received_commands[0]).to match(/\/bin\/systemctl restart rpcbind nfs/) - end - end diff --git a/vagrant-2.1.2-fix-dependencies.patch b/vagrant-2.1.5-fix-dependencies.patch similarity index 98% rename from vagrant-2.1.2-fix-dependencies.patch rename to vagrant-2.1.5-fix-dependencies.patch index e3ad35c..abdf11c 100644 --- a/vagrant-2.1.2-fix-dependencies.patch +++ b/vagrant-2.1.5-fix-dependencies.patch @@ -28,7 +28,7 @@ index c92ca17..aeee52f 100644 s.add_dependency "listen", "~> 3.1.5" s.add_dependency "hashicorp-checkpoint", "~> 0.1.5" s.add_dependency "log4r", "~> 1.1.9", "< 1.1.11" - s.add_dependency "net-ssh", "~> 4.2.0" + s.add_dependency "net-ssh", "~> 5.0.0" s.add_dependency "net-sftp", "~> 2.1" - s.add_dependency "net-scp", "~> 1.2.0" - s.add_dependency "rb-kqueue", "~> 0.2.0" diff --git a/vagrant.spec b/vagrant.spec index 74e9f4c..3e21aa5 100644 --- a/vagrant.spec +++ b/vagrant.spec @@ -1,10 +1,10 @@ %global bashcompletion_dir %(pkg-config --variable=completionsdir bash-completion 2> /dev/null || :) -%global vagrant_spec_commit 9413ab298407114528766efefd1fb1ff24589636 +%global vagrant_spec_commit 94a9d31ba18b4130b14da12a2f7b4001c3d2ff12 Name: vagrant -Version: 2.1.2 -Release: 2%{?dist} +Version: 2.1.5 +Release: 1%{?dist} Summary: Build and distribute virtualized development environments Group: Development/Languages License: MIT @@ -14,7 +14,7 @@ Source0: https://github.com/mitchellh/%{name}/archive/v%{version}/%{name}-%{vers Source1: binstub # The library has no official release yet. But since it is just test # dependency, it should be fine to include the source right here. -# wget https://github.com/mitchellh/vagrant-spec/archive/9413ab298407114528766efefd1fb1ff24589636/vagrant-spec-9413ab298407114528766efefd1fb1ff24589636.tar.gz +# wget https://github.com/mitchellh/vagrant-spec/archive/94a9d31ba18b4130b14da12a2f7b4001c3d2ff12/vagrant-spec-94a9d31ba18b4130b14da12a2f7b4001c3d2ff12.tar.gz Source2: https://github.com/mitchellh/%{name}-spec/archive/%{vagrant_spec_commit}/%{name}-spec-%{vagrant_spec_commit}.tar.gz # Monkey-patching needed for Vagrant to work until the respective patches # for RubyGems and Bundler are in place @@ -24,11 +24,7 @@ Source4: macros.vagrant # fails on older Fedoras. %{?load:%{SOURCE4}} -Patch0: vagrant-2.1.2-fix-dependencies.patch - -# Handle rename of nfs-utils-lib to libnfs-utils in F28 -# https://github.com/hashicorp/vagrant/pull/9935/commits/f0b9d025e481eaf03db9a92ed51f3fe07541fa76 -Patch1: vagrant-2.1.3-Fix-change-in-packaging-for-nfs-in-Fedora.patch +Patch0: vagrant-2.1.5-fix-dependencies.patch Requires: ruby(release) Requires: ruby(rubygems) >= 1.3.6 @@ -102,7 +98,6 @@ Documentation for %{name}. %setup -q -b2 %patch0 -p1 -%patch1 -p1 %build gem build %{name}.gemspec @@ -320,6 +315,9 @@ end %changelog +* Wed Sep 19 2018 Pavel Valena - 2.1.5-1 +- Update to Vagrant 2.1.5. + * Wed Sep 12 2018 Tobias Jungel - 2.1.2-2 - handle rename of nfs-utils-lib/libnfs-utils in F28 guests (rhbz#1620074). From 9ab4392602c90ee3967cc89cd64439cf4c7a3f4d Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Tue, 2 Oct 2018 13:06:31 +0200 Subject: [PATCH 22/83] Update restart logic in redhat change_host_name cap https://github.com/hashicorp/vagrant/pull/10223 --- ...2.1.6-update-restart-logic-in-redhat.patch | 552 ++++++++++++++++++ vagrant.spec | 7 + 2 files changed, 559 insertions(+) create mode 100644 vagrant-2.1.6-update-restart-logic-in-redhat.patch diff --git a/vagrant-2.1.6-update-restart-logic-in-redhat.patch b/vagrant-2.1.6-update-restart-logic-in-redhat.patch new file mode 100644 index 0000000..94ec982 --- /dev/null +++ b/vagrant-2.1.6-update-restart-logic-in-redhat.patch @@ -0,0 +1,552 @@ +From 80006251f422a8d534ff9bafa0e0c45d9c98143c Mon Sep 17 00:00:00 2001 +From: Joe Doss +Date: Mon, 17 Sep 2018 13:30:55 -0500 +Subject: [PATCH 01/10] Add in logic to restart NetworkManager if it is + enabled. + +--- + plugins/guests/redhat/cap/change_host_name.rb | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/plugins/guests/redhat/cap/change_host_name.rb b/plugins/guests/redhat/cap/change_host_name.rb +index 55fcdc4b48..8f32650035 100644 +--- a/plugins/guests/redhat/cap/change_host_name.rb ++++ b/plugins/guests/redhat/cap/change_host_name.rb +@@ -29,7 +29,13 @@ def self.change_host_name(machine, name) + } + + # Restart network +- service network restart ++ if (test -f /etc/init.d/network && /etc/init.d/network status &> /dev/null ); then ++ service network restart ++ elif (test -f /usr/lib/systemd/system/NetworkManager.service && systemctl is-enabled NetworkManager.service &> /dev/null ); then ++ systemctl restart NetworkManager.service ++ else ++ printf "Could not restart the network to set the new hostname!\n" ++ fi + EOH + end + end + +From 94954739b53ee4c6741a35c366c2fe5c9853e0ed Mon Sep 17 00:00:00 2001 +From: Joe Doss +Date: Mon, 17 Sep 2018 14:30:57 -0500 +Subject: [PATCH 02/10] Simplified if statements. + +--- + plugins/guests/redhat/cap/change_host_name.rb | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/plugins/guests/redhat/cap/change_host_name.rb b/plugins/guests/redhat/cap/change_host_name.rb +index 8f32650035..e9c0b1d80e 100644 +--- a/plugins/guests/redhat/cap/change_host_name.rb ++++ b/plugins/guests/redhat/cap/change_host_name.rb +@@ -29,9 +29,9 @@ def self.change_host_name(machine, name) + } + + # Restart network +- if (test -f /etc/init.d/network && /etc/init.d/network status &> /dev/null ); then ++ if test -f /etc/init.d/network; then + service network restart +- elif (test -f /usr/lib/systemd/system/NetworkManager.service && systemctl is-enabled NetworkManager.service &> /dev/null ); then ++ elif systemctl -q is-enabled NetworkManager.service; then + systemctl restart NetworkManager.service + else + printf "Could not restart the network to set the new hostname!\n" + +From c14a4a09f723230682c5ef5f9dc53662e2968b92 Mon Sep 17 00:00:00 2001 +From: Joe Doss +Date: Mon, 17 Sep 2018 14:56:06 -0500 +Subject: [PATCH 03/10] Switch if statements, check for systemctl, and switch + to is-active. + +--- + plugins/guests/redhat/cap/change_host_name.rb | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/plugins/guests/redhat/cap/change_host_name.rb b/plugins/guests/redhat/cap/change_host_name.rb +index e9c0b1d80e..70bd496943 100644 +--- a/plugins/guests/redhat/cap/change_host_name.rb ++++ b/plugins/guests/redhat/cap/change_host_name.rb +@@ -29,10 +29,10 @@ def self.change_host_name(machine, name) + } + + # Restart network +- if test -f /etc/init.d/network; then +- service network restart +- elif systemctl -q is-enabled NetworkManager.service; then ++ if (test -f /usr/bin/systemctl && systemctl -q is-active NetworkManager.service); then + systemctl restart NetworkManager.service ++ elif test -f /etc/init.d/network; then ++ service network restart + else + printf "Could not restart the network to set the new hostname!\n" + fi + +From 19aa9578c797c99a8632955a703490d5e6b50a26 Mon Sep 17 00:00:00 2001 +From: Joe Doss +Date: Tue, 18 Sep 2018 13:15:26 -0500 +Subject: [PATCH 04/10] Exit 1 if we cannot set the hostname. + +--- + plugins/guests/redhat/cap/change_host_name.rb | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/plugins/guests/redhat/cap/change_host_name.rb b/plugins/guests/redhat/cap/change_host_name.rb +index 70bd496943..ae02460156 100644 +--- a/plugins/guests/redhat/cap/change_host_name.rb ++++ b/plugins/guests/redhat/cap/change_host_name.rb +@@ -35,6 +35,7 @@ def self.change_host_name(machine, name) + service network restart + else + printf "Could not restart the network to set the new hostname!\n" ++ exit 1 + fi + EOH + end + +From 86ab4533b180009ed476026374110fc0bd79f522 Mon Sep 17 00:00:00 2001 +From: Joe Doss +Date: Tue, 18 Sep 2018 13:16:12 -0500 +Subject: [PATCH 05/10] Fix the test to check for systemctl restart + NetworkManager.service too. + +--- + test/unit/plugins/guests/redhat/cap/change_host_name_test.rb | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/test/unit/plugins/guests/redhat/cap/change_host_name_test.rb b/test/unit/plugins/guests/redhat/cap/change_host_name_test.rb +index 7662935458..10f43a3593 100644 +--- a/test/unit/plugins/guests/redhat/cap/change_host_name_test.rb ++++ b/test/unit/plugins/guests/redhat/cap/change_host_name_test.rb +@@ -31,7 +31,7 @@ + expect(comm.received_commands[1]).to match(/\/etc\/sysconfig\/network-scripts\/ifcfg/) + expect(comm.received_commands[1]).to match(/hostnamectl set-hostname --static '#{name}'/) + expect(comm.received_commands[1]).to match(/hostnamectl set-hostname --transient '#{name}'/) +- expect(comm.received_commands[1]).to match(/service network restart/) ++ expect(comm.received_commands[1]).to match(/service network restart|systemctl restart NetworkManager.service/) + end + + it "does not change the hostname if already set" do + +From a12b09b098ea87eec815e166d0e1395f6f47f937 Mon Sep 17 00:00:00 2001 +From: shotop +Date: Thu, 20 Sep 2018 14:21:40 -0500 +Subject: [PATCH 06/10] add specs around network restart logic + +--- + .../redhat/cap/change_host_name_test.rb | 27 +++++++++++++++++++ + 1 file changed, 27 insertions(+) + +diff --git a/test/unit/plugins/guests/redhat/cap/change_host_name_test.rb b/test/unit/plugins/guests/redhat/cap/change_host_name_test.rb +index 10f43a3593..b85802e947 100644 +--- a/test/unit/plugins/guests/redhat/cap/change_host_name_test.rb ++++ b/test/unit/plugins/guests/redhat/cap/change_host_name_test.rb +@@ -39,5 +39,32 @@ + cap.change_host_name(machine, name) + expect(comm.received_commands.size).to eq(1) + end ++ ++ context "restarts the network" do ++ it "uses systemctl and NetworkManager.service" do ++ comm.stub_command("hostname -f | grep '^#{name}$'", exit_code: 1) ++ comm.stub_command("test -f /usr/bin/systemctl && systemctl -q is-active NetworkManager.service", exit_code: 0) ++ cap.change_host_name(machine, name) ++ expect(comm.received_commands[1]).to match(/systemctl restart NetworkManager.service/) ++ end ++ ++ it "uses the service command" do ++ comm.stub_command("hostname -f | grep '^#{name}$'", exit_code: 1) ++ comm.stub_command("test -f /usr/bin/systemctl && systemctl -q is-active NetworkManager.service", exit_code: 1) ++ comm.stub_command("test -f /etc/init.d/network", exit_code: 0) ++ cap.change_host_name(machine, name) ++ expect(comm.received_commands[1]).to match(/service network restart/) ++ end ++ end ++ ++ context "cannot restart the network" do ++ it "prints cannot restart message" do ++ comm.stub_command("hostname -f | grep '^#{name}$'", exit_code: 1) ++ comm.stub_command("test -f /usr/bin/systemctl && systemctl -q is-active NetworkManager.service", exit_code: 1) ++ comm.stub_command("test -f /etc/init.d/network", exit_code: 1) ++ cap.change_host_name(machine, name) ++ expect(comm.received_commands[1]).to match(/printf "Could not restart the network to set the new hostname!/) ++ end ++ end + end + end + +From fb5fc0e657a10ee1eaf046980827cc1802c4d0f9 Mon Sep 17 00:00:00 2001 +From: Chris Roberts +Date: Thu, 20 Sep 2018 16:42:39 -0700 +Subject: [PATCH 07/10] Update guest inspection utility module + +Use sudo option for communicator test command instead of inline sudo +to properly use configured sudo value. Use command for checking +availability of hostnamectl. Use is-active for determining if a +service is being actively managed by systemd. +--- + lib/vagrant/util/guest_inspection.rb | 21 +++++++++++++++++---- + 1 file changed, 17 insertions(+), 4 deletions(-) + +diff --git a/lib/vagrant/util/guest_inspection.rb b/lib/vagrant/util/guest_inspection.rb +index 86ab1dc69e..5a1902d8da 100644 +--- a/lib/vagrant/util/guest_inspection.rb ++++ b/lib/vagrant/util/guest_inspection.rb +@@ -12,27 +12,39 @@ module Linux + # + # @return [Boolean] + def systemd?(comm) +- comm.test("sudo ps -o comm= 1 | grep systemd") ++ comm.test("ps -o comm= 1 | grep systemd") + end + + # systemd-networkd.service is in use + # ++ # @param [Vagrant::Plugin::V2::Communicator] comm Guest communicator + # @return [Boolean] + def systemd_networkd?(comm) +- comm.test("sudo systemctl status systemd-networkd.service") ++ comm.test("systemctl -q is-active systemd-networkd.service", sudo: true) ++ end ++ ++ # Check if given service is controlled by systemd ++ # ++ # @param [Vagrant::Plugin::V2::Communicator] comm Guest communicator ++ # @param [String] service_name Name of the service to check ++ # @return [Boolean] ++ def systemd_controlled?(comm, service_name) ++ comm.test("systemctl -q is-active #{service_name}", sudo: true) + end + + # systemd hostname set is via hostnamectl + # ++ # @param [Vagrant::Plugin::V2::Communicator] comm Guest communicator + # @return [Boolean] + def hostnamectl?(comm) +- comm.test("hostnamectl") ++ comm.test("command -v hostnamectl") + end + + ## netplan helpers + + # netplan is installed + # ++ # @param [Vagrant::Plugin::V2::Communicator] comm Guest communicator + # @return [Boolean] + def netplan?(comm) + comm.test("netplan -h") +@@ -42,6 +54,7 @@ def netplan?(comm) + + # nmcli is installed + # ++ # @param [Vagrant::Plugin::V2::Communicator] comm Guest communicator + # @return [Boolean] + def nmcli?(comm) + comm.test("nmcli -t") +@@ -49,7 +62,7 @@ def nmcli?(comm) + + # NetworkManager currently controls device + # +- # @param comm [Communicator] ++ # @param [Vagrant::Plugin::V2::Communicator] comm Guest communicator + # @param device_name [String] + # @return [Boolean] + def nm_controlled?(comm, device_name) + +From ff021fcab404c95e52566bfca4207da9c0101e01 Mon Sep 17 00:00:00 2001 +From: Chris Roberts +Date: Thu, 20 Sep 2018 16:44:08 -0700 +Subject: [PATCH 08/10] Update redhat change host name capability to support + systemd + +Update capability to use guest inspection module for determining +correct actions to execute. When systemd is in use restart the +correct active service, either NetworkManager or networkd. Default +to using the original service restart when systemd service is not +found. +--- + plugins/guests/redhat/cap/change_host_name.rb | 41 ++++++++++--------- + 1 file changed, 21 insertions(+), 20 deletions(-) + +diff --git a/plugins/guests/redhat/cap/change_host_name.rb b/plugins/guests/redhat/cap/change_host_name.rb +index ae02460156..5da660df05 100644 +--- a/plugins/guests/redhat/cap/change_host_name.rb ++++ b/plugins/guests/redhat/cap/change_host_name.rb +@@ -2,6 +2,9 @@ module VagrantPlugins + module GuestRedHat + module Cap + class ChangeHostName ++ ++ extend Vagrant::Util::GuestInspection ++ + def self.change_host_name(machine, name) + comm = machine.communicate + +@@ -10,34 +13,32 @@ def self.change_host_name(machine, name) + comm.sudo <<-EOH.gsub(/^ {14}/, '') + # Update sysconfig + sed -i 's/\\(HOSTNAME=\\).*/\\1#{name}/' /etc/sysconfig/network +- + # Update DNS + sed -i 's/\\(DHCP_HOSTNAME=\\).*/\\1\"#{basename}\"/' /etc/sysconfig/network-scripts/ifcfg-* +- + # Set the hostname - use hostnamectl if available + echo '#{name}' > /etc/hostname +- if command -v hostnamectl; then +- hostnamectl set-hostname --static '#{name}' +- hostnamectl set-hostname --transient '#{name}' +- else +- hostname -F /etc/hostname +- fi +- +- # Prepend ourselves to /etc/hosts + grep -w '#{name}' /etc/hosts || { + sed -i'' '1i 127.0.0.1\\t#{name}\\t#{basename}' /etc/hosts + } +- +- # Restart network +- if (test -f /usr/bin/systemctl && systemctl -q is-active NetworkManager.service); then +- systemctl restart NetworkManager.service +- elif test -f /etc/init.d/network; then +- service network restart +- else +- printf "Could not restart the network to set the new hostname!\n" +- exit 1 +- fi + EOH ++ ++ if hostnamectl?(comm) ++ comm.sudo("hostnamectl set-hostname --static '#{name}' ; " \ ++ "hostnamectl set-hostname --transient '#{name}'") ++ else ++ comm.sudo("hostname -F /etc/hostname") ++ end ++ ++ restart_command = "service network restart" ++ ++ if systemd? ++ if systemd_networkd?(comm) ++ restart_command = "systemctl restart systemd-networkd.service" ++ elsif systemd_controlled?(comm, "NetworkManager.service") ++ restart_command = "systemctl restart NetworkManager.service" ++ end ++ end ++ comm.sudo(restart_command) + end + end + end + +From bc217d5e577457df5ac4ecdfffa17fd0a8c85b18 Mon Sep 17 00:00:00 2001 +From: Chris Roberts +Date: Thu, 20 Sep 2018 16:46:45 -0700 +Subject: [PATCH 09/10] Update redhat change host name capability tests for + systemd/NetworkManger updates + +--- + .../redhat/cap/change_host_name_test.rb | 95 +++++++++++++------ + 1 file changed, 68 insertions(+), 27 deletions(-) + +diff --git a/test/unit/plugins/guests/redhat/cap/change_host_name_test.rb b/test/unit/plugins/guests/redhat/cap/change_host_name_test.rb +index b85802e947..8d0c9ebd4b 100644 +--- a/test/unit/plugins/guests/redhat/cap/change_host_name_test.rb ++++ b/test/unit/plugins/guests/redhat/cap/change_host_name_test.rb +@@ -20,50 +20,91 @@ + + describe ".change_host_name" do + let(:cap) { caps.get(:change_host_name) } +- + let(:name) { "banana-rama.example.com" } ++ let(:hostname_changed) { true } ++ let(:systemd) { true } ++ let(:hostnamectl) { true } ++ let(:networkd) { true } ++ let(:network_manager) { false } + +- it "sets the hostname" do +- comm.stub_command("hostname -f | grep '^#{name}$'", exit_code: 1) ++ before do ++ comm.stub_command("hostname -f | grep '^#{name}$'", exit_code: hostname_changed ? 1 : 0) ++ allow(cap).to receive(:systemd?).and_return(systemd) ++ allow(cap).to receive(:hostnamectl?).and_return(hostnamectl) ++ allow(cap).to receive(:systemd_networkd?).and_return(networkd) ++ allow(cap).to receive(:systemd_controlled?).with(anything, /NetworkManager/).and_return(network_manager) ++ end + ++ it "sets the hostname" do + cap.change_host_name(machine, name) + expect(comm.received_commands[1]).to match(/\/etc\/sysconfig\/network/) + expect(comm.received_commands[1]).to match(/\/etc\/sysconfig\/network-scripts\/ifcfg/) +- expect(comm.received_commands[1]).to match(/hostnamectl set-hostname --static '#{name}'/) +- expect(comm.received_commands[1]).to match(/hostnamectl set-hostname --transient '#{name}'/) +- expect(comm.received_commands[1]).to match(/service network restart|systemctl restart NetworkManager.service/) + end + +- it "does not change the hostname if already set" do +- comm.stub_command("hostname -f | grep '^#{name}$'", exit_code: 0) +- cap.change_host_name(machine, name) +- expect(comm.received_commands.size).to eq(1) +- end ++ context "when hostnamectl is in use" do ++ let(:hostnamectl) { true } + +- context "restarts the network" do +- it "uses systemctl and NetworkManager.service" do +- comm.stub_command("hostname -f | grep '^#{name}$'", exit_code: 1) +- comm.stub_command("test -f /usr/bin/systemctl && systemctl -q is-active NetworkManager.service", exit_code: 0) ++ it "sets hostname with hostnamectl" do + cap.change_host_name(machine, name) +- expect(comm.received_commands[1]).to match(/systemctl restart NetworkManager.service/) ++ expect(comm.received_commands[2]).to match(/hostnamectl/) + end ++ end ++ ++ context "when hostnamectl is not in use" do ++ let(:hostnamectl) { false } + +- it "uses the service command" do +- comm.stub_command("hostname -f | grep '^#{name}$'", exit_code: 1) +- comm.stub_command("test -f /usr/bin/systemctl && systemctl -q is-active NetworkManager.service", exit_code: 1) +- comm.stub_command("test -f /etc/init.d/network", exit_code: 0) ++ it "sets hostname with hostname command" do + cap.change_host_name(machine, name) +- expect(comm.received_commands[1]).to match(/service network restart/) ++ expect(comm.received_commands[2]).to match(/hostname -F/) + end + end + +- context "cannot restart the network" do +- it "prints cannot restart message" do +- comm.stub_command("hostname -f | grep '^#{name}$'", exit_code: 1) +- comm.stub_command("test -f /usr/bin/systemctl && systemctl -q is-active NetworkManager.service", exit_code: 1) +- comm.stub_command("test -f /etc/init.d/network", exit_code: 1) ++ context "when host name is already set" do ++ let(:hostname_changed) { false } ++ ++ it "does not change the hostname" do + cap.change_host_name(machine, name) +- expect(comm.received_commands[1]).to match(/printf "Could not restart the network to set the new hostname!/) ++ expect(comm.received_commands.size).to eq(1) ++ end ++ end ++ ++ context "restarts the network" do ++ context "when networkd is in use" do ++ let(:networkd) { true } ++ ++ it "restarts networkd with systemctl" do ++ cap.change_host_name(machine, name) ++ expect(comm.received_commands[3]).to match(/systemctl restart systemd-networkd/) ++ end ++ end ++ ++ context "when NetworkManager is in use" do ++ let(:networkd) { false } ++ let(:network_manager) { true } ++ ++ it "restarts NetworkManager with systemctl" do ++ cap.change_host_name(machine, name) ++ expect(comm.received_commands[3]).to match(/systemctl restart NetworkManager/) ++ end ++ end ++ ++ context "when networkd and NetworkManager are not in use" do ++ let(:networkd) { false } ++ let(:network_manager) { false } ++ ++ it "restarts the network using service" do ++ cap.change_host_name(machine, name) ++ expect(comm.received_commands[3]).to match(/service network restart/) ++ end ++ end ++ ++ context "when systemd is not in use" do ++ let(:systemd) { false } ++ ++ it "restarts the network using service" do ++ cap.change_host_name(machine, name) ++ expect(comm.received_commands[3]).to match(/service network restart/) ++ end + end + end + end + +From 8fd05fe3c1b773777f08ca50dd651cbaf33838d3 Mon Sep 17 00:00:00 2001 +From: Chris Roberts +Date: Fri, 21 Sep 2018 09:19:40 -0700 +Subject: [PATCH 10/10] Use `command -v` for checks in all inspection helpers. + Fix stubs in tests. + +--- + lib/vagrant/util/guest_inspection.rb | 4 ++-- + .../guests/debian/cap/configure_networks_test.rb | 14 +++++++------- + 2 files changed, 9 insertions(+), 9 deletions(-) + +diff --git a/lib/vagrant/util/guest_inspection.rb b/lib/vagrant/util/guest_inspection.rb +index 5a1902d8da..cd0a96d3ef 100644 +--- a/lib/vagrant/util/guest_inspection.rb ++++ b/lib/vagrant/util/guest_inspection.rb +@@ -47,7 +47,7 @@ def hostnamectl?(comm) + # @param [Vagrant::Plugin::V2::Communicator] comm Guest communicator + # @return [Boolean] + def netplan?(comm) +- comm.test("netplan -h") ++ comm.test("command -v netplan") + end + + ## nmcli helpers +@@ -57,7 +57,7 @@ def netplan?(comm) + # @param [Vagrant::Plugin::V2::Communicator] comm Guest communicator + # @return [Boolean] + def nmcli?(comm) +- comm.test("nmcli -t") ++ comm.test("command -v nmcli") + end + + # NetworkManager currently controls device +diff --git a/test/unit/plugins/guests/debian/cap/configure_networks_test.rb b/test/unit/plugins/guests/debian/cap/configure_networks_test.rb +index b4691d0fd4..d3a523c95b 100644 +--- a/test/unit/plugins/guests/debian/cap/configure_networks_test.rb ++++ b/test/unit/plugins/guests/debian/cap/configure_networks_test.rb +@@ -67,9 +67,9 @@ + before do + allow(comm).to receive(:test).with("nmcli -t d show eth1").and_return(false) + allow(comm).to receive(:test).with("nmcli -t d show eth2").and_return(false) +- allow(comm).to receive(:test).with("sudo ps -o comm= 1 | grep systemd").and_return(false) +- allow(comm).to receive(:test).with("sudo systemctl status systemd-networkd.service").and_return(false) +- allow(comm).to receive(:test).with("netplan -h").and_return(false) ++ allow(comm).to receive(:test).with("ps -o comm= 1 | grep systemd").and_return(false) ++ allow(comm).to receive(:test).with("systemctl -q is-active systemd-networkd.service", anything).and_return(false) ++ allow(comm).to receive(:test).with("command -v netplan").and_return(false) + end + + it "creates and starts the networks using net-tools" do +@@ -85,8 +85,8 @@ + + context "with systemd" do + before do +- expect(comm).to receive(:test).with("sudo ps -o comm= 1 | grep systemd").and_return(true) +- allow(comm).to receive(:test).with("netplan -h").and_return(false) ++ expect(comm).to receive(:test).with("ps -o comm= 1 | grep systemd").and_return(true) ++ allow(comm).to receive(:test).with("command -v netplan").and_return(false) + end + + it "creates and starts the networks using net-tools" do +@@ -102,7 +102,7 @@ + + context "with systemd-networkd" do + before do +- expect(comm).to receive(:test).with("sudo systemctl status systemd-networkd.service").and_return(true) ++ expect(comm).to receive(:test).with("systemctl -q is-active systemd-networkd.service", anything).and_return(true) + end + + it "creates and starts the networks using systemd-networkd" do +@@ -117,7 +117,7 @@ + + context "with netplan" do + before do +- expect(comm).to receive(:test).with("netplan -h").and_return(true) ++ expect(comm).to receive(:test).with("command -v netplan").and_return(true) + end + + let(:nm_yml) { "---\nnetwork:\n version: 2\n renderer: NetworkManager\n ethernets:\n eth1:\n dhcp4: true\n eth2:\n addresses:\n - 33.33.33.10/16\n gateway4: 33.33.0.1\n" } diff --git a/vagrant.spec b/vagrant.spec index 3e21aa5..5b69b86 100644 --- a/vagrant.spec +++ b/vagrant.spec @@ -26,6 +26,11 @@ Source4: macros.vagrant Patch0: vagrant-2.1.5-fix-dependencies.patch +# Update restart logic in redhat change_host_name cap +# https://bugzilla.redhat.com/show_bug.cgi?id=1624068 +# https://github.com/hashicorp/vagrant/pull/10223 +Patch1: vagrant-2.1.6-update-restart-logic-in-redhat.patch + Requires: ruby(release) Requires: ruby(rubygems) >= 1.3.6 # Explicitly specify MRI, since Vagrant does not work with JRuby ATM. @@ -98,6 +103,7 @@ Documentation for %{name}. %setup -q -b2 %patch0 -p1 +%patch1 -p1 %build gem build %{name}.gemspec @@ -317,6 +323,7 @@ end %changelog * Wed Sep 19 2018 Pavel Valena - 2.1.5-1 - Update to Vagrant 2.1.5. +- Update restart logic for redhat change_host_name cap(rhbz#1624068) * Wed Sep 12 2018 Tobias Jungel - 2.1.2-2 - handle rename of nfs-utils-lib/libnfs-utils in F28 guests (rhbz#1620074). From 76d7f3f923ab2cb93cd4662e9e814124d0af3de1 Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Thu, 11 Oct 2018 13:18:41 +0200 Subject: [PATCH 23/83] Fix: add two additional patches for change_host_name logic * https://github.com/hashicorp/vagrant/commit/11b0d58fa081cd9a27c272244a0d119acc81f32e * https://github.com/hashicorp/vagrant/commit/1797798760eb72d6b02724f75bc54dd83815e986 The functionality was not backported fully so vagrant crashed on hostname change. https://bugzilla.redhat.com/show_bug.cgi?id=1624068 --- ...2.1.6-update-restart-logic-in-redhat.patch | 46 +++++++++++++++++++ vagrant.spec | 7 ++- 2 files changed, 52 insertions(+), 1 deletion(-) diff --git a/vagrant-2.1.6-update-restart-logic-in-redhat.patch b/vagrant-2.1.6-update-restart-logic-in-redhat.patch index 94ec982..1457a96 100644 --- a/vagrant-2.1.6-update-restart-logic-in-redhat.patch +++ b/vagrant-2.1.6-update-restart-logic-in-redhat.patch @@ -550,3 +550,49 @@ index b4691d0fd4..d3a523c95b 100644 end let(:nm_yml) { "---\nnetwork:\n version: 2\n renderer: NetworkManager\n ethernets:\n eth1:\n dhcp4: true\n eth2:\n addresses:\n - 33.33.33.10/16\n gateway4: 33.33.0.1\n" } + +From 1797798760eb72d6b02724f75bc54dd83815e986 Mon Sep 17 00:00:00 2001 +From: Chris Roberts +Date: Fri, 28 Sep 2018 07:59:39 -0700 +Subject: [PATCH] Fix module name + +--- + plugins/guests/redhat/cap/change_host_name.rb | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/plugins/guests/redhat/cap/change_host_name.rb b/plugins/guests/redhat/cap/change_host_name.rb +index 5da660df05..37c8912a80 100644 +--- a/plugins/guests/redhat/cap/change_host_name.rb ++++ b/plugins/guests/redhat/cap/change_host_name.rb +@@ -3,7 +3,7 @@ module GuestRedHat + module Cap + class ChangeHostName + +- extend Vagrant::Util::GuestInspection ++ extend Vagrant::Util::GuestInspection::Linux + + def self.change_host_name(machine, name) + comm = machine.communicate + +From 11b0d58fa081cd9a27c272244a0d119acc81f32e Mon Sep 17 00:00:00 2001 +From: Chris Roberts +Date: Mon, 1 Oct 2018 08:43:49 -0700 +Subject: [PATCH] Include communicator on call + +--- + plugins/guests/redhat/cap/change_host_name.rb | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/plugins/guests/redhat/cap/change_host_name.rb b/plugins/guests/redhat/cap/change_host_name.rb +index 37c8912a80..5ceb63665a 100644 +--- a/plugins/guests/redhat/cap/change_host_name.rb ++++ b/plugins/guests/redhat/cap/change_host_name.rb +@@ -31,7 +31,7 @@ def self.change_host_name(machine, name) + + restart_command = "service network restart" + +- if systemd? ++ if systemd?(comm) + if systemd_networkd?(comm) + restart_command = "systemctl restart systemd-networkd.service" + elsif systemd_controlled?(comm, "NetworkManager.service") diff --git a/vagrant.spec b/vagrant.spec index 5b69b86..e9ade0a 100644 --- a/vagrant.spec +++ b/vagrant.spec @@ -4,7 +4,7 @@ Name: vagrant Version: 2.1.5 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Build and distribute virtualized development environments Group: Development/Languages License: MIT @@ -29,6 +29,8 @@ Patch0: vagrant-2.1.5-fix-dependencies.patch # Update restart logic in redhat change_host_name cap # https://bugzilla.redhat.com/show_bug.cgi?id=1624068 # https://github.com/hashicorp/vagrant/pull/10223 +# https://github.com/hashicorp/vagrant/commit/11b0d58fa081cd9a27c272244a0d119acc81f32e +# https://github.com/hashicorp/vagrant/commit/1797798760eb72d6b02724f75bc54dd83815e986 Patch1: vagrant-2.1.6-update-restart-logic-in-redhat.patch Requires: ruby(release) @@ -321,6 +323,9 @@ end %changelog +* Thu Oct 11 2018 Pavel Valena - 2.1.5-2 +- Fix: two additional patches for change_host_name logic(rhbz#1624068) + * Wed Sep 19 2018 Pavel Valena - 2.1.5-1 - Update to Vagrant 2.1.5. - Update restart logic for redhat change_host_name cap(rhbz#1624068) From 548a38c88eda5c6c69e307775d4921238280f9da Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Tue, 16 Oct 2018 12:53:25 +0200 Subject: [PATCH 24/83] Allow use of newer Childprocess gem also needs macro from rubygems-devel to edit vagrant.gemspec. --- vagrant.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/vagrant.spec b/vagrant.spec index e9ade0a..88ec51d 100644 --- a/vagrant.spec +++ b/vagrant.spec @@ -57,6 +57,7 @@ Requires(pre): shadow-utils BuildRequires: bsdtar BuildRequires: ruby +BuildRequires: rubygems-devel BuildRequires: rubygem(listen) BuildRequires: rubygem(childprocess) BuildRequires: rubygem(hashicorp-checkpoint) @@ -108,6 +109,9 @@ Documentation for %{name}. %patch1 -p1 %build +%gemspec_remove_dep -s %{name}.gemspec -g childprocess '~> 0.5.0' +%gemspec_add_dep -s %{name}.gemspec -g childprocess '>= 0.5.0' + gem build %{name}.gemspec gem install -V --local \ @@ -186,8 +190,7 @@ sed -i '/git/ s/^/#/' ../vagrant-spec/vagrant-spec.gemspec sed -i '/thor/ s/~>/>=/' ../vagrant-spec/vagrant-spec.gemspec sed -i '/rspec/ s/~>/>=/' ./vagrant.gemspec sed -i '/rspec/ s/~>/>=/' ../vagrant-spec/vagrant-spec.gemspec -# TODO: package newer childproccess -sed -i '/childprocess/ s/~>/<=/' ../vagrant-spec/vagrant-spec.gemspec +sed -i '/childprocess/ s/~>/>=/' ../vagrant-spec/vagrant-spec.gemspec #Insert new test dependencies sed -i '25 i\ spec.add_dependency "webmock"' ../vagrant-spec/vagrant-spec.gemspec From 28047ef9d719a6bf15d4ff57d65d0b8c8d8806ee Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Mon, 28 Jan 2019 20:18:29 +0100 Subject: [PATCH 25/83] Remove obsolete Group tag References: https://fedoraproject.org/wiki/Changes/Remove_Group_Tag --- vagrant.spec | 2 -- 1 file changed, 2 deletions(-) diff --git a/vagrant.spec b/vagrant.spec index 88ec51d..92fac8c 100644 --- a/vagrant.spec +++ b/vagrant.spec @@ -6,7 +6,6 @@ Name: vagrant Version: 2.1.5 Release: 2%{?dist} Summary: Build and distribute virtualized development environments -Group: Development/Languages License: MIT URL: http://vagrantup.com Source0: https://github.com/mitchellh/%{name}/archive/v%{version}/%{name}-%{version}.tar.gz @@ -95,7 +94,6 @@ environments. %package doc Summary: Documentation for %{name} -Group: Documentation Requires: %{name} = %{version}-%{release} BuildArch: noarch From 3223e537f5ddc26e0ce6d8db4381ed58e60ec78a Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sun, 3 Feb 2019 11:02:28 +0000 Subject: [PATCH 26/83] - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- vagrant.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vagrant.spec b/vagrant.spec index 92fac8c..9f24bda 100644 --- a/vagrant.spec +++ b/vagrant.spec @@ -4,7 +4,7 @@ Name: vagrant Version: 2.1.5 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Build and distribute virtualized development environments License: MIT URL: http://vagrantup.com @@ -324,6 +324,9 @@ end %changelog +* Sun Feb 03 2019 Fedora Release Engineering +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + * Thu Oct 11 2018 Pavel Valena - 2.1.5-2 - Fix: two additional patches for change_host_name logic(rhbz#1624068) From 979a3eb5d423fe4ee6951130e951bbec08b70b15 Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Wed, 23 Jan 2019 16:07:39 +0000 Subject: [PATCH 27/83] Update to Vagrant 2.2.3 also enhance .spec file, namely: - use macros to edit gemspec instead of patching - update `vagrant-spec` commit - use with-cxxflags in %%vagrant_plugin_install macro --- macros.vagrant | 12 +- sources | 4 +- ....0.2-use-numerical-instead-localhost.patch | 32 - vagrant-2.1.5-fix-dependencies.patch | 65 -- ...2.1.6-update-restart-logic-in-redhat.patch | 598 ------------------ vagrant.spec | 90 ++- 6 files changed, 67 insertions(+), 734 deletions(-) delete mode 100644 vagrant-2.0.2-use-numerical-instead-localhost.patch delete mode 100644 vagrant-2.1.5-fix-dependencies.patch delete mode 100644 vagrant-2.1.6-update-restart-logic-in-redhat.patch diff --git a/macros.vagrant b/macros.vagrant index 9c6742f..4f2a138 100644 --- a/macros.vagrant +++ b/macros.vagrant @@ -18,13 +18,17 @@ %vagrant_plugin_conf_link %{vagrant_embedded_dir}/plugins.json %vagrant_plugin_conf %{vagrant_plugin_conf_dir}/plugins.json -# Install gem into appropriate directory. -# -n Overrides gem file name for installation. -# -d Set installation directory. +# %vagrant_plugin_install - Install vagrant_plugin into appropriate directory. +# +# Usage: %vagrant_plugin_install [options] +# +# -n Overrides gem file name for installation. +# -d Set installation directory. +# %vagrant_plugin_install(d:n:) \ mkdir -p %{-d*}%{!?-d:.%{vagrant_plugin_dir}} \ \ -CONFIGURE_ARGS="--with-cflags='%{optflags}' $CONFIGURE_ARGS" \\\ +CONFIGURE_ARGS="--with-cflags='%{optflags}' --with-cxxflags='%{optflags}' $CONFIGURE_ARGS" \\\ gem install \\\ -V \\\ --local \\\ diff --git a/sources b/sources index dfa246e..9324c4c 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (vagrant-2.1.5.tar.gz) = 544216eb25c06a1ebddbadcc9d2d6a6dd9932e33d2554e3d51dba0e24a339b9afe0b85d1322bdb67c5de3d070aa4c854f1ccc931b23ea80f0625eb4d1f120238 -SHA512 (vagrant-spec-94a9d31ba18b4130b14da12a2f7b4001c3d2ff12.tar.gz) = b95eefa52c21e1020f3f889fc5a72476a3ffb76f780b0254af85bbbc55465c05081f7c18303caa67843bc959326cbf253b57609faa8187fd89188a2488bfe922 +SHA512 (vagrant-2.2.3.tar.gz) = ff3d95968a51a37a397342c013ebcc3bbfe7ff5b76fb35fead92e9a3b770c85f2f4720514aa68878b0b6e4fbd92629832dc1ddf925691529adf0c84c8f44d84c +SHA512 (vagrant-spec-abfc34474d122235d56e4c6b6fb5d3e35bedfa90.tar.gz) = cbb60d661d34b37bc5d414da0b2a31f39e2910c11251e334da5efbd8f010b5bd428bc1ae476fcb9b42ec4e8f8c6265292ba3f8f543625178ecb85aad06e8856f diff --git a/vagrant-2.0.2-use-numerical-instead-localhost.patch b/vagrant-2.0.2-use-numerical-instead-localhost.patch deleted file mode 100644 index 7b7ab2b..0000000 --- a/vagrant-2.0.2-use-numerical-instead-localhost.patch +++ /dev/null @@ -1,32 +0,0 @@ -From a102bc064f2b0d97cc6e67bb4f5e4a1bd951e311 Mon Sep 17 00:00:00 2001 -From: Pavel Valena -Date: Wed, 31 Jan 2018 19:08:35 +0100 -Subject: [PATCH] Use 127.0.0.1 instead of localhost - -in test is_port_open_test.rb ---- - test/unit/vagrant/util/is_port_open_test.rb | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/test/unit/vagrant/util/is_port_open_test.rb b/test/unit/vagrant/util/is_port_open_test.rb -index 71ee1db3b7..ea70425755 100644 ---- a/test/unit/vagrant/util/is_port_open_test.rb -+++ b/test/unit/vagrant/util/is_port_open_test.rb -@@ -36,7 +36,7 @@ - end - - # Verify that we report the port is open -- expect(klass.is_port_open?("localhost", open_port)).to be -+ expect(klass.is_port_open?("127.0.0.1", open_port)).to be - - # Kill the thread - thr[:die] = true -@@ -47,7 +47,7 @@ - # This CAN fail, since port 52811 might actually be in use, but I'm - # not sure what to do except choose some random port and hope for the - # best, really. -- expect(klass.is_port_open?("localhost", closed_port)).not_to be -+ expect(klass.is_port_open?("127.0.0.1", closed_port)).not_to be - end - end - diff --git a/vagrant-2.1.5-fix-dependencies.patch b/vagrant-2.1.5-fix-dependencies.patch deleted file mode 100644 index abdf11c..0000000 --- a/vagrant-2.1.5-fix-dependencies.patch +++ /dev/null @@ -1,65 +0,0 @@ -From 7486aa2ce950f55a4be9049d514c412d7e45ddef Mon Sep 17 00:00:00 2001 -From: Pavel Valena -Date: Thu, 20 Jul 2017 15:01:06 +0200 -Subject: [PATCH] Fix dependencies for Vagrant 2.0.4. - ---- - vagrant.gemspec | 25 ++++++++++++++++------------- - 1 file changed, 14 insertions(+), 11 deletions(-) - -diff --git a/vagrant.gemspec b/vagrant.gemspec -index c92ca17..aeee52f 100644 ---- a/vagrant.gemspec -+++ b/vagrant.gemspec -@@ -12,35 +12,38 @@ Gem::Specification.new do |s| - s.summary = "Build and distribute virtualized development environments." - s.description = "Vagrant is a tool for building and distributing virtualized development environments." - -- s.required_ruby_version = "~> 2.2", "< 2.6" -+ s.required_ruby_version = "~> 2.2" - s.required_rubygems_version = ">= 1.3.6" - s.rubyforge_project = "vagrant" - -- s.add_dependency "childprocess", "~> 0.6.0" -+ s.add_dependency "childprocess", "~> 0.5.0" - s.add_dependency "erubis", "~> 2.7.0" -- s.add_dependency "i18n", ">= 0.6.0", "<= 0.8.0" -+ s.add_dependency "i18n", ">= 0.6.0" - s.add_dependency "listen", "~> 3.1.5" - s.add_dependency "hashicorp-checkpoint", "~> 0.1.5" - s.add_dependency "log4r", "~> 1.1.9", "< 1.1.11" - s.add_dependency "net-ssh", "~> 5.0.0" - s.add_dependency "net-sftp", "~> 2.1" -- s.add_dependency "net-scp", "~> 1.2.0" -- s.add_dependency "rb-kqueue", "~> 0.2.0" -+ s.add_dependency "net-scp", ">= 1.2.0" -+ # Remove Windows specific dependency. -+ # s.add_dependency "rb-kqueue", "~> 0.2.0" - s.add_dependency "rest-client", ">= 1.6.0", "< 3.0" -- s.add_dependency "wdm", "~> 0.1.0" -- s.add_dependency "winrm", "~> 2.1" -- s.add_dependency "winrm-fs", "~> 1.0" -- s.add_dependency "winrm-elevated", "~> 1.1" -+ # s.add_dependency "wdm", "~> 0.1.0" -+ # s.add_dependency "winrm", "~> 2.1" -+ # s.add_dependency "winrm-fs", "~> 1.0" -+ # s.add_dependency "winrm-elevated", "~> 1.1" - - # NOTE: The ruby_dep gem is an implicit dependency from the listen gem. Later versions - # of the ruby_dep gem impose an aggressive constraint on the required ruby version (>= 2.2.5). - # Explicit constraint is defined to provide required dependency to listen without imposing - # tighter restrictions on valid ruby versions -- s.add_dependency "ruby_dep", "<= 1.3.1" -+ # -+ # Do not impose any Ruby version restrictions on Fedora. -+ # s.add_dependency "ruby_dep", "<= 1.3.1" - - # Constraint rake to properly handle deprecated method usage - # from within rspec -- s.add_development_dependency "rake", "~> 12.0.0" -+ s.add_development_dependency "rake", "~> 12.2.0" - s.add_development_dependency "rspec", "~> 3.5.0" - s.add_development_dependency "rspec-its", "~> 1.2.0" - s.add_development_dependency "webmock", "~> 2.3.1" --- -2.13.6 diff --git a/vagrant-2.1.6-update-restart-logic-in-redhat.patch b/vagrant-2.1.6-update-restart-logic-in-redhat.patch deleted file mode 100644 index 1457a96..0000000 --- a/vagrant-2.1.6-update-restart-logic-in-redhat.patch +++ /dev/null @@ -1,598 +0,0 @@ -From 80006251f422a8d534ff9bafa0e0c45d9c98143c Mon Sep 17 00:00:00 2001 -From: Joe Doss -Date: Mon, 17 Sep 2018 13:30:55 -0500 -Subject: [PATCH 01/10] Add in logic to restart NetworkManager if it is - enabled. - ---- - plugins/guests/redhat/cap/change_host_name.rb | 8 +++++++- - 1 file changed, 7 insertions(+), 1 deletion(-) - -diff --git a/plugins/guests/redhat/cap/change_host_name.rb b/plugins/guests/redhat/cap/change_host_name.rb -index 55fcdc4b48..8f32650035 100644 ---- a/plugins/guests/redhat/cap/change_host_name.rb -+++ b/plugins/guests/redhat/cap/change_host_name.rb -@@ -29,7 +29,13 @@ def self.change_host_name(machine, name) - } - - # Restart network -- service network restart -+ if (test -f /etc/init.d/network && /etc/init.d/network status &> /dev/null ); then -+ service network restart -+ elif (test -f /usr/lib/systemd/system/NetworkManager.service && systemctl is-enabled NetworkManager.service &> /dev/null ); then -+ systemctl restart NetworkManager.service -+ else -+ printf "Could not restart the network to set the new hostname!\n" -+ fi - EOH - end - end - -From 94954739b53ee4c6741a35c366c2fe5c9853e0ed Mon Sep 17 00:00:00 2001 -From: Joe Doss -Date: Mon, 17 Sep 2018 14:30:57 -0500 -Subject: [PATCH 02/10] Simplified if statements. - ---- - plugins/guests/redhat/cap/change_host_name.rb | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/plugins/guests/redhat/cap/change_host_name.rb b/plugins/guests/redhat/cap/change_host_name.rb -index 8f32650035..e9c0b1d80e 100644 ---- a/plugins/guests/redhat/cap/change_host_name.rb -+++ b/plugins/guests/redhat/cap/change_host_name.rb -@@ -29,9 +29,9 @@ def self.change_host_name(machine, name) - } - - # Restart network -- if (test -f /etc/init.d/network && /etc/init.d/network status &> /dev/null ); then -+ if test -f /etc/init.d/network; then - service network restart -- elif (test -f /usr/lib/systemd/system/NetworkManager.service && systemctl is-enabled NetworkManager.service &> /dev/null ); then -+ elif systemctl -q is-enabled NetworkManager.service; then - systemctl restart NetworkManager.service - else - printf "Could not restart the network to set the new hostname!\n" - -From c14a4a09f723230682c5ef5f9dc53662e2968b92 Mon Sep 17 00:00:00 2001 -From: Joe Doss -Date: Mon, 17 Sep 2018 14:56:06 -0500 -Subject: [PATCH 03/10] Switch if statements, check for systemctl, and switch - to is-active. - ---- - plugins/guests/redhat/cap/change_host_name.rb | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/plugins/guests/redhat/cap/change_host_name.rb b/plugins/guests/redhat/cap/change_host_name.rb -index e9c0b1d80e..70bd496943 100644 ---- a/plugins/guests/redhat/cap/change_host_name.rb -+++ b/plugins/guests/redhat/cap/change_host_name.rb -@@ -29,10 +29,10 @@ def self.change_host_name(machine, name) - } - - # Restart network -- if test -f /etc/init.d/network; then -- service network restart -- elif systemctl -q is-enabled NetworkManager.service; then -+ if (test -f /usr/bin/systemctl && systemctl -q is-active NetworkManager.service); then - systemctl restart NetworkManager.service -+ elif test -f /etc/init.d/network; then -+ service network restart - else - printf "Could not restart the network to set the new hostname!\n" - fi - -From 19aa9578c797c99a8632955a703490d5e6b50a26 Mon Sep 17 00:00:00 2001 -From: Joe Doss -Date: Tue, 18 Sep 2018 13:15:26 -0500 -Subject: [PATCH 04/10] Exit 1 if we cannot set the hostname. - ---- - plugins/guests/redhat/cap/change_host_name.rb | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/plugins/guests/redhat/cap/change_host_name.rb b/plugins/guests/redhat/cap/change_host_name.rb -index 70bd496943..ae02460156 100644 ---- a/plugins/guests/redhat/cap/change_host_name.rb -+++ b/plugins/guests/redhat/cap/change_host_name.rb -@@ -35,6 +35,7 @@ def self.change_host_name(machine, name) - service network restart - else - printf "Could not restart the network to set the new hostname!\n" -+ exit 1 - fi - EOH - end - -From 86ab4533b180009ed476026374110fc0bd79f522 Mon Sep 17 00:00:00 2001 -From: Joe Doss -Date: Tue, 18 Sep 2018 13:16:12 -0500 -Subject: [PATCH 05/10] Fix the test to check for systemctl restart - NetworkManager.service too. - ---- - test/unit/plugins/guests/redhat/cap/change_host_name_test.rb | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/test/unit/plugins/guests/redhat/cap/change_host_name_test.rb b/test/unit/plugins/guests/redhat/cap/change_host_name_test.rb -index 7662935458..10f43a3593 100644 ---- a/test/unit/plugins/guests/redhat/cap/change_host_name_test.rb -+++ b/test/unit/plugins/guests/redhat/cap/change_host_name_test.rb -@@ -31,7 +31,7 @@ - expect(comm.received_commands[1]).to match(/\/etc\/sysconfig\/network-scripts\/ifcfg/) - expect(comm.received_commands[1]).to match(/hostnamectl set-hostname --static '#{name}'/) - expect(comm.received_commands[1]).to match(/hostnamectl set-hostname --transient '#{name}'/) -- expect(comm.received_commands[1]).to match(/service network restart/) -+ expect(comm.received_commands[1]).to match(/service network restart|systemctl restart NetworkManager.service/) - end - - it "does not change the hostname if already set" do - -From a12b09b098ea87eec815e166d0e1395f6f47f937 Mon Sep 17 00:00:00 2001 -From: shotop -Date: Thu, 20 Sep 2018 14:21:40 -0500 -Subject: [PATCH 06/10] add specs around network restart logic - ---- - .../redhat/cap/change_host_name_test.rb | 27 +++++++++++++++++++ - 1 file changed, 27 insertions(+) - -diff --git a/test/unit/plugins/guests/redhat/cap/change_host_name_test.rb b/test/unit/plugins/guests/redhat/cap/change_host_name_test.rb -index 10f43a3593..b85802e947 100644 ---- a/test/unit/plugins/guests/redhat/cap/change_host_name_test.rb -+++ b/test/unit/plugins/guests/redhat/cap/change_host_name_test.rb -@@ -39,5 +39,32 @@ - cap.change_host_name(machine, name) - expect(comm.received_commands.size).to eq(1) - end -+ -+ context "restarts the network" do -+ it "uses systemctl and NetworkManager.service" do -+ comm.stub_command("hostname -f | grep '^#{name}$'", exit_code: 1) -+ comm.stub_command("test -f /usr/bin/systemctl && systemctl -q is-active NetworkManager.service", exit_code: 0) -+ cap.change_host_name(machine, name) -+ expect(comm.received_commands[1]).to match(/systemctl restart NetworkManager.service/) -+ end -+ -+ it "uses the service command" do -+ comm.stub_command("hostname -f | grep '^#{name}$'", exit_code: 1) -+ comm.stub_command("test -f /usr/bin/systemctl && systemctl -q is-active NetworkManager.service", exit_code: 1) -+ comm.stub_command("test -f /etc/init.d/network", exit_code: 0) -+ cap.change_host_name(machine, name) -+ expect(comm.received_commands[1]).to match(/service network restart/) -+ end -+ end -+ -+ context "cannot restart the network" do -+ it "prints cannot restart message" do -+ comm.stub_command("hostname -f | grep '^#{name}$'", exit_code: 1) -+ comm.stub_command("test -f /usr/bin/systemctl && systemctl -q is-active NetworkManager.service", exit_code: 1) -+ comm.stub_command("test -f /etc/init.d/network", exit_code: 1) -+ cap.change_host_name(machine, name) -+ expect(comm.received_commands[1]).to match(/printf "Could not restart the network to set the new hostname!/) -+ end -+ end - end - end - -From fb5fc0e657a10ee1eaf046980827cc1802c4d0f9 Mon Sep 17 00:00:00 2001 -From: Chris Roberts -Date: Thu, 20 Sep 2018 16:42:39 -0700 -Subject: [PATCH 07/10] Update guest inspection utility module - -Use sudo option for communicator test command instead of inline sudo -to properly use configured sudo value. Use command for checking -availability of hostnamectl. Use is-active for determining if a -service is being actively managed by systemd. ---- - lib/vagrant/util/guest_inspection.rb | 21 +++++++++++++++++---- - 1 file changed, 17 insertions(+), 4 deletions(-) - -diff --git a/lib/vagrant/util/guest_inspection.rb b/lib/vagrant/util/guest_inspection.rb -index 86ab1dc69e..5a1902d8da 100644 ---- a/lib/vagrant/util/guest_inspection.rb -+++ b/lib/vagrant/util/guest_inspection.rb -@@ -12,27 +12,39 @@ module Linux - # - # @return [Boolean] - def systemd?(comm) -- comm.test("sudo ps -o comm= 1 | grep systemd") -+ comm.test("ps -o comm= 1 | grep systemd") - end - - # systemd-networkd.service is in use - # -+ # @param [Vagrant::Plugin::V2::Communicator] comm Guest communicator - # @return [Boolean] - def systemd_networkd?(comm) -- comm.test("sudo systemctl status systemd-networkd.service") -+ comm.test("systemctl -q is-active systemd-networkd.service", sudo: true) -+ end -+ -+ # Check if given service is controlled by systemd -+ # -+ # @param [Vagrant::Plugin::V2::Communicator] comm Guest communicator -+ # @param [String] service_name Name of the service to check -+ # @return [Boolean] -+ def systemd_controlled?(comm, service_name) -+ comm.test("systemctl -q is-active #{service_name}", sudo: true) - end - - # systemd hostname set is via hostnamectl - # -+ # @param [Vagrant::Plugin::V2::Communicator] comm Guest communicator - # @return [Boolean] - def hostnamectl?(comm) -- comm.test("hostnamectl") -+ comm.test("command -v hostnamectl") - end - - ## netplan helpers - - # netplan is installed - # -+ # @param [Vagrant::Plugin::V2::Communicator] comm Guest communicator - # @return [Boolean] - def netplan?(comm) - comm.test("netplan -h") -@@ -42,6 +54,7 @@ def netplan?(comm) - - # nmcli is installed - # -+ # @param [Vagrant::Plugin::V2::Communicator] comm Guest communicator - # @return [Boolean] - def nmcli?(comm) - comm.test("nmcli -t") -@@ -49,7 +62,7 @@ def nmcli?(comm) - - # NetworkManager currently controls device - # -- # @param comm [Communicator] -+ # @param [Vagrant::Plugin::V2::Communicator] comm Guest communicator - # @param device_name [String] - # @return [Boolean] - def nm_controlled?(comm, device_name) - -From ff021fcab404c95e52566bfca4207da9c0101e01 Mon Sep 17 00:00:00 2001 -From: Chris Roberts -Date: Thu, 20 Sep 2018 16:44:08 -0700 -Subject: [PATCH 08/10] Update redhat change host name capability to support - systemd - -Update capability to use guest inspection module for determining -correct actions to execute. When systemd is in use restart the -correct active service, either NetworkManager or networkd. Default -to using the original service restart when systemd service is not -found. ---- - plugins/guests/redhat/cap/change_host_name.rb | 41 ++++++++++--------- - 1 file changed, 21 insertions(+), 20 deletions(-) - -diff --git a/plugins/guests/redhat/cap/change_host_name.rb b/plugins/guests/redhat/cap/change_host_name.rb -index ae02460156..5da660df05 100644 ---- a/plugins/guests/redhat/cap/change_host_name.rb -+++ b/plugins/guests/redhat/cap/change_host_name.rb -@@ -2,6 +2,9 @@ module VagrantPlugins - module GuestRedHat - module Cap - class ChangeHostName -+ -+ extend Vagrant::Util::GuestInspection -+ - def self.change_host_name(machine, name) - comm = machine.communicate - -@@ -10,34 +13,32 @@ def self.change_host_name(machine, name) - comm.sudo <<-EOH.gsub(/^ {14}/, '') - # Update sysconfig - sed -i 's/\\(HOSTNAME=\\).*/\\1#{name}/' /etc/sysconfig/network -- - # Update DNS - sed -i 's/\\(DHCP_HOSTNAME=\\).*/\\1\"#{basename}\"/' /etc/sysconfig/network-scripts/ifcfg-* -- - # Set the hostname - use hostnamectl if available - echo '#{name}' > /etc/hostname -- if command -v hostnamectl; then -- hostnamectl set-hostname --static '#{name}' -- hostnamectl set-hostname --transient '#{name}' -- else -- hostname -F /etc/hostname -- fi -- -- # Prepend ourselves to /etc/hosts - grep -w '#{name}' /etc/hosts || { - sed -i'' '1i 127.0.0.1\\t#{name}\\t#{basename}' /etc/hosts - } -- -- # Restart network -- if (test -f /usr/bin/systemctl && systemctl -q is-active NetworkManager.service); then -- systemctl restart NetworkManager.service -- elif test -f /etc/init.d/network; then -- service network restart -- else -- printf "Could not restart the network to set the new hostname!\n" -- exit 1 -- fi - EOH -+ -+ if hostnamectl?(comm) -+ comm.sudo("hostnamectl set-hostname --static '#{name}' ; " \ -+ "hostnamectl set-hostname --transient '#{name}'") -+ else -+ comm.sudo("hostname -F /etc/hostname") -+ end -+ -+ restart_command = "service network restart" -+ -+ if systemd? -+ if systemd_networkd?(comm) -+ restart_command = "systemctl restart systemd-networkd.service" -+ elsif systemd_controlled?(comm, "NetworkManager.service") -+ restart_command = "systemctl restart NetworkManager.service" -+ end -+ end -+ comm.sudo(restart_command) - end - end - end - -From bc217d5e577457df5ac4ecdfffa17fd0a8c85b18 Mon Sep 17 00:00:00 2001 -From: Chris Roberts -Date: Thu, 20 Sep 2018 16:46:45 -0700 -Subject: [PATCH 09/10] Update redhat change host name capability tests for - systemd/NetworkManger updates - ---- - .../redhat/cap/change_host_name_test.rb | 95 +++++++++++++------ - 1 file changed, 68 insertions(+), 27 deletions(-) - -diff --git a/test/unit/plugins/guests/redhat/cap/change_host_name_test.rb b/test/unit/plugins/guests/redhat/cap/change_host_name_test.rb -index b85802e947..8d0c9ebd4b 100644 ---- a/test/unit/plugins/guests/redhat/cap/change_host_name_test.rb -+++ b/test/unit/plugins/guests/redhat/cap/change_host_name_test.rb -@@ -20,50 +20,91 @@ - - describe ".change_host_name" do - let(:cap) { caps.get(:change_host_name) } -- - let(:name) { "banana-rama.example.com" } -+ let(:hostname_changed) { true } -+ let(:systemd) { true } -+ let(:hostnamectl) { true } -+ let(:networkd) { true } -+ let(:network_manager) { false } - -- it "sets the hostname" do -- comm.stub_command("hostname -f | grep '^#{name}$'", exit_code: 1) -+ before do -+ comm.stub_command("hostname -f | grep '^#{name}$'", exit_code: hostname_changed ? 1 : 0) -+ allow(cap).to receive(:systemd?).and_return(systemd) -+ allow(cap).to receive(:hostnamectl?).and_return(hostnamectl) -+ allow(cap).to receive(:systemd_networkd?).and_return(networkd) -+ allow(cap).to receive(:systemd_controlled?).with(anything, /NetworkManager/).and_return(network_manager) -+ end - -+ it "sets the hostname" do - cap.change_host_name(machine, name) - expect(comm.received_commands[1]).to match(/\/etc\/sysconfig\/network/) - expect(comm.received_commands[1]).to match(/\/etc\/sysconfig\/network-scripts\/ifcfg/) -- expect(comm.received_commands[1]).to match(/hostnamectl set-hostname --static '#{name}'/) -- expect(comm.received_commands[1]).to match(/hostnamectl set-hostname --transient '#{name}'/) -- expect(comm.received_commands[1]).to match(/service network restart|systemctl restart NetworkManager.service/) - end - -- it "does not change the hostname if already set" do -- comm.stub_command("hostname -f | grep '^#{name}$'", exit_code: 0) -- cap.change_host_name(machine, name) -- expect(comm.received_commands.size).to eq(1) -- end -+ context "when hostnamectl is in use" do -+ let(:hostnamectl) { true } - -- context "restarts the network" do -- it "uses systemctl and NetworkManager.service" do -- comm.stub_command("hostname -f | grep '^#{name}$'", exit_code: 1) -- comm.stub_command("test -f /usr/bin/systemctl && systemctl -q is-active NetworkManager.service", exit_code: 0) -+ it "sets hostname with hostnamectl" do - cap.change_host_name(machine, name) -- expect(comm.received_commands[1]).to match(/systemctl restart NetworkManager.service/) -+ expect(comm.received_commands[2]).to match(/hostnamectl/) - end -+ end -+ -+ context "when hostnamectl is not in use" do -+ let(:hostnamectl) { false } - -- it "uses the service command" do -- comm.stub_command("hostname -f | grep '^#{name}$'", exit_code: 1) -- comm.stub_command("test -f /usr/bin/systemctl && systemctl -q is-active NetworkManager.service", exit_code: 1) -- comm.stub_command("test -f /etc/init.d/network", exit_code: 0) -+ it "sets hostname with hostname command" do - cap.change_host_name(machine, name) -- expect(comm.received_commands[1]).to match(/service network restart/) -+ expect(comm.received_commands[2]).to match(/hostname -F/) - end - end - -- context "cannot restart the network" do -- it "prints cannot restart message" do -- comm.stub_command("hostname -f | grep '^#{name}$'", exit_code: 1) -- comm.stub_command("test -f /usr/bin/systemctl && systemctl -q is-active NetworkManager.service", exit_code: 1) -- comm.stub_command("test -f /etc/init.d/network", exit_code: 1) -+ context "when host name is already set" do -+ let(:hostname_changed) { false } -+ -+ it "does not change the hostname" do - cap.change_host_name(machine, name) -- expect(comm.received_commands[1]).to match(/printf "Could not restart the network to set the new hostname!/) -+ expect(comm.received_commands.size).to eq(1) -+ end -+ end -+ -+ context "restarts the network" do -+ context "when networkd is in use" do -+ let(:networkd) { true } -+ -+ it "restarts networkd with systemctl" do -+ cap.change_host_name(machine, name) -+ expect(comm.received_commands[3]).to match(/systemctl restart systemd-networkd/) -+ end -+ end -+ -+ context "when NetworkManager is in use" do -+ let(:networkd) { false } -+ let(:network_manager) { true } -+ -+ it "restarts NetworkManager with systemctl" do -+ cap.change_host_name(machine, name) -+ expect(comm.received_commands[3]).to match(/systemctl restart NetworkManager/) -+ end -+ end -+ -+ context "when networkd and NetworkManager are not in use" do -+ let(:networkd) { false } -+ let(:network_manager) { false } -+ -+ it "restarts the network using service" do -+ cap.change_host_name(machine, name) -+ expect(comm.received_commands[3]).to match(/service network restart/) -+ end -+ end -+ -+ context "when systemd is not in use" do -+ let(:systemd) { false } -+ -+ it "restarts the network using service" do -+ cap.change_host_name(machine, name) -+ expect(comm.received_commands[3]).to match(/service network restart/) -+ end - end - end - end - -From 8fd05fe3c1b773777f08ca50dd651cbaf33838d3 Mon Sep 17 00:00:00 2001 -From: Chris Roberts -Date: Fri, 21 Sep 2018 09:19:40 -0700 -Subject: [PATCH 10/10] Use `command -v` for checks in all inspection helpers. - Fix stubs in tests. - ---- - lib/vagrant/util/guest_inspection.rb | 4 ++-- - .../guests/debian/cap/configure_networks_test.rb | 14 +++++++------- - 2 files changed, 9 insertions(+), 9 deletions(-) - -diff --git a/lib/vagrant/util/guest_inspection.rb b/lib/vagrant/util/guest_inspection.rb -index 5a1902d8da..cd0a96d3ef 100644 ---- a/lib/vagrant/util/guest_inspection.rb -+++ b/lib/vagrant/util/guest_inspection.rb -@@ -47,7 +47,7 @@ def hostnamectl?(comm) - # @param [Vagrant::Plugin::V2::Communicator] comm Guest communicator - # @return [Boolean] - def netplan?(comm) -- comm.test("netplan -h") -+ comm.test("command -v netplan") - end - - ## nmcli helpers -@@ -57,7 +57,7 @@ def netplan?(comm) - # @param [Vagrant::Plugin::V2::Communicator] comm Guest communicator - # @return [Boolean] - def nmcli?(comm) -- comm.test("nmcli -t") -+ comm.test("command -v nmcli") - end - - # NetworkManager currently controls device -diff --git a/test/unit/plugins/guests/debian/cap/configure_networks_test.rb b/test/unit/plugins/guests/debian/cap/configure_networks_test.rb -index b4691d0fd4..d3a523c95b 100644 ---- a/test/unit/plugins/guests/debian/cap/configure_networks_test.rb -+++ b/test/unit/plugins/guests/debian/cap/configure_networks_test.rb -@@ -67,9 +67,9 @@ - before do - allow(comm).to receive(:test).with("nmcli -t d show eth1").and_return(false) - allow(comm).to receive(:test).with("nmcli -t d show eth2").and_return(false) -- allow(comm).to receive(:test).with("sudo ps -o comm= 1 | grep systemd").and_return(false) -- allow(comm).to receive(:test).with("sudo systemctl status systemd-networkd.service").and_return(false) -- allow(comm).to receive(:test).with("netplan -h").and_return(false) -+ allow(comm).to receive(:test).with("ps -o comm= 1 | grep systemd").and_return(false) -+ allow(comm).to receive(:test).with("systemctl -q is-active systemd-networkd.service", anything).and_return(false) -+ allow(comm).to receive(:test).with("command -v netplan").and_return(false) - end - - it "creates and starts the networks using net-tools" do -@@ -85,8 +85,8 @@ - - context "with systemd" do - before do -- expect(comm).to receive(:test).with("sudo ps -o comm= 1 | grep systemd").and_return(true) -- allow(comm).to receive(:test).with("netplan -h").and_return(false) -+ expect(comm).to receive(:test).with("ps -o comm= 1 | grep systemd").and_return(true) -+ allow(comm).to receive(:test).with("command -v netplan").and_return(false) - end - - it "creates and starts the networks using net-tools" do -@@ -102,7 +102,7 @@ - - context "with systemd-networkd" do - before do -- expect(comm).to receive(:test).with("sudo systemctl status systemd-networkd.service").and_return(true) -+ expect(comm).to receive(:test).with("systemctl -q is-active systemd-networkd.service", anything).and_return(true) - end - - it "creates and starts the networks using systemd-networkd" do -@@ -117,7 +117,7 @@ - - context "with netplan" do - before do -- expect(comm).to receive(:test).with("netplan -h").and_return(true) -+ expect(comm).to receive(:test).with("command -v netplan").and_return(true) - end - - let(:nm_yml) { "---\nnetwork:\n version: 2\n renderer: NetworkManager\n ethernets:\n eth1:\n dhcp4: true\n eth2:\n addresses:\n - 33.33.33.10/16\n gateway4: 33.33.0.1\n" } - -From 1797798760eb72d6b02724f75bc54dd83815e986 Mon Sep 17 00:00:00 2001 -From: Chris Roberts -Date: Fri, 28 Sep 2018 07:59:39 -0700 -Subject: [PATCH] Fix module name - ---- - plugins/guests/redhat/cap/change_host_name.rb | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/plugins/guests/redhat/cap/change_host_name.rb b/plugins/guests/redhat/cap/change_host_name.rb -index 5da660df05..37c8912a80 100644 ---- a/plugins/guests/redhat/cap/change_host_name.rb -+++ b/plugins/guests/redhat/cap/change_host_name.rb -@@ -3,7 +3,7 @@ module GuestRedHat - module Cap - class ChangeHostName - -- extend Vagrant::Util::GuestInspection -+ extend Vagrant::Util::GuestInspection::Linux - - def self.change_host_name(machine, name) - comm = machine.communicate - -From 11b0d58fa081cd9a27c272244a0d119acc81f32e Mon Sep 17 00:00:00 2001 -From: Chris Roberts -Date: Mon, 1 Oct 2018 08:43:49 -0700 -Subject: [PATCH] Include communicator on call - ---- - plugins/guests/redhat/cap/change_host_name.rb | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/plugins/guests/redhat/cap/change_host_name.rb b/plugins/guests/redhat/cap/change_host_name.rb -index 37c8912a80..5ceb63665a 100644 ---- a/plugins/guests/redhat/cap/change_host_name.rb -+++ b/plugins/guests/redhat/cap/change_host_name.rb -@@ -31,7 +31,7 @@ def self.change_host_name(machine, name) - - restart_command = "service network restart" - -- if systemd? -+ if systemd?(comm) - if systemd_networkd?(comm) - restart_command = "systemctl restart systemd-networkd.service" - elsif systemd_controlled?(comm, "NetworkManager.service") diff --git a/vagrant.spec b/vagrant.spec index 9f24bda..0eef5fd 100644 --- a/vagrant.spec +++ b/vagrant.spec @@ -1,10 +1,10 @@ %global bashcompletion_dir %(pkg-config --variable=completionsdir bash-completion 2> /dev/null || :) -%global vagrant_spec_commit 94a9d31ba18b4130b14da12a2f7b4001c3d2ff12 +%global vagrant_spec_commit abfc34474d122235d56e4c6b6fb5d3e35bedfa90 Name: vagrant -Version: 2.1.5 -Release: 3%{?dist} +Version: 2.2.3 +Release: 1%{?dist} Summary: Build and distribute virtualized development environments License: MIT URL: http://vagrantup.com @@ -13,7 +13,7 @@ Source0: https://github.com/mitchellh/%{name}/archive/v%{version}/%{name}-%{vers Source1: binstub # The library has no official release yet. But since it is just test # dependency, it should be fine to include the source right here. -# wget https://github.com/mitchellh/vagrant-spec/archive/94a9d31ba18b4130b14da12a2f7b4001c3d2ff12/vagrant-spec-94a9d31ba18b4130b14da12a2f7b4001c3d2ff12.tar.gz +# wget https://github.com/mitchellh/vagrant-spec/archive/abfc34474d122235d56e4c6b6fb5d3e35bedfa90/vagrant-spec-abfc34474d122235d56e4c6b6fb5d3e35bedfa90.tar.gz Source2: https://github.com/mitchellh/%{name}-spec/archive/%{vagrant_spec_commit}/%{name}-spec-%{vagrant_spec_commit}.tar.gz # Monkey-patching needed for Vagrant to work until the respective patches # for RubyGems and Bundler are in place @@ -23,15 +23,6 @@ Source4: macros.vagrant # fails on older Fedoras. %{?load:%{SOURCE4}} -Patch0: vagrant-2.1.5-fix-dependencies.patch - -# Update restart logic in redhat change_host_name cap -# https://bugzilla.redhat.com/show_bug.cgi?id=1624068 -# https://github.com/hashicorp/vagrant/pull/10223 -# https://github.com/hashicorp/vagrant/commit/11b0d58fa081cd9a27c272244a0d119acc81f32e -# https://github.com/hashicorp/vagrant/commit/1797798760eb72d6b02724f75bc54dd83815e986 -Patch1: vagrant-2.1.6-update-restart-logic-in-redhat.patch - Requires: ruby(release) Requires: ruby(rubygems) >= 1.3.6 # Explicitly specify MRI, since Vagrant does not work with JRuby ATM. @@ -39,18 +30,21 @@ Requires: ruby Requires: rubygem(hashicorp-checkpoint) >= 0.1.5 Requires: rubygem(childprocess) >= 0.5.0 Requires: rubygem(erubis) >= 2.7.0 -Requires: rubygem(i18n) >= 0.6.0 +Requires: rubygem(i18n) >= 1.1.0 Requires: rubygem(json) Requires: rubygem(listen) >= 3.1.5 Requires: rubygem(log4r) >= 1.1.9 -Requires: rubygem(net-ssh) >= 4.2.0 +Requires: rubygem(net-ssh) >= 5.1.0 Requires: rubygem(net-scp) >= 1.2.0 Requires: rubygem(net-sftp) >= 2.1 Requires: rubygem(rest-client) >= 1.6.0 +Requires: rubygem(rubyzip) >= 1.1.7 Requires: bsdtar Requires: curl Recommends: vagrant(vagrant-libvirt) +Recommends: rubygem(bcrypt_pbkdf) +Recommends: rubygem(ed25519) Requires(pre): shadow-utils @@ -70,6 +64,7 @@ BuildRequires: rubygem(rspec) BuildRequires: rubygem(rspec-its) BuildRequires: rubygem(net-sftp) BuildRequires: rubygem(rest-client) +BuildRequires: rubygem(rubyzip) BuildRequires: rubygem(thor) BuildRequires: rubygem(webmock) BuildRequires: rubygem(fake_ftp) @@ -103,13 +98,42 @@ Documentation for %{name}. %prep %setup -q -b2 -%patch0 -p1 -%patch1 -p1 - %build -%gemspec_remove_dep -s %{name}.gemspec -g childprocess '~> 0.5.0' +# TODO: package vagrant_cloud, as it is not in Fedora yet +%gemspec_remove_dep -s %{name}.gemspec -g vagrant_cloud + +# Remove `cloud` command and references to it +%gemspec_remove_file -s %{name}.gemspec Dir.glob('plugins/commands/cloud/**/*.*') +rm -rf ./plugins/commands/cloud/ +sed -i '/^\s*I18n\..*$/ s/^/#/g' plugins/commands/login/plugin.rb +sed -i '/^\s*command(:login) do$/,/\s*end$/ s/^/#/g' plugins/commands/login/plugin.rb + +# We have newer versions in Fedora +%gemspec_remove_dep -s %{name}.gemspec -g childprocess '~> 0.6.0' %gemspec_add_dep -s %{name}.gemspec -g childprocess '>= 0.5.0' +# Remove Windows specific dependencies +%gemspec_remove_dep -s %{name}.gemspec -g wdm +%gemspec_remove_dep -s %{name}.gemspec -g winrm +%gemspec_remove_dep -s %{name}.gemspec -g winrm-fs +%gemspec_remove_dep -s %{name}.gemspec -g winrm-elevated + +# Remove BSD dependency +%gemspec_remove_dep -s %{name}.gemspec -g rb-kqueue + +# Do not impose any Ruby version restrictions on Fedora. +%gemspec_remove_dep -s %{name}.gemspec -g ruby_dep + +# Allow older rubyzip version +# TODO: remove +# https://src.fedoraproject.org/rpms/rubygem-rubyzip/pull-request/1 +%gemspec_remove_dep -s %{name}.gemspec -g rubyzip +%gemspec_add_dep -s %{name}.gemspec -g rubyzip + +# Remove optional dependencies +%gemspec_remove_dep -s %{name}.gemspec -g ed25519 +%gemspec_remove_dep -s %{name}.gemspec -g bcrypt_pbkdf + gem build %{name}.gemspec gem install -V --local \ @@ -156,17 +180,6 @@ install -d -m 755 %{buildroot}%{vagrant_plugin_conf_dir} touch %{buildroot}%{vagrant_plugin_conf} ln -s -t %{buildroot}%{vagrant_embedded_dir}/ %{vagrant_plugin_conf} -# !!! Backward compatibility hack, introduced in F26 timeframe !!! -# It allows to (un)register old Vagrant plugins via newer Vagrant. -# This should be possible to remove at F29, when there is chance everybody is -# using more recent versions of Vagrant. -install -d -m 755 %{buildroot}%{vagrant_embedded_dir}/lib/vagrant/plugin -cat > %{buildroot}%{vagrant_embedded_dir}/lib/vagrant/plugin/manager.rb << 'EOF' -$LOAD_PATH.shift -$LOAD_PATH.unshift '%{vagrant_dir}/lib' -require 'vagrant/plugin/manager' -EOF - # Turn `vagrant --help` into man page. export GEM_PATH="%{gem_dir}:%{buildroot}/usr/share/vagrant/gems" # Needed to display help page without a warning. @@ -205,6 +218,17 @@ sed -i '/^ context "with winrm communicator" do$/,/^ end$/ s/^/#/' \ # https://github.com/hashicorp/vagrant/issues/9273 mv test/unit/vagrant/util/env_test.rb{,.disable} +# vagrant_cloud is not in Fedora yet; login command is deprecated +# in favor of vagrant_cloud +rm -r test/unit/plugins/commands/{cloud,login}/ + +# Ruby 2.6.1 incompatibilities +# https://github.com/hashicorp/vagrant/issues/10646 +sed -i '/^\s*it "uploads the file" do$/ a skip' test/unit/plugins/pushes/ftp/adapter_test.rb +sed -i '/^\s*it "uploads in passive mode" do$/ a skip' test/unit/plugins/pushes/ftp/adapter_test.rb +sed -i '/^\s*it "pushes the files to the server" do$/ a skip' test/unit/plugins/pushes/ftp/push_test.rb +sed -i '/^\s*it "adds from FTP URL" do$/ a skip' test/unit/vagrant/action/builtin/box_add_test.rb + # Rake solves the requires issues for tests rake -f tasks/test.rake test:unit @@ -280,9 +304,6 @@ end %dir %{dirname:%{vagrant_plugin_instdir}} %dir %{dirname:%{vagrant_plugin_spec}} -# Kept for backward compatibility. -%{vagrant_embedded_dir}/lib - %{_bindir}/%{name} %dir %{vagrant_plugin_instdir} %license %{vagrant_plugin_instdir}/LICENSE @@ -324,6 +345,9 @@ end %changelog +* Thu Feb 14 2019 Pavel Valena - 2.2.3-1 +- Update to Vagrant 2.2.3. + * Sun Feb 03 2019 Fedora Release Engineering - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild From a2925fe2af69386d72554b412744f2ac1c49ee02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ondruch?= Date: Fri, 15 Feb 2019 17:22:16 +0100 Subject: [PATCH 28/83] Disable Vagrant's built-in version check. --- binstub | 3 +++ vagrant.spec | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/binstub b/binstub index cebe8fa..f9367e5 100644 --- a/binstub +++ b/binstub @@ -51,6 +51,9 @@ if [ -z ${VAGRANT_PREFERRED_PROVIDERS+empty} ]; then fi export VAGRANT_PREFERRED_PROVIDERS +# Disable Vagrant's built-in version check. +export VAGRANT_CHECKPOINT_DISABLE=yes + # Call the actual Vagrant bin with our arguments exec ruby "${VAGRANT_EXECUTABLE}" "$@" diff --git a/vagrant.spec b/vagrant.spec index 0eef5fd..5ac4b9e 100644 --- a/vagrant.spec +++ b/vagrant.spec @@ -4,7 +4,7 @@ Name: vagrant Version: 2.2.3 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Build and distribute virtualized development environments License: MIT URL: http://vagrantup.com @@ -345,6 +345,9 @@ end %changelog +* Fri Feb 15 2019 Vít Ondruch - 2.2.3-2 +- Disable Vagrant's built-in version check. + * Thu Feb 14 2019 Pavel Valena - 2.2.3-1 - Update to Vagrant 2.2.3. From 2270f4fe801c965da2be27910878e3f9af61ad9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ondruch?= Date: Fri, 15 Feb 2019 17:45:21 +0100 Subject: [PATCH 29/83] Be more precise about relaxing dependencies. This helps to ensure we are not doing unnecessary changes in future. --- vagrant.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vagrant.spec b/vagrant.spec index 5ac4b9e..6d90342 100644 --- a/vagrant.spec +++ b/vagrant.spec @@ -127,7 +127,7 @@ sed -i '/^\s*command(:login) do$/,/\s*end$/ s/^/#/g' plugins/commands/login/plug # Allow older rubyzip version # TODO: remove # https://src.fedoraproject.org/rpms/rubygem-rubyzip/pull-request/1 -%gemspec_remove_dep -s %{name}.gemspec -g rubyzip +%gemspec_remove_dep -s %{name}.gemspec -g rubyzip '~> 1.2.2' %gemspec_add_dep -s %{name}.gemspec -g rubyzip # Remove optional dependencies From 1252de5fb2c19839dcd9585110d17f9c7520034d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ondruch?= Date: Tue, 26 Feb 2019 13:15:15 +0100 Subject: [PATCH 30/83] Fix fake_ftp 0.3.x test suite compatibility. --- ...2.3-Fix-fake_ftp-0.3.x-compatibility.patch | 52 +++++++++++++++++++ vagrant.spec | 13 +++-- 2 files changed, 60 insertions(+), 5 deletions(-) create mode 100644 vagrant-2.2.3-Fix-fake_ftp-0.3.x-compatibility.patch diff --git a/vagrant-2.2.3-Fix-fake_ftp-0.3.x-compatibility.patch b/vagrant-2.2.3-Fix-fake_ftp-0.3.x-compatibility.patch new file mode 100644 index 0000000..3b4b484 --- /dev/null +++ b/vagrant-2.2.3-Fix-fake_ftp-0.3.x-compatibility.patch @@ -0,0 +1,52 @@ +From 60214f4f66ef4fb864aa535c6dccfe5a8b197de8 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?V=C3=ADt=20Ondruch?= +Date: Tue, 26 Feb 2019 12:17:44 +0100 +Subject: [PATCH] Fix fake_ftp 0.3.x compatibility. + +fake_ftp introduced support direcotry support, which changes the +behavior: + +https://github.com/livinginthepast/fake_ftp/pull/42 +--- + test/unit/plugins/pushes/ftp/adapter_test.rb | 4 ++-- + test/unit/plugins/pushes/ftp/push_test.rb | 2 +- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/test/unit/plugins/pushes/ftp/adapter_test.rb b/test/unit/plugins/pushes/ftp/adapter_test.rb +index 93888f840..a92cc7422 100644 +--- a/test/unit/plugins/pushes/ftp/adapter_test.rb ++++ b/test/unit/plugins/pushes/ftp/adapter_test.rb +@@ -77,7 +77,7 @@ describe VagrantPlugins::FTPPush::FTPAdapter do + ftp.upload("#{@dir}/file", "/file") + end + +- expect(server.files).to include("file") ++ expect(server.files).to include("/file") + end + + it "uploads in passive mode" do +@@ -86,7 +86,7 @@ describe VagrantPlugins::FTPPush::FTPAdapter do + ftp.upload("#{@dir}/file", "/file") + end + +- expect(server.file("file")).to be_passive ++ expect(server.file("/file")).to be_passive + end + end + end +diff --git a/test/unit/plugins/pushes/ftp/push_test.rb b/test/unit/plugins/pushes/ftp/push_test.rb +index 83509fb7d..49c08da6f 100644 +--- a/test/unit/plugins/pushes/ftp/push_test.rb ++++ b/test/unit/plugins/pushes/ftp/push_test.rb +@@ -71,7 +71,7 @@ describe VagrantPlugins::FTPPush::Push do + + it "pushes the files to the server" do + subject.push +- expect(server.files).to eq(%w(Gemfile data.txt)) ++ expect(server.files).to eq(%w(/var/www/site/Gemfile /var/www/site/data.txt)) + end + + it "raises informative exception when too many files to process" do +-- +2.20.1 + diff --git a/vagrant.spec b/vagrant.spec index 6d90342..41040d0 100644 --- a/vagrant.spec +++ b/vagrant.spec @@ -19,6 +19,10 @@ Source2: https://github.com/mitchellh/%{name}-spec/archive/%{vagrant_spec_commit # for RubyGems and Bundler are in place Source4: macros.vagrant +# Fix fake_ftp 0.3.x compatibility. +# https://github.com/hashicorp/vagrant/issues/10646 +Patch0: vagrant-2.2.3-Fix-fake_ftp-0.3.x-compatibility.patch + # The load directive is supported since RPM 4.12, i.e. F21+. The build process # fails on older Fedoras. %{?load:%{SOURCE4}} @@ -98,6 +102,8 @@ Documentation for %{name}. %prep %setup -q -b2 +%patch0 -p1 + %build # TODO: package vagrant_cloud, as it is not in Fedora yet %gemspec_remove_dep -s %{name}.gemspec -g vagrant_cloud @@ -222,11 +228,8 @@ mv test/unit/vagrant/util/env_test.rb{,.disable} # in favor of vagrant_cloud rm -r test/unit/plugins/commands/{cloud,login}/ -# Ruby 2.6.1 incompatibilities -# https://github.com/hashicorp/vagrant/issues/10646 -sed -i '/^\s*it "uploads the file" do$/ a skip' test/unit/plugins/pushes/ftp/adapter_test.rb -sed -i '/^\s*it "uploads in passive mode" do$/ a skip' test/unit/plugins/pushes/ftp/adapter_test.rb -sed -i '/^\s*it "pushes the files to the server" do$/ a skip' test/unit/plugins/pushes/ftp/push_test.rb +# fake_ftp 0.3.0 compatibility. +# https://github.com/livinginthepast/fake_ftp/pull/56 sed -i '/^\s*it "adds from FTP URL" do$/ a skip' test/unit/vagrant/action/builtin/box_add_test.rb # Rake solves the requires issues for tests From 0caa3d5743abd27082c502e5d6aa8bdcd8be62cc Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Fri, 1 Mar 2019 20:03:25 +0100 Subject: [PATCH 31/83] Update to Vagrant 2.2.4. --- sources | 2 +- vagrant.spec | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/sources b/sources index 9324c4c..d613d58 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (vagrant-2.2.3.tar.gz) = ff3d95968a51a37a397342c013ebcc3bbfe7ff5b76fb35fead92e9a3b770c85f2f4720514aa68878b0b6e4fbd92629832dc1ddf925691529adf0c84c8f44d84c +SHA512 (vagrant-2.2.4.tar.gz) = 9d1e9dd42a009d4df159ae3887f43a2664714077a91013a8b63dad72d25d4a236e1dba6daf66443101904f89a5cd37baff65be2714124f7b9f822f26669bcc5a SHA512 (vagrant-spec-abfc34474d122235d56e4c6b6fb5d3e35bedfa90.tar.gz) = cbb60d661d34b37bc5d414da0b2a31f39e2910c11251e334da5efbd8f010b5bd428bc1ae476fcb9b42ec4e8f8c6265292ba3f8f543625178ecb85aad06e8856f diff --git a/vagrant.spec b/vagrant.spec index 41040d0..39063fc 100644 --- a/vagrant.spec +++ b/vagrant.spec @@ -3,8 +3,8 @@ %global vagrant_spec_commit abfc34474d122235d56e4c6b6fb5d3e35bedfa90 Name: vagrant -Version: 2.2.3 -Release: 2%{?dist} +Version: 2.2.4 +Release: 1%{?dist} Summary: Build and distribute virtualized development environments License: MIT URL: http://vagrantup.com @@ -348,6 +348,9 @@ end %changelog +* Fri Mar 01 2019 Pavel Valena - 2.2.4-1 +- Update to Vagrant 2.2.4. + * Fri Feb 15 2019 Vít Ondruch - 2.2.3-2 - Disable Vagrant's built-in version check. From cfb118b6314459f48da0098bdca85aa0eb83976f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ondruch?= Date: Fri, 15 Mar 2019 19:12:02 +0100 Subject: [PATCH 32/83] Don't create `vagrant` group anymore. The group was intedned to alleviate number of password prompts, but it was never really used (rhbz#1187019). Now, vagrant-libvirt uses QEMU session by defualt, so it is definitely not needed. --- vagrant.spec | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vagrant.spec b/vagrant.spec index 39063fc..e04b6b0 100644 --- a/vagrant.spec +++ b/vagrant.spec @@ -4,7 +4,7 @@ Name: vagrant Version: 2.2.4 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Build and distribute virtualized development environments License: MIT URL: http://vagrantup.com @@ -236,9 +236,6 @@ sed -i '/^\s*it "adds from FTP URL" do$/ a skip' test/unit/vagrant/action/builti rake -f tasks/test.rake test:unit -%pre -getent group vagrant >/dev/null || groupadd -r vagrant - %post -p %{_bindir}/ruby begin $LOAD_PATH.unshift "%{vagrant_dir}/lib" @@ -348,6 +345,9 @@ end %changelog +* Fri Mar 15 2019 Vít Ondruch - 2.2.4-2 +- Don't create `vagrant` group anymore. + * Fri Mar 01 2019 Pavel Valena - 2.2.4-1 - Update to Vagrant 2.2.4. From abc1eca5db57bbadb1ae4dc630bec0bf241f8a66 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 27 Jul 2019 02:44:16 +0000 Subject: [PATCH 33/83] - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- vagrant.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vagrant.spec b/vagrant.spec index e04b6b0..c19d12b 100644 --- a/vagrant.spec +++ b/vagrant.spec @@ -4,7 +4,7 @@ Name: vagrant Version: 2.2.4 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Build and distribute virtualized development environments License: MIT URL: http://vagrantup.com @@ -345,6 +345,9 @@ end %changelog +* Sat Jul 27 2019 Fedora Release Engineering +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + * Fri Mar 15 2019 Vít Ondruch - 2.2.4-2 - Don't create `vagrant` group anymore. From a8e30ac27774f426c93fedc6a4639782ac389f80 Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Wed, 26 Jun 2019 12:11:29 +0200 Subject: [PATCH 34/83] Update to Vagrant 2.2.5. --- sources | 2 +- vagrant-2.2.5-do-not-load-dependencies.patch | 27 ++++++++++++++++++++ vagrant.spec | 15 +++++++++-- 3 files changed, 41 insertions(+), 3 deletions(-) create mode 100644 vagrant-2.2.5-do-not-load-dependencies.patch diff --git a/sources b/sources index d613d58..73a07f1 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (vagrant-2.2.4.tar.gz) = 9d1e9dd42a009d4df159ae3887f43a2664714077a91013a8b63dad72d25d4a236e1dba6daf66443101904f89a5cd37baff65be2714124f7b9f822f26669bcc5a +SHA512 (vagrant-2.2.5.tar.gz) = dc95e566588987b9199e66ee5f548be573bd62e229d2e4de5447f43f25a1a7129377935ec6dc73cc1f53acc29c08b0a4fabebf1a58310f175cc6d37b856c9272 SHA512 (vagrant-spec-abfc34474d122235d56e4c6b6fb5d3e35bedfa90.tar.gz) = cbb60d661d34b37bc5d414da0b2a31f39e2910c11251e334da5efbd8f010b5bd428bc1ae476fcb9b42ec4e8f8c6265292ba3f8f543625178ecb85aad06e8856f diff --git a/vagrant-2.2.5-do-not-load-dependencies.patch b/vagrant-2.2.5-do-not-load-dependencies.patch new file mode 100644 index 0000000..ea61dfd --- /dev/null +++ b/vagrant-2.2.5-do-not-load-dependencies.patch @@ -0,0 +1,27 @@ +From 38a48ea0dd01532b3ad17e9ed10c15598bc6ce32 Mon Sep 17 00:00:00 2001 +From: Pavel Valena +Date: Mon, 1 Jul 2019 17:44:54 +0200 +Subject: [PATCH] Do not list / load dependencies if `vagrant` spec is not + loaded + +in `vagrant_internal_specs` as this fails, due to `find` returning `nil`. +--- + lib/vagrant/bundler.rb | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/lib/vagrant/bundler.rb b/lib/vagrant/bundler.rb +index 7ba48435fa..c0fabdcead 100644 +--- a/lib/vagrant/bundler.rb ++++ b/lib/vagrant/bundler.rb +@@ -421,8 +421,9 @@ def generate_vagrant_set + def vagrant_internal_specs + # activate any dependencies up front so we can always + # pin them when resolving +- Gem::Specification.find { |s| s.name == "vagrant" && s.activated? }. +- runtime_dependencies.each { |d| gem d.name, *d.requirement.as_list } ++ if (vs = Gem::Specification.find { |s| s.name == "vagrant" && s.activated? }) ++ vs.runtime_dependencies.each { |d| gem d.name, *d.requirement.as_list } ++ end + # discover all the gems we have available + list = {} + directories = [Gem::Specification.default_specifications_dir] diff --git a/vagrant.spec b/vagrant.spec index c19d12b..9e093aa 100644 --- a/vagrant.spec +++ b/vagrant.spec @@ -3,8 +3,8 @@ %global vagrant_spec_commit abfc34474d122235d56e4c6b6fb5d3e35bedfa90 Name: vagrant -Version: 2.2.4 -Release: 3%{?dist} +Version: 2.2.5 +Release: 1%{?dist} Summary: Build and distribute virtualized development environments License: MIT URL: http://vagrantup.com @@ -22,6 +22,9 @@ Source4: macros.vagrant # Fix fake_ftp 0.3.x compatibility. # https://github.com/hashicorp/vagrant/issues/10646 Patch0: vagrant-2.2.3-Fix-fake_ftp-0.3.x-compatibility.patch +# Do not load runtime dependencies if vagrant is not loaded +# https://github.com/hashicorp/vagrant/pull/10945 +Patch1: vagrant-2.2.5-do-not-load-dependencies.patch # The load directive is supported since RPM 4.12, i.e. F21+. The build process # fails on older Fedoras. @@ -103,6 +106,7 @@ Documentation for %{name}. %setup -q -b2 %patch0 -p1 +%patch1 -p1 %build # TODO: package vagrant_cloud, as it is not in Fedora yet @@ -232,6 +236,10 @@ rm -r test/unit/plugins/commands/{cloud,login}/ # https://github.com/livinginthepast/fake_ftp/pull/56 sed -i '/^\s*it "adds from FTP URL" do$/ a skip' test/unit/vagrant/action/builtin/box_add_test.rb +# Disable test that requires network +sed -i '/^ it "generates a network name and configuration" do$/,/^ end/ s/^/#/' \ + test/unit/plugins/providers/docker/action/prepare_networks_test.rb + # Rake solves the requires issues for tests rake -f tasks/test.rake test:unit @@ -345,6 +353,9 @@ end %changelog +* Wed Aug 14 2019 Pavel Valena - 2.2.5-1 +- Update to Vagrant 2.2.5. + * Sat Jul 27 2019 Fedora Release Engineering - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild From 61dbe0929643263602b2b31bf35dab0f6184bf20 Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Tue, 13 Aug 2019 22:11:36 +0200 Subject: [PATCH 35/83] Add bcond_without for help2man. --- vagrant.spec | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/vagrant.spec b/vagrant.spec index 9e093aa..2e92750 100644 --- a/vagrant.spec +++ b/vagrant.spec @@ -2,6 +2,8 @@ %global vagrant_spec_commit abfc34474d122235d56e4c6b6fb5d3e35bedfa90 +%bcond_without help2man + Name: vagrant Version: 2.2.5 Release: 1%{?dist} @@ -76,7 +78,9 @@ BuildRequires: rubygem(thor) BuildRequires: rubygem(webmock) BuildRequires: rubygem(fake_ftp) BuildRequires: pkgconfig(bash-completion) +%if ! %{without help2man} BuildRequires: help2man +%endif BuildRequires: %{_bindir}/ssh BuildArch: noarch @@ -190,6 +194,7 @@ install -d -m 755 %{buildroot}%{vagrant_plugin_conf_dir} touch %{buildroot}%{vagrant_plugin_conf} ln -s -t %{buildroot}%{vagrant_embedded_dir}/ %{vagrant_plugin_conf} +%if ! %{without help2man} # Turn `vagrant --help` into man page. export GEM_PATH="%{gem_dir}:%{buildroot}/usr/share/vagrant/gems" # Needed to display help page without a warning. @@ -197,7 +202,7 @@ export VAGRANT_INSTALLER_ENV=1 mkdir -p %{buildroot}%{_mandir}/man1 help2man --no-discard-stderr -N -s1 -o %{buildroot}%{_mandir}/man1/%{name}.1 \ %{buildroot}/usr/share/%{name}/gems/gems/%{name}-%{version}/bin/%{name} - +%endif %check # Adjust the vagrant-spec directory name. @@ -349,8 +354,9 @@ end %{vagrant_plugin_instdir}/Rakefile %{vagrant_plugin_instdir}/tasks %{vagrant_plugin_instdir}/vagrant-spec.config.example.rb +%if ! %{without help2man} %{_mandir}/man1/%{name}.1* - +%endif %changelog * Wed Aug 14 2019 Pavel Valena - 2.2.5-1 From 0bf64cab560a75958fe8ed517ee98d755a857653 Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Fri, 23 Aug 2019 20:27:19 +0200 Subject: [PATCH 36/83] Move man pages to main package and also ehnance/simplify help2man bcond_with syntax. --- vagrant.spec | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/vagrant.spec b/vagrant.spec index 2e92750..f079e58 100644 --- a/vagrant.spec +++ b/vagrant.spec @@ -78,7 +78,7 @@ BuildRequires: rubygem(thor) BuildRequires: rubygem(webmock) BuildRequires: rubygem(fake_ftp) BuildRequires: pkgconfig(bash-completion) -%if ! %{without help2man} +%if %{with help2man} BuildRequires: help2man %endif BuildRequires: %{_bindir}/ssh @@ -194,7 +194,7 @@ install -d -m 755 %{buildroot}%{vagrant_plugin_conf_dir} touch %{buildroot}%{vagrant_plugin_conf} ln -s -t %{buildroot}%{vagrant_embedded_dir}/ %{vagrant_plugin_conf} -%if ! %{without help2man} +%if %{with help2man} # Turn `vagrant --help` into man page. export GEM_PATH="%{gem_dir}:%{buildroot}/usr/share/vagrant/gems" # Needed to display help page without a warning. @@ -346,6 +346,9 @@ end %dir %{bashcompletion_dir} %{bashcompletion_dir}/%{name} %{_rpmconfigdir}/macros.d/macros.%{name} +%if %{with help2man} +%{_mandir}/man1/%{name}.1* +%endif %files doc %doc %{vagrant_plugin_instdir}/RELEASE.md @@ -354,11 +357,10 @@ end %{vagrant_plugin_instdir}/Rakefile %{vagrant_plugin_instdir}/tasks %{vagrant_plugin_instdir}/vagrant-spec.config.example.rb -%if ! %{without help2man} -%{_mandir}/man1/%{name}.1* -%endif %changelog +- Move man pages to main package + * Wed Aug 14 2019 Pavel Valena - 2.2.5-1 - Update to Vagrant 2.2.5. From f868ebeebff2488496120c54fc451cbf4f41ba98 Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Fri, 23 Aug 2019 20:33:21 +0200 Subject: [PATCH 37/83] shadow-utils are no longer used in *pre* and thus not BRequired. --- vagrant.spec | 2 -- 1 file changed, 2 deletions(-) diff --git a/vagrant.spec b/vagrant.spec index f079e58..53d46c9 100644 --- a/vagrant.spec +++ b/vagrant.spec @@ -55,8 +55,6 @@ Recommends: vagrant(vagrant-libvirt) Recommends: rubygem(bcrypt_pbkdf) Recommends: rubygem(ed25519) -Requires(pre): shadow-utils - BuildRequires: bsdtar BuildRequires: ruby BuildRequires: rubygems-devel From 958f0e1daa1ce37cf5990ecd3d63c3b835365217 Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Tue, 15 Oct 2019 13:01:06 +0200 Subject: [PATCH 38/83] Upgrade to Vagrant 2.2.6 also fix i18n dependency to allow for v1.7.0. --- sources | 2 +- vagrant.spec | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/sources b/sources index 73a07f1..9bf74d3 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (vagrant-2.2.5.tar.gz) = dc95e566588987b9199e66ee5f548be573bd62e229d2e4de5447f43f25a1a7129377935ec6dc73cc1f53acc29c08b0a4fabebf1a58310f175cc6d37b856c9272 +SHA512 (vagrant-2.2.6.tar.gz) = 6d8b5b1d4e5cc482404cf4c59e1b7cf9502a9819569b5098e44874733cee706f26adb4ac7994abe7e3307ca69d3003e2604dc859ce460c53d766d78b8d9fe22a SHA512 (vagrant-spec-abfc34474d122235d56e4c6b6fb5d3e35bedfa90.tar.gz) = cbb60d661d34b37bc5d414da0b2a31f39e2910c11251e334da5efbd8f010b5bd428bc1ae476fcb9b42ec4e8f8c6265292ba3f8f543625178ecb85aad06e8856f diff --git a/vagrant.spec b/vagrant.spec index 53d46c9..1070a03 100644 --- a/vagrant.spec +++ b/vagrant.spec @@ -5,7 +5,7 @@ %bcond_without help2man Name: vagrant -Version: 2.2.5 +Version: 2.2.6 Release: 1%{?dist} Summary: Build and distribute virtualized development environments License: MIT @@ -39,7 +39,7 @@ Requires: ruby Requires: rubygem(hashicorp-checkpoint) >= 0.1.5 Requires: rubygem(childprocess) >= 0.5.0 Requires: rubygem(erubis) >= 2.7.0 -Requires: rubygem(i18n) >= 1.1.0 +Requires: (rubygem(i18n) >= 1.1.1 with rubygem(i18n) < 2.0) Requires: rubygem(json) Requires: rubygem(listen) >= 3.1.5 Requires: rubygem(log4r) >= 1.1.9 @@ -142,6 +142,11 @@ sed -i '/^\s*command(:login) do$/,/\s*end$/ s/^/#/g' plugins/commands/login/plug %gemspec_remove_dep -s %{name}.gemspec -g rubyzip '~> 1.2.2' %gemspec_add_dep -s %{name}.gemspec -g rubyzip +# Allow newer i18n version +# https://github.com/hashicorp/vagrant/pull/11146 +%gemspec_remove_dep -s %{name}.gemspec -g i18n '~> 1.1.1' +%gemspec_add_dep -s %{name}.gemspec -g i18n + # Remove optional dependencies %gemspec_remove_dep -s %{name}.gemspec -g ed25519 %gemspec_remove_dep -s %{name}.gemspec -g bcrypt_pbkdf @@ -243,6 +248,9 @@ sed -i '/^\s*it "adds from FTP URL" do$/ a skip' test/unit/vagrant/action/builti sed -i '/^ it "generates a network name and configuration" do$/,/^ end/ s/^/#/' \ test/unit/plugins/providers/docker/action/prepare_networks_test.rb +# Remove failing BSD-host tests, as we don't care about those. +rm -rf test/unit/plugins/hosts/bsd + # Rake solves the requires issues for tests rake -f tasks/test.rake test:unit @@ -357,6 +365,8 @@ end %{vagrant_plugin_instdir}/vagrant-spec.config.example.rb %changelog +* Tue Oct 15 2019 Pavel Valena - 2.2.6-1 +- Upgrade to Vagrant 2.2.6. - Move man pages to main package * Wed Aug 14 2019 Pavel Valena - 2.2.5-1 From 33a64aee0a529c1a1a2e00292a250697bc408532 Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Tue, 19 Nov 2019 18:04:49 +0100 Subject: [PATCH 39/83] Allow higher listen dependency to work with newer rubygem-listen. --- vagrant.spec | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/vagrant.spec b/vagrant.spec index 1070a03..ab1e0fb 100644 --- a/vagrant.spec +++ b/vagrant.spec @@ -6,7 +6,7 @@ Name: vagrant Version: 2.2.6 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Build and distribute virtualized development environments License: MIT URL: http://vagrantup.com @@ -41,7 +41,7 @@ Requires: rubygem(childprocess) >= 0.5.0 Requires: rubygem(erubis) >= 2.7.0 Requires: (rubygem(i18n) >= 1.1.1 with rubygem(i18n) < 2.0) Requires: rubygem(json) -Requires: rubygem(listen) >= 3.1.5 +Requires: (rubygem(listen) >= 3.2 with rubygem(listen) < 4) Requires: rubygem(log4r) >= 1.1.9 Requires: rubygem(net-ssh) >= 5.1.0 Requires: rubygem(net-scp) >= 1.2.0 @@ -147,6 +147,11 @@ sed -i '/^\s*command(:login) do$/,/\s*end$/ s/^/#/g' plugins/commands/login/plug %gemspec_remove_dep -s %{name}.gemspec -g i18n '~> 1.1.1' %gemspec_add_dep -s %{name}.gemspec -g i18n +# Allow newer listen version +# https://github.com/hashicorp/vagrant/pull/11208 +%gemspec_remove_dep -s %{name}.gemspec -g listen '~> 3.1.5' +%gemspec_add_dep -s %{name}.gemspec -g listen ['~> 3.2'] + # Remove optional dependencies %gemspec_remove_dep -s %{name}.gemspec -g ed25519 %gemspec_remove_dep -s %{name}.gemspec -g bcrypt_pbkdf From 5f8c0aa908d7ced0c3d30f927fc3f7bfd39a3f18 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 31 Jan 2020 02:52:50 +0000 Subject: [PATCH 40/83] - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- vagrant.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vagrant.spec b/vagrant.spec index ab1e0fb..88a22ec 100644 --- a/vagrant.spec +++ b/vagrant.spec @@ -6,7 +6,7 @@ Name: vagrant Version: 2.2.6 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Build and distribute virtualized development environments License: MIT URL: http://vagrantup.com @@ -370,6 +370,9 @@ end %{vagrant_plugin_instdir}/vagrant-spec.config.example.rb %changelog +* Fri Jan 31 2020 Fedora Release Engineering - 2.2.6-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + * Tue Oct 15 2019 Pavel Valena - 2.2.6-1 - Upgrade to Vagrant 2.2.6. - Move man pages to main package From b11cae0121e020c7579a40d089dd65f4eae01ae4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ondruch?= Date: Tue, 21 Apr 2020 14:23:05 +0200 Subject: [PATCH 41/83] Fix FTBFS due to Ruby 2.7. Resolves: rhbz#1800230 --- vagrant.spec | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/vagrant.spec b/vagrant.spec index 88a22ec..5e26e54 100644 --- a/vagrant.spec +++ b/vagrant.spec @@ -6,7 +6,7 @@ Name: vagrant Version: 2.2.6 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Build and distribute virtualized development environments License: MIT URL: http://vagrantup.com @@ -253,9 +253,35 @@ sed -i '/^\s*it "adds from FTP URL" do$/ a skip' test/unit/vagrant/action/builti sed -i '/^ it "generates a network name and configuration" do$/,/^ end/ s/^/#/' \ test/unit/plugins/providers/docker/action/prepare_networks_test.rb +# There are some Ruby 2.7 incompatibilities which might be fixed by: +# https://github.com/hashicorp/vagrant/pull/11459 +# but workarond the offending test case for now. +sed -i "/describe '#create' do/,/^ end$/ s/^/#/" \ + test/unit/plugins/providers/docker/driver_compose_test.rb +sed -i "/it 'removes the container' do/a\ skip 'Ruby 2.7 incompatibility'" \ + test/unit/plugins/providers/docker/driver_compose_test.rb + # Remove failing BSD-host tests, as we don't care about those. rm -rf test/unit/plugins/hosts/bsd +# Put gem load path on top of the load path, so they are loaded earlier then +# their StdLib symlinks. +%{!?buildtime_libdir:%global buildtime_libdir $(ruby -rrbconfig -e 'puts RbConfig::CONFIG["libdir"]')} + +RUBYOPT="-I" +for module in \ + openssl \ + psych +do + for dir in \ + %{gem_dir}/gems/$module-*/lib \ + %{buildtime_libdir}/gems/ruby/$module-* + do + RUBYOPT="$RUBYOPT:$dir" + done +done +export RUBYOPT + # Rake solves the requires issues for tests rake -f tasks/test.rake test:unit @@ -370,6 +396,10 @@ end %{vagrant_plugin_instdir}/vagrant-spec.config.example.rb %changelog +* Tue Apr 21 2020 Vít Ondruch - 2.2.6-4 +- Fix FTBFS due to Ruby 2.7. + Resolves: rhbz#1800230 + * Fri Jan 31 2020 Fedora Release Engineering - 2.2.6-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild From 7ab76a36b44bc888049fedd1a9c7143d8905ad37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ondruch?= Date: Tue, 21 Apr 2020 14:23:45 +0200 Subject: [PATCH 42/83] Relax rubygem-net-ssh dependency. Resolves: rhbz#1805240 --- vagrant.spec | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/vagrant.spec b/vagrant.spec index 5e26e54..f1f592a 100644 --- a/vagrant.spec +++ b/vagrant.spec @@ -123,6 +123,8 @@ sed -i '/^\s*command(:login) do$/,/\s*end$/ s/^/#/g' plugins/commands/login/plug # We have newer versions in Fedora %gemspec_remove_dep -s %{name}.gemspec -g childprocess '~> 0.6.0' %gemspec_add_dep -s %{name}.gemspec -g childprocess '>= 0.5.0' +%gemspec_remove_dep -s %{name}.gemspec -g net-ssh '~> 5.1.0' +%gemspec_add_dep -s %{name}.gemspec -g net-ssh '>= 5.2.0' # Remove Windows specific dependencies %gemspec_remove_dep -s %{name}.gemspec -g wdm @@ -397,6 +399,8 @@ end %changelog * Tue Apr 21 2020 Vít Ondruch - 2.2.6-4 +- Relax rubygem-net-ssh dependency. + Resolves: rhbz#1805240 - Fix FTBFS due to Ruby 2.7. Resolves: rhbz#1800230 From 5cd1a2c4b4e45ea45e2dc6102400fbf5f06a9f76 Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Thu, 7 May 2020 23:01:32 +0200 Subject: [PATCH 43/83] Fixup man page and add `--help` check. Resolves: rhbz#1801305 --- vagrant.spec | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/vagrant.spec b/vagrant.spec index f1f592a..c2522d5 100644 --- a/vagrant.spec +++ b/vagrant.spec @@ -210,7 +210,8 @@ export GEM_PATH="%{gem_dir}:%{buildroot}/usr/share/vagrant/gems" # Needed to display help page without a warning. export VAGRANT_INSTALLER_ENV=1 mkdir -p %{buildroot}%{_mandir}/man1 -help2man --no-discard-stderr -N -s1 -o %{buildroot}%{_mandir}/man1/%{name}.1 \ +help2man -N -s1 -o %{buildroot}%{_mandir}/man1/%{name}.1 \ + %{buildroot}/usr/share/%{name}/gems/gems/%{name}-%{version}/bin/%{name} || \ %{buildroot}/usr/share/%{name}/gems/gems/%{name}-%{version}/bin/%{name} %endif @@ -287,6 +288,13 @@ export RUBYOPT # Rake solves the requires issues for tests rake -f tasks/test.rake test:unit +%if %{with help2man} +# Check `--help` output, using which man page is created +export GEM_PATH="%{gem_dir}:%{buildroot}/usr/share/vagrant/gems" +export VAGRANT_INSTALLER_ENV=1 +%{buildroot}/usr/share/%{name}/gems/gems/%{name}-%{version}/bin/%{name} --help 2>/dev/null \ + | grep -q '^Usage: vagrant ' +%endif %post -p %{_bindir}/ruby begin From 7e8d943eaf4c639db144286b520e4f77d981a45e Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Fri, 7 Feb 2020 19:56:57 +0100 Subject: [PATCH 44/83] Update to Vagrant 2.2.9. Added support for podman via docker podman-docker wrapper (https://github.com/hashicorp/vagrant/pull/11356). --- sources | 2 +- vagrant-2.2.5-do-not-load-dependencies.patch | 27 -------- vagrant-2.2.9-do-not-load-dependencies.patch | 35 +++++++++++ vagrant.spec | 66 +++++++++++++------- 4 files changed, 79 insertions(+), 51 deletions(-) delete mode 100644 vagrant-2.2.5-do-not-load-dependencies.patch create mode 100644 vagrant-2.2.9-do-not-load-dependencies.patch diff --git a/sources b/sources index 9bf74d3..33458a6 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (vagrant-2.2.6.tar.gz) = 6d8b5b1d4e5cc482404cf4c59e1b7cf9502a9819569b5098e44874733cee706f26adb4ac7994abe7e3307ca69d3003e2604dc859ce460c53d766d78b8d9fe22a +SHA512 (vagrant-2.2.9.tar.gz) = 15e230bcf336615f0d49a2c40db36f7f26a9f0f6fd42d2ce801f28afc663aadded4fa373e33f9102b21ee70d98563fc68e2b24ffa6c3eec321f58b2c42b0d260 SHA512 (vagrant-spec-abfc34474d122235d56e4c6b6fb5d3e35bedfa90.tar.gz) = cbb60d661d34b37bc5d414da0b2a31f39e2910c11251e334da5efbd8f010b5bd428bc1ae476fcb9b42ec4e8f8c6265292ba3f8f543625178ecb85aad06e8856f diff --git a/vagrant-2.2.5-do-not-load-dependencies.patch b/vagrant-2.2.5-do-not-load-dependencies.patch deleted file mode 100644 index ea61dfd..0000000 --- a/vagrant-2.2.5-do-not-load-dependencies.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 38a48ea0dd01532b3ad17e9ed10c15598bc6ce32 Mon Sep 17 00:00:00 2001 -From: Pavel Valena -Date: Mon, 1 Jul 2019 17:44:54 +0200 -Subject: [PATCH] Do not list / load dependencies if `vagrant` spec is not - loaded - -in `vagrant_internal_specs` as this fails, due to `find` returning `nil`. ---- - lib/vagrant/bundler.rb | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) - -diff --git a/lib/vagrant/bundler.rb b/lib/vagrant/bundler.rb -index 7ba48435fa..c0fabdcead 100644 ---- a/lib/vagrant/bundler.rb -+++ b/lib/vagrant/bundler.rb -@@ -421,8 +421,9 @@ def generate_vagrant_set - def vagrant_internal_specs - # activate any dependencies up front so we can always - # pin them when resolving -- Gem::Specification.find { |s| s.name == "vagrant" && s.activated? }. -- runtime_dependencies.each { |d| gem d.name, *d.requirement.as_list } -+ if (vs = Gem::Specification.find { |s| s.name == "vagrant" && s.activated? }) -+ vs.runtime_dependencies.each { |d| gem d.name, *d.requirement.as_list } -+ end - # discover all the gems we have available - list = {} - directories = [Gem::Specification.default_specifications_dir] diff --git a/vagrant-2.2.9-do-not-load-dependencies.patch b/vagrant-2.2.9-do-not-load-dependencies.patch new file mode 100644 index 0000000..185d1a4 --- /dev/null +++ b/vagrant-2.2.9-do-not-load-dependencies.patch @@ -0,0 +1,35 @@ +From 068df794f81fb7ec410595d85ca9b4841a6034ec Mon Sep 17 00:00:00 2001 +From: Pavel Valena +Date: Thu, 7 May 2020 22:40:54 +0200 +Subject: [PATCH] Do not activate gems if gemspec is not found + +--- + lib/vagrant/bundler.rb | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/lib/vagrant/bundler.rb b/lib/vagrant/bundler.rb +index 92ee53a..cf92ff7 100644 +--- a/lib/vagrant/bundler.rb ++++ b/lib/vagrant/bundler.rb +@@ -622,14 +622,14 @@ module Vagrant + if !self_spec + @logger.warn("Failed to locate activated vagrant specification. Activating...") + self_spec = Gem::Specification.find { |s| s.name == "vagrant" } +- if !self_spec +- @logger.error("Failed to locate Vagrant RubyGem specification") +- raise Vagrant::Errors::SourceSpecNotFound +- end ++ if self_spec + self_spec.activate + @logger.info("Activated vagrant specification version - #{self_spec.version}") ++ end + end ++ if self_spec + self_spec.runtime_dependencies.each { |d| gem d.name, *d.requirement.as_list } ++ end + # discover all the gems we have available + list = {} + directories = [Gem::Specification.default_specifications_dir] +-- +2.25.0 + diff --git a/vagrant.spec b/vagrant.spec index c2522d5..1a34739 100644 --- a/vagrant.spec +++ b/vagrant.spec @@ -5,8 +5,8 @@ %bcond_without help2man Name: vagrant -Version: 2.2.6 -Release: 4%{?dist} +Version: 2.2.9 +Release: 1%{?dist} Summary: Build and distribute virtualized development environments License: MIT URL: http://vagrantup.com @@ -24,9 +24,9 @@ Source4: macros.vagrant # Fix fake_ftp 0.3.x compatibility. # https://github.com/hashicorp/vagrant/issues/10646 Patch0: vagrant-2.2.3-Fix-fake_ftp-0.3.x-compatibility.patch -# Do not load runtime dependencies if vagrant is not loaded +# Do not load runtime dependencies in %%check if vagrant is not loaded # https://github.com/hashicorp/vagrant/pull/10945 -Patch1: vagrant-2.2.5-do-not-load-dependencies.patch +Patch1: vagrant-2.2.9-do-not-load-dependencies.patch # The load directive is supported since RPM 4.12, i.e. F21+. The build process # fails on older Fedoras. @@ -39,11 +39,11 @@ Requires: ruby Requires: rubygem(hashicorp-checkpoint) >= 0.1.5 Requires: rubygem(childprocess) >= 0.5.0 Requires: rubygem(erubis) >= 2.7.0 -Requires: (rubygem(i18n) >= 1.1.1 with rubygem(i18n) < 2.0) +Requires: (rubygem(i18n) >= 1.8 with rubygem(i18n) < 2.0) Requires: rubygem(json) Requires: (rubygem(listen) >= 3.2 with rubygem(listen) < 4) Requires: rubygem(log4r) >= 1.1.9 -Requires: rubygem(net-ssh) >= 5.1.0 +Requires: rubygem(net-ssh) >= 5.2.0 Requires: rubygem(net-scp) >= 1.2.0 Requires: rubygem(net-sftp) >= 2.1 Requires: rubygem(rest-client) >= 1.6.0 @@ -54,6 +54,7 @@ Requires: curl Recommends: vagrant(vagrant-libvirt) Recommends: rubygem(bcrypt_pbkdf) Recommends: rubygem(ed25519) +Recommends: (podman-docker if podman) BuildRequires: bsdtar BuildRequires: ruby @@ -108,7 +109,6 @@ Documentation for %{name}. %setup -q -b2 %patch0 -p1 -%patch1 -p1 %build # TODO: package vagrant_cloud, as it is not in Fedora yet @@ -121,10 +121,8 @@ sed -i '/^\s*I18n\..*$/ s/^/#/g' plugins/commands/login/plugin.rb sed -i '/^\s*command(:login) do$/,/\s*end$/ s/^/#/g' plugins/commands/login/plugin.rb # We have newer versions in Fedora -%gemspec_remove_dep -s %{name}.gemspec -g childprocess '~> 0.6.0' -%gemspec_add_dep -s %{name}.gemspec -g childprocess '>= 0.5.0' -%gemspec_remove_dep -s %{name}.gemspec -g net-ssh '~> 5.1.0' -%gemspec_add_dep -s %{name}.gemspec -g net-ssh '>= 5.2.0' +%gemspec_remove_dep -s %{name}.gemspec -g net-scp '~> 1.2.0' +%gemspec_add_dep -s %{name}.gemspec -g net-scp '>= 1.2.0' # Remove Windows specific dependencies %gemspec_remove_dep -s %{name}.gemspec -g wdm @@ -138,26 +136,24 @@ sed -i '/^\s*command(:login) do$/,/\s*end$/ s/^/#/g' plugins/commands/login/plug # Do not impose any Ruby version restrictions on Fedora. %gemspec_remove_dep -s %{name}.gemspec -g ruby_dep -# Allow older rubyzip version -# TODO: remove -# https://src.fedoraproject.org/rpms/rubygem-rubyzip/pull-request/1 -%gemspec_remove_dep -s %{name}.gemspec -g rubyzip '~> 1.2.2' -%gemspec_add_dep -s %{name}.gemspec -g rubyzip - -# Allow newer i18n version -# https://github.com/hashicorp/vagrant/pull/11146 -%gemspec_remove_dep -s %{name}.gemspec -g i18n '~> 1.1.1' -%gemspec_add_dep -s %{name}.gemspec -g i18n - # Allow newer listen version # https://github.com/hashicorp/vagrant/pull/11208 %gemspec_remove_dep -s %{name}.gemspec -g listen '~> 3.1.5' -%gemspec_add_dep -s %{name}.gemspec -g listen ['~> 3.2'] +%gemspec_add_dep -s %{name}.gemspec -g listen '>= 3.1.5' + +# Allow older childprocess version +%gemspec_remove_dep -s %{name}.gemspec -g childprocess +%gemspec_add_dep -s %{name}.gemspec -g childprocess '>= 1.0.1' # Remove optional dependencies %gemspec_remove_dep -s %{name}.gemspec -g ed25519 %gemspec_remove_dep -s %{name}.gemspec -g bcrypt_pbkdf +# Load missing dependency Vagrant::Util::MapCommandOptions +# https://github.com/hashicorp/vagrant/pull/11609 +sed -i "/^ require 'vagrant\/util\/experimental'$/ a\ require 'vagrant/util/map_command_options'" \ + bin/vagrant + gem build %{name}.gemspec gem install -V --local \ @@ -216,6 +212,14 @@ help2man -N -s1 -o %{buildroot}%{_mandir}/man1/%{name}.1 \ %endif %check +# Do not load dependencies from gemspec +cat %{PATCH1} | patch -p1 + +sed -i '/^\s*context "when vagrant specification is not found" do$/,/^ end$/ s/^/#/' \ + test/unit/vagrant/bundler_test.rb +sed -i '/^\s*it "should init the bundler instance with plugins" do$/,/^ end$/ s/^/#/' \ + test/unit/vagrant/plugin/manager_test.rb + # Adjust the vagrant-spec directory name. rm -rf ../vagrant-spec mv ../vagrant-spec{-%{vagrant_spec_commit},} @@ -267,6 +271,16 @@ sed -i "/it 'removes the container' do/a\ skip 'Ruby 2.7 incompatibility' # Remove failing BSD-host tests, as we don't care about those. rm -rf test/unit/plugins/hosts/bsd +# Disable broken test for installing docker on host +# https://github.com/hashicorp/vagrant/issues/11606 +sed -i '/^\s*it "installs docker if not present" do$/ a\ skip "GH#11606"' \ + test/unit/plugins/provisioners/docker/installer_test.rb + +# Export the OS as an environment variable that Vagrant can access, so the +# test suite is executed with same host it will be run (also avoids docker +# installer_test issue). +export VAGRANT_DETECTED_OS="$(uname -s 2>/dev/null)" + # Put gem load path on top of the load path, so they are loaded earlier then # their StdLib symlinks. %{!?buildtime_libdir:%global buildtime_libdir $(ruby -rrbconfig -e 'puts RbConfig::CONFIG["libdir"]')} @@ -406,6 +420,12 @@ end %{vagrant_plugin_instdir}/vagrant-spec.config.example.rb %changelog +* Mon May 11 2020 Pavel Valena - 2.2.9-1 +- Update to Vagrant 2.2.9. + Resolves: rhbz#1795460 +- Added support for podman via docker podman-docker wrapper + (https://github.com/hashicorp/vagrant/pull/11356). + * Tue Apr 21 2020 Vít Ondruch - 2.2.6-4 - Relax rubygem-net-ssh dependency. Resolves: rhbz#1805240 From 02af3e5cd7a2e88f07866d2a30490f30272f0175 Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Wed, 20 May 2020 15:26:26 +0200 Subject: [PATCH 45/83] Move dependency load map_command_options for creating @box_extra_download_options to config/vm.rb. This is needed to be able to run vagrant-libvirt test suite, f.e.. It resolves usecase when `bin/vagrant` executable is not used directly. https://github.com/hashicorp/vagrant/pull/11609 --- vagrant.spec | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/vagrant.spec b/vagrant.spec index 1a34739..5ade93c 100644 --- a/vagrant.spec +++ b/vagrant.spec @@ -6,7 +6,7 @@ Name: vagrant Version: 2.2.9 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Build and distribute virtualized development environments License: MIT URL: http://vagrantup.com @@ -151,8 +151,8 @@ sed -i '/^\s*command(:login) do$/,/\s*end$/ s/^/#/g' plugins/commands/login/plug # Load missing dependency Vagrant::Util::MapCommandOptions # https://github.com/hashicorp/vagrant/pull/11609 -sed -i "/^ require 'vagrant\/util\/experimental'$/ a\ require 'vagrant/util/map_command_options'" \ - bin/vagrant +sed -i '/^\s*require..vagrant.util.experimental.\s*$/ a\require "vagrant/util/map_command_options"' \ + plugins/kernel_v2/config/vm.rb gem build %{name}.gemspec @@ -420,6 +420,11 @@ end %{vagrant_plugin_instdir}/vagrant-spec.config.example.rb %changelog +* Wed May 20 2020 Pavel Valena - 2.2.9-2 +- Move dependency load map_command_options + for creating @box_extra_download_options to config/vm.rb. + https://github.com/hashicorp/vagrant/pull/11609 + * Mon May 11 2020 Pavel Valena - 2.2.9-1 - Update to Vagrant 2.2.9. Resolves: rhbz#1795460 From 76a5264efcd46299e2aae2bd39912799206b2887 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 29 Jul 2020 13:30:37 +0000 Subject: [PATCH 46/83] - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- vagrant.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vagrant.spec b/vagrant.spec index 5ade93c..ff118d5 100644 --- a/vagrant.spec +++ b/vagrant.spec @@ -6,7 +6,7 @@ Name: vagrant Version: 2.2.9 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Build and distribute virtualized development environments License: MIT URL: http://vagrantup.com @@ -420,6 +420,9 @@ end %{vagrant_plugin_instdir}/vagrant-spec.config.example.rb %changelog +* Wed Jul 29 2020 Fedora Release Engineering - 2.2.9-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + * Wed May 20 2020 Pavel Valena - 2.2.9-2 - Move dependency load map_command_options for creating @box_extra_download_options to config/vm.rb. From 64073e0d9e7d4e71ce48d4a834cae694e75d5dc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ondruch?= Date: Wed, 19 Aug 2020 12:57:06 +0200 Subject: [PATCH 47/83] Use Erubi instead of Erubis. --- ...Replace-unmaintained-Erubis-by-Erubi.patch | 56 +++++++++++++++++++ vagrant.spec | 13 ++++- 2 files changed, 66 insertions(+), 3 deletions(-) create mode 100644 vagrant-2.2.9-Replace-unmaintained-Erubis-by-Erubi.patch diff --git a/vagrant-2.2.9-Replace-unmaintained-Erubis-by-Erubi.patch b/vagrant-2.2.9-Replace-unmaintained-Erubis-by-Erubi.patch new file mode 100644 index 0000000..2303ec9 --- /dev/null +++ b/vagrant-2.2.9-Replace-unmaintained-Erubis-by-Erubi.patch @@ -0,0 +1,56 @@ +From 09f75eb834bfefa6643a676249b48161bbcf0cad Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?V=C3=ADt=20Ondruch?= +Date: Mon, 17 Aug 2020 14:47:19 +0200 +Subject: [PATCH] Replace unmaintained Erubis by Erubi. +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Erubis is not maintained since 2011 and it has some unfixed security +issues. Erubi is used by Ruby on Rails, so it should be much better +choice. + +Signed-off-by: Vít Ondruch +--- + lib/vagrant/util/template_renderer.rb | 4 ++-- + vagrant.gemspec | 2 +- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/lib/vagrant/util/template_renderer.rb b/lib/vagrant/util/template_renderer.rb +index 8b8e730ba..eec0b2362 100644 +--- a/lib/vagrant/util/template_renderer.rb ++++ b/lib/vagrant/util/template_renderer.rb +@@ -1,7 +1,7 @@ + require 'ostruct' + require "pathname" + +-require 'erubis' ++require 'erubi' + + module Vagrant + module Util +@@ -73,7 +73,7 @@ module Vagrant + # + # @return [String] + def render_string +- Erubis::Eruby.new(template, trim: true).result(binding) ++ eval(Erubi::Engine.new(template).src) + end + + # Returns the full path to the template, taking into account the gem directory +diff --git a/vagrant.gemspec b/vagrant.gemspec +index 465b12805..6f2b726fa 100644 +--- a/vagrant.gemspec ++++ b/vagrant.gemspec +@@ -18,7 +18,7 @@ Gem::Specification.new do |s| + s.add_dependency "bcrypt_pbkdf", "~> 1.0.0" + s.add_dependency "childprocess", "~> 3.0.0" + s.add_dependency "ed25519", "~> 1.2.4" +- s.add_dependency "erubis", "~> 2.7.0" ++ s.add_dependency "erubi" + s.add_dependency "i18n", "~> 1.8" + s.add_dependency "listen", "~> 3.1.5" + s.add_dependency "hashicorp-checkpoint", "~> 0.1.5" +-- +2.27.0 + diff --git a/vagrant.spec b/vagrant.spec index ff118d5..b7e0650 100644 --- a/vagrant.spec +++ b/vagrant.spec @@ -6,7 +6,7 @@ Name: vagrant Version: 2.2.9 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Build and distribute virtualized development environments License: MIT URL: http://vagrantup.com @@ -27,6 +27,9 @@ Patch0: vagrant-2.2.3-Fix-fake_ftp-0.3.x-compatibility.patch # Do not load runtime dependencies in %%check if vagrant is not loaded # https://github.com/hashicorp/vagrant/pull/10945 Patch1: vagrant-2.2.9-do-not-load-dependencies.patch +# Use Erubi instead of Erubis. +# https://github.com/hashicorp/vagrant/pull/11829 +Patch2: vagrant-2.2.9-Replace-unmaintained-Erubis-by-Erubi.patch # The load directive is supported since RPM 4.12, i.e. F21+. The build process # fails on older Fedoras. @@ -38,7 +41,7 @@ Requires: ruby(rubygems) >= 1.3.6 Requires: ruby Requires: rubygem(hashicorp-checkpoint) >= 0.1.5 Requires: rubygem(childprocess) >= 0.5.0 -Requires: rubygem(erubis) >= 2.7.0 +Requires: rubygem(erubi) Requires: (rubygem(i18n) >= 1.8 with rubygem(i18n) < 2.0) Requires: rubygem(json) Requires: (rubygem(listen) >= 3.2 with rubygem(listen) < 4) @@ -67,7 +70,7 @@ BuildRequires: rubygem(net-ssh) BuildRequires: rubygem(net-scp) BuildRequires: rubygem(i18n) BuildRequires: rubygem(json) -BuildRequires: rubygem(erubis) +BuildRequires: rubygem(erubi) BuildRequires: rubygem(rspec) BuildRequires: rubygem(rspec-its) BuildRequires: rubygem(net-sftp) @@ -109,6 +112,7 @@ Documentation for %{name}. %setup -q -b2 %patch0 -p1 +%patch2 -p1 %build # TODO: package vagrant_cloud, as it is not in Fedora yet @@ -420,6 +424,9 @@ end %{vagrant_plugin_instdir}/vagrant-spec.config.example.rb %changelog +* Mon Aug 17 2020 Vít Ondruch - 2.2.9-4 +- Use Erubi instead of Erubis. + * Wed Jul 29 2020 Fedora Release Engineering - 2.2.9-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild From fd25a5591339d0a9b2cde882d7b96d045de885cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ondruch?= Date: Wed, 20 Jan 2021 19:00:08 +0100 Subject: [PATCH 48/83] Fix Ruby 3.0 and rspec-mock 3.10.1 compatibility. --- ...s-all-Ruby-deprecations-and-warnings.patch | 1384 +++++++++++++++++ ...2.9-Use-test-doubles-instead-of-true.patch | 94 ++ vagrant.spec | 14 +- 3 files changed, 1491 insertions(+), 1 deletion(-) create mode 100644 vagrant-2.2.10-Updates-to-address-all-Ruby-deprecations-and-warnings.patch create mode 100644 vagrant-2.2.9-Use-test-doubles-instead-of-true.patch diff --git a/vagrant-2.2.10-Updates-to-address-all-Ruby-deprecations-and-warnings.patch b/vagrant-2.2.10-Updates-to-address-all-Ruby-deprecations-and-warnings.patch new file mode 100644 index 0000000..c65382f --- /dev/null +++ b/vagrant-2.2.10-Updates-to-address-all-Ruby-deprecations-and-warnings.patch @@ -0,0 +1,1384 @@ +From 5003bb6e150dd7f812969acfd45aac3b92ce5cae Mon Sep 17 00:00:00 2001 +From: Chris Roberts +Date: Mon, 10 Aug 2020 11:11:30 -0700 +Subject: [PATCH 1/3] Updates to address all Ruby deprecations and warnings + +This includes updates for resolving all warnings provided by Ruby +for deprecations and/or removed methods. It also enables support +for Ruby 2.7 in the specification constraint as all 2.7 related +warnings are resolved with this changeset. +--- + lib/vagrant/action/builder.rb | 62 ++++++++--- + lib/vagrant/action/builtin/box_add.rb | 11 +- + .../action/builtin/mixin_synced_folders.rb | 2 +- + lib/vagrant/action/hook.rb | 83 +++++++++----- + lib/vagrant/action/warden.rb | 30 +++++- + lib/vagrant/box.rb | 9 +- + lib/vagrant/bundler.rb | 7 +- + lib/vagrant/errors.rb | 2 +- + lib/vagrant/machine_index.rb | 2 +- + lib/vagrant/ui.rb | 2 +- + lib/vagrant/util/downloader.rb | 5 +- + plugins/communicators/winssh/communicator.rb | 2 +- + plugins/kernel_v2/config/vm.rb | 2 +- + .../plugins/commands/box/command/add_test.rb | 4 +- + .../commands/box/command/outdated_test.rb | 2 +- + .../communicators/ssh/communicator_test.rb | 2 +- + .../windows/cap/change_host_name_test.rb | 4 +- + .../providers/docker/driver_compose_test.rb | 4 +- + .../virtualbox/action/network_test.rb | 14 +-- + .../chef/config/chef_apply_test.rb | 2 +- + test/unit/vagrant/action/builder_test.rb | 26 ++--- + .../vagrant/action/builtin/box_add_test.rb | 46 ++++---- + test/unit/vagrant/action/hook_test.rb | 102 ++++++++++++------ + test/unit/vagrant/plugin/manager_test.rb | 4 +- + test/unit/vagrant/ui_test.rb | 14 +-- + vagrant.gemspec | 2 +- + 26 files changed, 286 insertions(+), 159 deletions(-) + +diff --git a/lib/vagrant/action/builder.rb b/lib/vagrant/action/builder.rb +index 074d512b12..7e25d185b8 100644 +--- a/lib/vagrant/action/builder.rb ++++ b/lib/vagrant/action/builder.rb +@@ -17,6 +17,11 @@ module Action + # Vagrant::Action.run(app) + # + class Builder ++ # Container for Action arguments ++ MiddlewareArguments = Struct.new(:parameters, :block, :keywords, keyword_init: true) ++ # Item within the stack ++ StackItem = Struct.new(:middleware, :arguments, keyword_init: true) ++ + # This is the stack of middlewares added. This should NOT be used + # directly. + # +@@ -28,8 +33,8 @@ class Builder + # see {#use} instead. + # + # @return [Builder] +- def self.build(middleware, *args, &block) +- new.use(middleware, *args, &block) ++ def self.build(middleware, *args, **keywords, &block) ++ new.use(middleware, *args, **keywords, &block) + end + + def initialize +@@ -58,12 +63,21 @@ def flatten + # of the middleware. + # + # @param [Class] middleware The middleware class +- def use(middleware, *args, &block) ++ def use(middleware, *args, **keywords, &block) ++ item = StackItem.new( ++ middleware: middleware, ++ arguments: MiddlewareArguments.new( ++ parameters: args, ++ keywords: keywords, ++ block: block ++ ) ++ ) ++ + if middleware.kind_of?(Builder) + # Merge in the other builder's stack into our own + self.stack.concat(middleware.stack) + else +- self.stack << [middleware, args, block] ++ self.stack << item + end + + self +@@ -71,8 +85,22 @@ def use(middleware, *args, &block) + + # Inserts a middleware at the given index or directly before the + # given middleware object. +- def insert(index, middleware, *args, &block) +- index = self.index(index) unless index.is_a?(Integer) ++ def insert(idx_or_item, middleware, *args, **keywords, &block) ++ item = StackItem.new( ++ middleware: middleware, ++ arguments: MiddlewareArguments.new( ++ parameters: args, ++ keywords: keywords, ++ block: block ++ ) ++ ) ++ ++ if idx_or_item.is_a?(Integer) ++ index = idx_or_item ++ else ++ index = self.index(idx_or_item) ++ end ++ + raise "no such middleware to insert before: #{index.inspect}" unless index + + if middleware.kind_of?(Builder) +@@ -80,27 +108,32 @@ def insert(index, middleware, *args, &block) + stack.insert(index, stack_item) + end + else +- stack.insert(index, [middleware, args, block]) ++ stack.insert(index, item) + end + end + + alias_method :insert_before, :insert + + # Inserts a middleware after the given index or middleware object. +- def insert_after(index, middleware, *args, &block) +- index = self.index(index) unless index.is_a?(Integer) ++ def insert_after(idx_or_item, middleware, *args, **keywords, &block) ++ if idx_or_item.is_a?(Integer) ++ index = idx_or_item ++ else ++ index = self.index(idx_or_item) ++ end ++ + raise "no such middleware to insert after: #{index.inspect}" unless index + insert(index + 1, middleware, *args, &block) + end + + # Replaces the given middlware object or index with the new + # middleware. +- def replace(index, middleware, *args, &block) ++ def replace(index, middleware, *args, **keywords, &block) + if index.is_a?(Integer) + delete(index) +- insert(index, middleware, *args, &block) ++ insert(index, middleware, *args, **keywords, &block) + else +- insert_before(index, middleware, *args, &block) ++ insert_before(index, middleware, *args, **keywords, &block) + delete(index) + end + end +@@ -123,8 +156,9 @@ def call(env) + def index(object) + stack.each_with_index do |item, i| + return i if item == object +- return i if item[0] == object +- return i if item[0].respond_to?(:name) && item[0].name == object ++ return i if item.middleware == object ++ return i if item.middleware.respond_to?(:name) && ++ item.middleware.name == object + end + + nil +diff --git a/lib/vagrant/action/builtin/box_add.rb b/lib/vagrant/action/builtin/box_add.rb +index dac1fefa52..a635d77cec 100644 +--- a/lib/vagrant/action/builtin/box_add.rb ++++ b/lib/vagrant/action/builtin/box_add.rb +@@ -25,6 +25,7 @@ class BoxAdd + def initialize(app, env) + @app = app + @logger = Log4r::Logger.new("vagrant::action::builtin::box_add") ++ @parser = URI::RFC2396_Parser.new + end + + def call(env) +@@ -44,7 +45,7 @@ def call(env) + 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:///#{@parser.escape(u)}" + end + + if u =~ /^[a-z0-9]+:.*$/i && !u.start_with?("file://") +@@ -53,9 +54,9 @@ def call(env) + end + + # Expand the path and try to use that, if possible +- p = File.expand_path(URI.unescape(u.gsub(/^file:\/\//, ""))) ++ p = File.expand_path(@parser.unescape(u.gsub(/^file:\/\//, ""))) + p = Util::Platform.cygwin_windows_path(p) +- next "file://#{URI.escape(p.gsub("\\", "/"))}" if File.file?(p) ++ next "file://#{@parser.escape(p.gsub("\\", "/"))}" if File.file?(p) + + u + end +@@ -434,7 +435,7 @@ def downloader(url, env, **opts) + downloader_options[:ui] = env[:ui] if opts[:ui] + downloader_options[:location_trusted] = env[:box_download_location_trusted] + downloader_options[:box_extra_download_options] = env[:box_extra_download_options] +- ++ + Util::Downloader.new(url, temp_path, downloader_options) + end + +@@ -495,7 +496,7 @@ def metadata_url?(url, env) + 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 = @parser.unescape(url) + + begin + File.open(url, "r") do |f| +diff --git a/lib/vagrant/action/builtin/mixin_synced_folders.rb b/lib/vagrant/action/builtin/mixin_synced_folders.rb +index c2d8aabb5a..1209f5d690 100644 +--- a/lib/vagrant/action/builtin/mixin_synced_folders.rb ++++ b/lib/vagrant/action/builtin/mixin_synced_folders.rb +@@ -72,7 +72,7 @@ def plugins + # + # @param [Machine] machine The machine that the folders belong to + # @param [Hash] folders The result from a {#synced_folders} call. +- def save_synced_folders(machine, folders, **opts) ++ def save_synced_folders(machine, folders, opts={}) + if opts[:merge] + existing = cached_synced_folders(machine) + if existing +diff --git a/lib/vagrant/action/hook.rb b/lib/vagrant/action/hook.rb +index 3ab3080859..7270e6a33f 100644 +--- a/lib/vagrant/action/hook.rb ++++ b/lib/vagrant/action/hook.rb +@@ -7,23 +7,23 @@ class Hook + # This is a hash of the middleware to prepend to a certain + # other middleware. + # +- # @return [Hash>] ++ # @return [Hash>] + attr_reader :before_hooks + + # This is a hash of the middleware to append to a certain other + # middleware. + # +- # @return [Hash>] ++ # @return [Hash>] + attr_reader :after_hooks + + # This is a list of the hooks to just prepend to the beginning + # +- # @return [Array] ++ # @return [Array] + attr_reader :prepend_hooks + + # This is a list of the hooks to just append to the end + # +- # @return [Array] ++ # @return [Array] + attr_reader :append_hooks + + def initialize +@@ -37,16 +37,32 @@ def initialize + # + # @param [Class] existing The existing middleware. + # @param [Class] new The new middleware. +- def before(existing, new, *args, &block) +- @before_hooks[existing] << [new, args, block] ++ def before(existing, new, *args, **keywords, &block) ++ item = Builder::StackItem.new( ++ middleware: new, ++ arguments: Builder::MiddlewareArguments.new( ++ parameters: args, ++ keywords: keywords, ++ block: block ++ ) ++ ) ++ @before_hooks[existing] << item + end + + # Add a middleware after an existing middleware. + # + # @param [Class] existing The existing middleware. + # @param [Class] new The new middleware. +- def after(existing, new, *args, &block) +- @after_hooks[existing] << [new, args, block] ++ def after(existing, new, *args, **keywords, &block) ++ item = Builder::StackItem.new( ++ middleware: new, ++ arguments: Builder::MiddlewareArguments.new( ++ parameters: args, ++ keywords: keywords, ++ block: block ++ ) ++ ) ++ @after_hooks[existing] << item + end + + # Append a middleware to the end of the stack. Note that if the +@@ -54,15 +70,31 @@ def after(existing, new, *args, &block) + # be run. + # + # @param [Class] new The middleware to append. +- def append(new, *args, &block) +- @append_hooks << [new, args, block] ++ def append(new, *args, **keywords, &block) ++ item = Builder::StackItem.new( ++ middleware: new, ++ arguments: Builder::MiddlewareArguments.new( ++ parameters: args, ++ keywords: keywords, ++ block: block ++ ) ++ ) ++ @append_hooks << item + end + + # Prepend a middleware to the beginning of the stack. + # + # @param [Class] new The new middleware to prepend. +- def prepend(new, *args, &block) +- @prepend_hooks << [new, args, block] ++ def prepend(new, *args, **keywords, &block) ++ item = Builder::StackItem.new( ++ middleware: new, ++ arguments: Builder::MiddlewareArguments.new( ++ parameters: args, ++ keywords: keywords, ++ block: block ++ ) ++ ) ++ @prepend_hooks << item + end + + # @return [Boolean] +@@ -77,27 +109,28 @@ def empty? + # called directly. + # + # @param [Builder] builder +- def apply(builder, options=nil) +- options ||= {} +- ++ def apply(builder, options={}) + if !options[:no_prepend_or_append] + # Prepends first +- @prepend_hooks.each do |klass, args, block| ++ @prepend_hooks.each do |item| + if options[:root] + idx = builder.index(options[:root]) + else + idx = 0 + end +- builder.insert(idx, klass, *args, &block) ++ builder.insert(idx, item.middleware, *item.arguments.parameters, ++ **item.arguments.keywords, &item.arguments.block) + end + + # Appends +- @append_hooks.each do |klass, args, block| ++ @append_hooks.each do |item| + if options[:root] + idx = builder.index(options[:root]) +- builder.insert(idx + 1, klass, *args, &block) ++ builder.insert(idx + 1, item.middleware, *item.arguments.parameters, ++ **item.arguments.keywords, &item.arguments.block) + else +- builder.use(klass, *args, &block) ++ builder.use(item.middleware, *item.arguments.parameters, ++ **item.arguments.keywords, &item.arguments.block) + end + end + end +@@ -106,8 +139,9 @@ def apply(builder, options=nil) + @before_hooks.each do |key, list| + next if !builder.index(key) + +- list.each do |klass, args, block| +- builder.insert_before(key, klass, *args, &block) ++ list.each do |item| ++ builder.insert_before(key, item.middleware, *item.arguments.parameters, ++ **item.arguments.keywords, &item.arguments.block) + end + end + +@@ -115,8 +149,9 @@ def apply(builder, options=nil) + @after_hooks.each do |key, list| + next if !builder.index(key) + +- list.each do |klass, args, block| +- builder.insert_after(key, klass, *args, &block) ++ list.each do |item| ++ builder.insert_after(key, item.middleware, *item.arguments.parameters, ++ **item.arguments.keywords, &item.arguments.block) + end + end + end +diff --git a/lib/vagrant/action/warden.rb b/lib/vagrant/action/warden.rb +index 828e317fcc..931ce87fc8 100644 +--- a/lib/vagrant/action/warden.rb ++++ b/lib/vagrant/action/warden.rb +@@ -92,14 +92,34 @@ def recover(env) + # A somewhat confusing function which simply initializes each + # middleware properly to call the next middleware in the sequence. + def finalize_action(action, env) +- klass, args, block = action ++ if action.is_a?(Builder::StackItem) ++ klass = action.middleware ++ args = action.arguments.parameters ++ keywords = action.arguments.keywords ++ block = action.arguments.block ++ else ++ klass = action ++ args = [] ++ keywords = {} ++ end + +- # Default the arguments to an empty array. Otherwise in Ruby 1.8 +- # a `nil` args will actually pass `nil` into the class. +- args ||= [] ++ args = nil if args.empty? ++ keywords = nil if keywords.empty? + + if klass.is_a?(Class) +- klass.new(self, env, *args, &block) ++ # NOTE: We need to detect if we are passing args and/or ++ # keywords and do it explicitly. Earlier versions ++ # are not as lax about splatting keywords when the ++ # target method is not expecting them. ++ if args && keywords ++ klass.new(self, env, *args, **keywords, &block) ++ elsif args ++ klass.new(self, env, *args, &block) ++ elsif keywords ++ klass.new(self, env, **keywords, &block) ++ else ++ klass.new(self, env, &block) ++ end + elsif klass.respond_to?(:call) + # Make it a lambda which calls the item then forwards + # up the chain +diff --git a/lib/vagrant/box.rb b/lib/vagrant/box.rb +index 2f12775f5e..0ee5d29f39 100644 +--- a/lib/vagrant/box.rb ++++ b/lib/vagrant/box.rb +@@ -57,12 +57,13 @@ class Box + # @param [Symbol] provider The provider that this box implements. + # @param [Pathname] directory The directory where this box exists on + # disk. +- def initialize(name, provider, version, directory, **opts) ++ # @param [String] metadata_url Metadata URL for box ++ def initialize(name, provider, version, directory, metadata_url: nil) + @name = name + @version = version + @provider = provider + @directory = directory +- @metadata_url = opts[:metadata_url] ++ @metadata_url = metadata_url + + metadata_file = directory.join("metadata.json") + raise Errors::BoxMetadataFileNotFound, name: @name if !metadata_file.file? +@@ -120,7 +121,7 @@ def in_use?(index) + # + # @param [Hash] download_options Options to pass to the downloader. + # @return [BoxMetadata] +- def load_metadata(**download_options) ++ def load_metadata(download_options={}) + tf = Tempfile.new("vagrant-load-metadata") + tf.close + +@@ -132,7 +133,7 @@ def load_metadata(**download_options) + end + + opts = { headers: ["Accept: application/json"] }.merge(download_options) +- Util::Downloader.new(url, tf.path, **opts).download! ++ Util::Downloader.new(url, tf.path, opts).download! + BoxMetadata.new(File.open(tf.path, "r")) + rescue Errors::DownloaderError => e + raise Errors::BoxMetadataDownloadError, +diff --git a/lib/vagrant/bundler.rb b/lib/vagrant/bundler.rb +index f4d2a02396..336ac1e057 100644 +--- a/lib/vagrant/bundler.rb ++++ b/lib/vagrant/bundler.rb +@@ -632,7 +632,12 @@ def vagrant_internal_specs + self_spec.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] ++ if Gem.respond_to?(:default_specifications_dir) ++ spec_dir = Gem.default_specifications_dir ++ else ++ spec_dir = Gem::Specification.default_specifications_dir ++ end ++ directories = [spec_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 e41c0f72eb..782615bc45 100644 +--- a/lib/vagrant/errors.rb ++++ b/lib/vagrant/errors.rb +@@ -100,7 +100,7 @@ def status_code; 1; end + + 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/machine_index.rb b/lib/vagrant/machine_index.rb +index eec0062923..802f6dfa73 100644 +--- a/lib/vagrant/machine_index.rb ++++ b/lib/vagrant/machine_index.rb +@@ -452,7 +452,7 @@ def valid?(home_path) + # Creates a {Vagrant::Environment} for this entry. + # + # @return [Vagrant::Environment] +- def vagrant_env(home_path, **opts) ++ def vagrant_env(home_path, opts={}) + Vagrant::Util::SilenceWarnings.silence! do + Environment.new({ + cwd: @vagrantfile_path, +diff --git a/lib/vagrant/ui.rb b/lib/vagrant/ui.rb +index a521fd105a..b1a80a49f5 100644 +--- a/lib/vagrant/ui.rb ++++ b/lib/vagrant/ui.rb +@@ -227,7 +227,7 @@ def clear_line + + # This method handles actually outputting a message of a given type + # to the console. +- def say(type, message, **opts) ++ def say(type, message, opts={}) + defaults = { new_line: true, prefix: true } + opts = defaults.merge(@opts).merge(opts) + +diff --git a/lib/vagrant/util/downloader.rb b/lib/vagrant/util/downloader.rb +index 26c0d7067e..bf966ecafe 100644 +--- a/lib/vagrant/util/downloader.rb ++++ b/lib/vagrant/util/downloader.rb +@@ -1,3 +1,4 @@ ++require "cgi" + require "uri" + + require "log4r" +@@ -42,8 +43,8 @@ def initialize(source, destination, options=nil) + 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/communicators/winssh/communicator.rb b/plugins/communicators/winssh/communicator.rb +index 1239049d21..3ea012f618 100644 +--- a/plugins/communicators/winssh/communicator.rb ++++ b/plugins/communicators/winssh/communicator.rb +@@ -217,7 +217,7 @@ def sftp_connect + # The WinSSH communicator connection provides isolated modification + # to the generated connection instances. This modification forces + # all provided commands to run within powershell +- def connect(*args) ++ def connect(**opts) + connection = nil + super { |c| connection = c } + +diff --git a/plugins/kernel_v2/config/vm.rb b/plugins/kernel_v2/config/vm.rb +index acc6df6a6b..f6fb07c000 100644 +--- a/plugins/kernel_v2/config/vm.rb ++++ b/plugins/kernel_v2/config/vm.rb +@@ -380,7 +380,7 @@ def provision(name, **options, &block) + 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 + +@@ -435,7 +435,7 @@ def disk(type, **options, &block) + disk_config.set_options(options) + + # Add provider config +- disk_config.add_provider_config(provider_options, &block) ++ disk_config.add_provider_config(**provider_options, &block) + + if !Vagrant::Util::Experimental.feature_enabled?("disks") + @logger.warn("Disk config defined, but experimental feature is not enabled. To use this feature, enable it with the experimental flag `disks`. Disk will not be added to internal config, and will be ignored.") +diff --git a/test/unit/plugins/commands/box/command/add_test.rb b/test/unit/plugins/commands/box/command/add_test.rb +index 77cf7d1acd..ea3c5f3317 100644 +--- a/test/unit/plugins/commands/box/command/add_test.rb ++++ b/test/unit/plugins/commands/box/command/add_test.rb +@@ -32,7 +32,7 @@ + let(:argv) { ["foo"] } + + it "executes the runner with the proper actions" do +- expect(action_runner).to receive(:run).with(any_args) { |action, **opts| ++ expect(action_runner).to receive(:run).with(any_args) { |action, opts| + expect(opts[:box_name]).to be_nil + expect(opts[:box_url]).to eq("foo") + true +@@ -46,7 +46,7 @@ + let(:argv) { ["foo", "bar"] } + + it "executes the runner with the proper actions" do +- expect(action_runner).to receive(:run).with(any_args) { |action, **opts| ++ expect(action_runner).to receive(:run).with(any_args) { |action, opts| + expect(opts[:box_name]).to eq("foo") + expect(opts[:box_url]).to eq("bar") + true +diff --git a/test/unit/plugins/commands/box/command/outdated_test.rb b/test/unit/plugins/commands/box/command/outdated_test.rb +index c395171aaa..6b52614cdc 100644 +--- a/test/unit/plugins/commands/box/command/outdated_test.rb ++++ b/test/unit/plugins/commands/box/command/outdated_test.rb +@@ -24,7 +24,7 @@ + let(:argv) { ["--force"] } + + it "passes along the force update option" do +- expect(action_runner).to receive(:run).with(any_args) { |action, **opts| ++ expect(action_runner).to receive(:run).with(any_args) { |action, opts| + expect(opts[:box_outdated_force]).to be_truthy + true + } +diff --git a/test/unit/plugins/communicators/ssh/communicator_test.rb b/test/unit/plugins/communicators/ssh/communicator_test.rb +index 3686fa6a04..f04ddf673b 100644 +--- a/test/unit/plugins/communicators/ssh/communicator_test.rb ++++ b/test/unit/plugins/communicators/ssh/communicator_test.rb +@@ -120,7 +120,7 @@ + context "when printing message to the user" do + before do + allow(machine).to receive(:ssh_info). +- and_return(host: '10.1.2.3', port: 22).ordered ++ and_return(host: '10.1.2.3', port: 22) + allow(communicator).to receive(:connect) + allow(communicator).to receive(:ready?).and_return(true) + end +diff --git a/test/unit/plugins/guests/windows/cap/change_host_name_test.rb b/test/unit/plugins/guests/windows/cap/change_host_name_test.rb +index a75412ae22..07ef98461d 100644 +--- a/test/unit/plugins/guests/windows/cap/change_host_name_test.rb ++++ b/test/unit/plugins/guests/windows/cap/change_host_name_test.rb +@@ -6,7 +6,8 @@ + let(:described_class) do + VagrantPlugins::GuestWindows::Plugin.components.guest_capabilities[:windows].get(:change_host_name) + end +- let(:machine) { double("machine") } ++ let(:machine) { double("machine", guest: guest) } ++ let(:guest) { double("guest") } + let(:communicator) { VagrantTests::DummyCommunicator::Communicator.new(machine) } + + before do +@@ -34,7 +35,6 @@ + 'if (!([System.Net.Dns]::GetHostName() -eq \'newhostname\')) { exit 0 } exit 1', + exit_code: 0) + communicator.stub_command(rename_script, exit_code: 0) +- allow(machine).to receive(:guest) + allow(machine.guest).to receive(:capability) + allow(machine.guest).to receive(:capability?) + described_class.change_host_name_and_wait(machine, 'newhostname', 0) +diff --git a/test/unit/plugins/providers/docker/driver_compose_test.rb b/test/unit/plugins/providers/docker/driver_compose_test.rb +index 9606de5ddb..d8b3006cab 100644 +--- a/test/unit/plugins/providers/docker/driver_compose_test.rb ++++ b/test/unit/plugins/providers/docker/driver_compose_test.rb +@@ -32,7 +32,7 @@ + end + let(:data_directory){ double("data-directory", join: composition_path) } + let(:local_data_path){ double("local-data-path") } +- let(:compose_execute_up){ ["docker-compose", "-f", "docker-compose.yml", "-p", "cwd", "up", "--remove-orphans", "-d", {}] } ++ let(:compose_execute_up){ ["docker-compose", "-f", "docker-compose.yml", "-p", "cwd", "up", "--remove-orphans", "-d", any_args] } + + + subject{ described_class.new(machine) } +@@ -277,7 +277,7 @@ + before { allow(subject).to receive(:created?).and_return(true) } + + it 'removes the container' do +- expect(subject).to receive(:execute).with("docker-compose", "-f", "docker-compose.yml", "-p", "cwd", "rm", "-f", "docker_1", {}) ++ expect(subject).to receive(:execute).with("docker-compose", "-f", "docker-compose.yml", "-p", "cwd", "rm", "-f", "docker_1", any_args) + subject.rm(cid) + end + end +diff --git a/test/unit/plugins/providers/virtualbox/action/network_test.rb b/test/unit/plugins/providers/virtualbox/action/network_test.rb +index 34ed17d94e..69b30b3390 100644 +--- a/test/unit/plugins/providers/virtualbox/action/network_test.rb ++++ b/test/unit/plugins/providers/virtualbox/action/network_test.rb +@@ -44,7 +44,7 @@ + + it "creates a host-only interface with an IPv6 address :1" do + guest = double("guest") +- machine.config.vm.network 'private_network', { type: :static, ip: 'dead:beef::100' } ++ machine.config.vm.network 'private_network', type: :static, ip: 'dead:beef::100' + #allow(driver).to receive(:read_bridged_interfaces) { [] } + allow(driver).to receive(:read_host_only_interfaces) { [] } + #allow(driver).to receive(:read_dhcp_servers) { [] } +@@ -71,19 +71,11 @@ + end + + it "raises the appropriate error when provided with an invalid IP address" do +- guest = double("guest") +- machine.config.vm.network 'private_network', { ip: '192.168.33.06' } ++ machine.config.vm.network 'private_network', ip: '192.168.33.06' + + expect{ subject.call(env) }.to raise_error(Vagrant::Errors::NetworkAddressInvalid) + end + +- it "raises no invalid network error when provided with a valid IP address" do +- guest = double("guest") +- machine.config.vm.network 'private_network', { ip: '192.168.33.6' } +- +- expect{ subject.call(env) }.not_to raise_error(Vagrant::Errors::NetworkAddressInvalid) +- end +- + context "with a dhcp private network" do + let(:bridgedifs) { [] } + let(:hostonlyifs) { [] } +@@ -92,7 +84,7 @@ + let(:network_args) {{ type: :dhcp }} + + before do +- machine.config.vm.network 'private_network', network_args ++ machine.config.vm.network 'private_network', **network_args + allow(driver).to receive(:read_bridged_interfaces) { bridgedifs } + allow(driver).to receive(:read_host_only_interfaces) { hostonlyifs } + allow(driver).to receive(:read_dhcp_servers) { dhcpservers } +diff --git a/test/unit/plugins/provisioners/chef/config/chef_apply_test.rb b/test/unit/plugins/provisioners/chef/config/chef_apply_test.rb +index 135c042138..5bcee520c1 100644 +--- a/test/unit/plugins/provisioners/chef/config/chef_apply_test.rb ++++ b/test/unit/plugins/provisioners/chef/config/chef_apply_test.rb +@@ -10,7 +10,7 @@ + let(:machine) { double("machine") } + + def chef_error(key, options = {}) +- I18n.t("vagrant.provisioners.chef.#{key}", options) ++ I18n.t("vagrant.provisioners.chef.#{key}", **options) + end + + describe "#recipe" do +diff --git a/test/unit/vagrant/action/builder_test.rb b/test/unit/vagrant/action/builder_test.rb +index cf87f375e3..efb4194573 100644 +--- a/test/unit/vagrant/action/builder_test.rb ++++ b/test/unit/vagrant/action/builder_test.rb +@@ -549,12 +549,12 @@ def call(env) + + it "should add trigger action to start of stack" do + subject.apply_dynamic_updates(env) +- expect(subject.stack[0].first).to eq(Vagrant::Action::Builtin::Trigger) ++ expect(subject.stack[0].middleware).to eq(Vagrant::Action::Builtin::Trigger) + end + + it "should have timing and type arguments" do + subject.apply_dynamic_updates(env) +- args = subject.stack[0][1] ++ args = subject.stack[0].arguments.parameters + expect(args).to include(type) + expect(args).to include(timing) + expect(args).to include(action.to_s) +@@ -566,12 +566,12 @@ def call(env) + + it "should add trigger action to middle of stack" do + subject.apply_dynamic_updates(env) +- expect(subject.stack[1].first).to eq(Vagrant::Action::Builtin::Trigger) ++ expect(subject.stack[1].middleware).to eq(Vagrant::Action::Builtin::Trigger) + end + + it "should have timing and type arguments" do + subject.apply_dynamic_updates(env) +- args = subject.stack[1][1] ++ args = subject.stack[1].arguments.parameters + expect(args).to include(type) + expect(args).to include(timing) + expect(args).to include(action.to_s) +@@ -587,12 +587,12 @@ def call(env) + + it "should add trigger action to start of stack" do + subject.apply_dynamic_updates(env) +- expect(subject.stack[0].first).to eq(Vagrant::Action::Builtin::Trigger) ++ expect(subject.stack[0].middleware).to eq(Vagrant::Action::Builtin::Trigger) + end + + it "should have timing and type arguments" do + subject.apply_dynamic_updates(env) +- args = subject.stack[0][1] ++ args = subject.stack[0].arguments.parameters + expect(args).to include(type) + expect(args).to include(timing) + expect(args).to include(action.to_s) +@@ -609,7 +609,7 @@ def call(env) + + it "should have timing and type arguments" do + subject.apply_dynamic_updates(env) +- args = subject.stack[1][1] ++ args = subject.stack[1].arguments.parameters + expect(args).to include(type) + expect(args).to include(timing) + expect(args).to include(action.to_s) +@@ -688,7 +688,7 @@ def call(env) + + it "should include arguments to the trigger action" do + subject.apply_action_name(env) +- args = subject.stack[0][1] ++ args = subject.stack[0].arguments.parameters + expect(args).to include(raw_action_name) + expect(args).to include(timing) + expect(args).to include(:action) +@@ -705,9 +705,9 @@ def call(env) + + it "should include arguments to the trigger action" do + subject.apply_action_name(env) +- builder = subject.stack.first[1]&.first ++ builder = subject.stack.first.arguments.parameters.first + expect(builder).not_to be_nil +- args = builder.stack.first[1] ++ args = builder.stack.first.arguments.parameters + expect(args).to include(raw_action_name) + expect(args).to include(timing) + expect(args).to include(:action) +@@ -728,12 +728,12 @@ def call(env) + + it "should add a trigger action to the start of the stack" do + subject.apply_action_name(env) +- expect(subject.stack[0].first).to eq(Vagrant::Action::Builtin::Trigger) ++ expect(subject.stack[0].middleware).to eq(Vagrant::Action::Builtin::Trigger) + end + + it "should include arguments to the trigger action" do + subject.apply_action_name(env) +- args = subject.stack[0][1] ++ args = subject.stack[0].arguments.parameters + expect(args).to include(action_name) + expect(args).to include(timing) + expect(args).to include(:hook) +@@ -750,7 +750,7 @@ def call(env) + + it "should include arguments to the trigger action" do + subject.apply_action_name(env) +- args = subject.stack.last[1] ++ args = subject.stack.last.arguments.parameters + expect(args).to include(action_name) + expect(args).to include(timing) + expect(args).to include(:hook) +diff --git a/test/unit/vagrant/action/builtin/box_add_test.rb b/test/unit/vagrant/action/builtin/box_add_test.rb +index 91bbc27a25..48406c2cf8 100644 +--- a/test/unit/vagrant/action/builtin/box_add_test.rb ++++ b/test/unit/vagrant/action/builtin/box_add_test.rb +@@ -91,7 +91,7 @@ def with_web_server(path, **opts) + env[:box_name] = "foo" + env[:box_url] = box_path.to_s + +- expect(box_collection).to receive(:add).with(any_args) { |path, name, version, **opts| ++ expect(box_collection).to receive(:add).with(any_args) { |path, name, version, opts| + expect(checksum(path)).to eq(checksum(box_path)) + expect(name).to eq("foo") + expect(version).to eq("0") +@@ -113,7 +113,7 @@ def with_web_server(path, **opts) + box_path.to_s, + ] + +- expect(box_collection).to receive(:add).with(any_args) { |path, name, version, **opts| ++ expect(box_collection).to receive(:add).with(any_args) { |path, name, version, opts| + expect(checksum(path)).to eq(checksum(box_path)) + expect(name).to eq("foo") + expect(version).to eq("0") +@@ -132,7 +132,7 @@ def with_web_server(path, **opts) + env[:box_name] = "foo" + env[:box_url] = "http://127.0.0.1:#{port}/#{box_path.basename}" + +- expect(box_collection).to receive(:add).with(any_args) { |path, name, version, **opts| ++ expect(box_collection).to receive(:add).with(any_args) { |path, name, version, opts| + expect(checksum(path)).to eq(checksum(box_path)) + expect(name).to eq("foo") + expect(version).to eq("0") +@@ -152,7 +152,7 @@ def with_web_server(path, **opts) + env[:box_name] = "foo" + env[:box_url] = "ftp://127.0.0.1:#{port}/#{box_path.basename}" + +- expect(box_collection).to receive(:add).with(any_args) { |path, name, version, **opts| ++ expect(box_collection).to receive(:add).with(any_args) { |path, name, version, opts| + expect(checksum(path)).to eq(checksum(box_path)) + expect(name).to eq("foo") + expect(version).to eq("0") +@@ -218,7 +218,7 @@ def with_web_server(path, **opts) + env[:box_checksum_type] = "" + + +- expect(box_collection).to receive(:add).with(any_args) { |path, name, version, **opts| ++ expect(box_collection).to receive(:add).with(any_args) { |path, name, version, opts| + expect(checksum(path)).to eq(checksum(box_path)) + expect(name).to eq("foo") + expect(version).to eq("0") +@@ -291,7 +291,7 @@ def with_web_server(path, **opts) + env[:box_provider] = "virtualbox" + + allow(box_collection).to receive(:find).and_return(box) +- expect(box_collection).to receive(:add).with(any_args) { |path, name, version, **opts| ++ expect(box_collection).to receive(:add).with(any_args) { |path, name, version, opts| + expect(checksum(path)).to eq(checksum(box_path)) + expect(name).to eq("foo") + expect(version).to eq("0") +@@ -311,7 +311,7 @@ def with_web_server(path, **opts) + box_url_name = "http://127.0.0.1:#{port}/#{box_path.basename}" + env[:box_name] = box_url_name + +- expect(box_collection).to receive(:add).with(any_args) { |path, name, version, **opts| ++ expect(box_collection).to receive(:add).with(any_args) { |path, name, version, opts| + expect(name).to eq(box_url_name) + expect(version).to eq("0") + expect(opts[:metadata_url]).to be_nil +@@ -333,7 +333,7 @@ def with_web_server(path, **opts) + box_url_name = "box name with spaces" + env[:box_name] = box_url_name + +- expect(box_collection).to receive(:add).with(any_args) { |path, name, version, **opts| ++ expect(box_collection).to receive(:add).with(any_args) { |path, name, version, opts| + expect(name).to eq(box_url_name) + expect(version).to eq("0") + expect(opts[:metadata_url]).to be_nil +@@ -356,7 +356,7 @@ def with_web_server(path, **opts) + env[:box_name] = "foo" + env[:box_url] = "http://#{username}:#{password}@127.0.0.1:#{port}/#{box_path.basename}" + +- expect(box_collection).to receive(:add).with(any_args) { |path, name, version, **opts| ++ expect(box_collection).to receive(:add).with(any_args) { |path, name, version, opts| + expect(checksum(path)).to eq(checksum(box_path)) + expect(name).to eq("foo") + expect(version).to eq("0") +@@ -404,7 +404,7 @@ def with_web_server(path, **opts) + with_web_server(md_path) do |port| + env[:box_url] = "http://127.0.0.1:#{port}/#{md_path.basename}" + +- expect(box_collection).to receive(:add).with(any_args) { |path, name, version, **opts| ++ expect(box_collection).to receive(:add).with(any_args) { |path, name, version, opts| + expect(name).to eq("foo/bar") + expect(version).to eq("0.7") + expect(checksum(path)).to eq(checksum(box_path)) +@@ -449,7 +449,7 @@ def with_web_server(path, **opts) + with_web_server(md_path, **opts) do |port| + env[:box_url] = "http://127.0.0.1:#{port}/#{md_path.basename}" + +- expect(box_collection).to receive(:add).with(any_args) { |path, name, version, **opts| ++ expect(box_collection).to receive(:add).with(any_args) { |path, name, version, opts| + expect(name).to eq("foo/bar") + expect(version).to eq("0.7") + expect(checksum(path)).to eq(checksum(box_path)) +@@ -494,7 +494,7 @@ def with_web_server(path, **opts) + url = "http://127.0.0.1:#{port}" + env[:box_url] = "mitchellh/precise64.json" + +- expect(box_collection).to receive(:add).with(any_args) { |path, name, version, **opts| ++ expect(box_collection).to receive(:add).with(any_args) { |path, name, version, opts| + expect(name).to eq("mitchellh/precise64") + expect(version).to eq("0.7") + expect(checksum(path)).to eq(checksum(box_path)) +@@ -545,7 +545,7 @@ def with_web_server(path, **opts) + env[:box_url] = "mitchellh/precise64.json" + env[:box_server_url] = url + +- expect(box_collection).to receive(:add).with(any_args) { |path, name, version, **opts| ++ expect(box_collection).to receive(:add).with(any_args) { |path, name, version, opts| + expect(name).to eq("mitchellh/precise64") + expect(version).to eq("0.7") + expect(checksum(path)).to eq(checksum(box_path)) +@@ -606,7 +606,7 @@ def with_web_server(path, **opts) + end + end + +- expect(box_collection).to receive(:add).with(any_args) { |path, name, version, **opts| ++ expect(box_collection).to receive(:add).with(any_args) { |path, name, version, opts| + expect(name).to eq("foo/bar") + expect(version).to eq("0.7") + expect(checksum(path)).to eq(checksum(box_path)) +@@ -651,7 +651,7 @@ def with_web_server(path, **opts) + with_web_server(md_path) do |port| + env[:box_url] = "http://127.0.0.1:#{port}/#{md_path.basename}" + +- expect(box_collection).to receive(:add).with(any_args) { |path, name, version, **opts| ++ expect(box_collection).to receive(:add).with(any_args) { |path, name, version, opts| + expect(name).to eq("foo/bar") + expect(version).to eq("0.7") + expect(checksum(path)).to eq(checksum(box_path)) +@@ -795,7 +795,7 @@ def with_web_server(path, **opts) + end + + env[:box_url] = tf.path +- expect(box_collection).to receive(:add).with(any_args) { |path, name, version, **opts| ++ expect(box_collection).to receive(:add).with(any_args) { |path, name, version, opts| + expect(checksum(path)).to eq(checksum(box_path)) + expect(name).to eq("foo/bar") + expect(version).to eq("0.7") +@@ -839,7 +839,7 @@ def with_web_server(path, **opts) + + env[:box_url] = tf.path + env[:box_provider] = "vmware" +- expect(box_collection).to receive(:add).with(any_args) { |path, name, version, **opts| ++ expect(box_collection).to receive(:add).with(any_args) { |path, name, version, opts| + expect(checksum(path)).to eq(checksum(box_path)) + expect(name).to eq("foo/bar") + expect(version).to eq("0.7") +@@ -888,7 +888,7 @@ def with_web_server(path, **opts) + + env[:box_url] = tf.path + env[:box_provider] = "vmware" +- expect(box_collection).to receive(:add).with(any_args) { |path, name, version, **opts| ++ expect(box_collection).to receive(:add).with(any_args) { |path, name, version, opts| + expect(checksum(path)).to eq(checksum(box_path)) + expect(name).to eq("foo/bar") + expect(version).to eq("0.7") +@@ -928,7 +928,7 @@ def with_web_server(path, **opts) + + env[:box_url] = tf.path + env[:box_version] = "~> 0.1" +- expect(box_collection).to receive(:add).with(any_args) { |path, name, version, **opts| ++ expect(box_collection).to receive(:add).with(any_args) { |path, name, version, opts| + expect(checksum(path)).to eq(checksum(box_path)) + expect(name).to eq("foo/bar") + expect(version).to eq("0.5") +@@ -973,7 +973,7 @@ def with_web_server(path, **opts) + env[:box_url] = tf.path + env[:box_provider] = "vmware" + env[:box_version] = "~> 0.1" +- expect(box_collection).to receive(:add).with(any_args) { |path, name, version, **opts| ++ expect(box_collection).to receive(:add).with(any_args) { |path, name, version, opts| + expect(checksum(path)).to eq(checksum(box_path)) + expect(name).to eq("foo/bar") + expect(version).to eq("0.5") +@@ -1021,7 +1021,7 @@ def with_web_server(path, **opts) + + env[:box_url] = tf.path + env[:box_provider] = ["virtualbox", "vmware"] +- expect(box_collection).to receive(:add).with(any_args) { |path, name, version, **opts| ++ expect(box_collection).to receive(:add).with(any_args) { |path, name, version, opts| + expect(checksum(path)).to eq(checksum(box_path)) + expect(name).to eq("foo/bar") + expect(version).to eq("0.7") +@@ -1069,7 +1069,7 @@ def with_web_server(path, **opts) + + expect(env[:ui]).to receive(:ask).and_return("1") + +- expect(box_collection).to receive(:add).with(any_args) { |path, name, version, **opts| ++ expect(box_collection).to receive(:add).with(any_args) { |path, name, version, opts| + expect(checksum(path)).to eq(checksum(box_path)) + expect(name).to eq("foo/bar") + expect(version).to eq("0.7") +@@ -1245,7 +1245,7 @@ def with_web_server(path, **opts) + env[:box_force] = true + env[:box_url] = tf.path + allow(box_collection).to receive(:find).and_return(box) +- expect(box_collection).to receive(:add).with(any_args) { |path, name, version, **opts| ++ expect(box_collection).to receive(:add).with(any_args) { |path, name, version, opts| + expect(checksum(path)).to eq(checksum(box_path)) + expect(name).to eq("foo/bar") + expect(version).to eq("0.7") +diff --git a/test/unit/vagrant/action/hook_test.rb b/test/unit/vagrant/action/hook_test.rb +index 9c6054b099..c4a3ba9dd8 100644 +--- a/test/unit/vagrant/action/hook_test.rb ++++ b/test/unit/vagrant/action/hook_test.rb +@@ -36,11 +36,20 @@ + subject.before(existing, 2) + subject.before(existing, 3, :arg, &block) + +- expect(subject.before_hooks[existing]).to eq([ +- [1, [], nil], +- [2, [], nil], +- [3, [:arg], block] +- ]) ++ hooks = subject.before_hooks[existing] ++ expect(hooks.size).to eq(3) ++ expect(hooks[0].middleware).to eq(1) ++ expect(hooks[0].arguments.parameters).to eq([]) ++ expect(hooks[0].arguments.keywords).to eq({}) ++ expect(hooks[0].arguments.block).to be_nil ++ expect(hooks[1].middleware).to eq(2) ++ expect(hooks[1].arguments.parameters).to eq([]) ++ expect(hooks[1].arguments.keywords).to eq({}) ++ expect(hooks[1].arguments.block).to be_nil ++ expect(hooks[2].middleware).to eq(3) ++ expect(hooks[2].arguments.parameters).to eq([:arg]) ++ expect(hooks[2].arguments.keywords).to eq({}) ++ expect(hooks[2].arguments.block).to eq(block) + end + end + +@@ -54,11 +63,20 @@ + subject.after(existing, 2) + subject.after(existing, 3, :arg, &block) + +- expect(subject.after_hooks[existing]).to eq([ +- [1, [], nil], +- [2, [], nil], +- [3, [:arg], block] +- ]) ++ hooks = subject.after_hooks[existing] ++ expect(hooks.size).to eq(3) ++ expect(hooks[0].middleware).to eq(1) ++ expect(hooks[0].arguments.parameters).to eq([]) ++ expect(hooks[0].arguments.keywords).to eq({}) ++ expect(hooks[0].arguments.block).to be_nil ++ expect(hooks[1].middleware).to eq(2) ++ expect(hooks[1].arguments.parameters).to eq([]) ++ expect(hooks[1].arguments.keywords).to eq({}) ++ expect(hooks[1].arguments.block).to be_nil ++ expect(hooks[2].middleware).to eq(3) ++ expect(hooks[2].arguments.parameters).to eq([:arg]) ++ expect(hooks[2].arguments.keywords).to eq({}) ++ expect(hooks[2].arguments.block).to eq(block) + end + end + +@@ -70,11 +88,20 @@ + subject.append(2) + subject.append(3, :arg, &block) + +- expect(subject.append_hooks).to eq([ +- [1, [], nil], +- [2, [], nil], +- [3, [:arg], block] +- ]) ++ hooks = subject.append_hooks ++ expect(hooks.size).to eq(3) ++ expect(hooks[0].middleware).to eq(1) ++ expect(hooks[0].arguments.parameters).to eq([]) ++ expect(hooks[0].arguments.keywords).to eq({}) ++ expect(hooks[0].arguments.block).to be_nil ++ expect(hooks[1].middleware).to eq(2) ++ expect(hooks[1].arguments.parameters).to eq([]) ++ expect(hooks[1].arguments.keywords).to eq({}) ++ expect(hooks[1].arguments.block).to be_nil ++ expect(hooks[2].middleware).to eq(3) ++ expect(hooks[2].arguments.parameters).to eq([:arg]) ++ expect(hooks[2].arguments.keywords).to eq({}) ++ expect(hooks[2].arguments.block).to eq(block) + end + end + +@@ -86,11 +113,20 @@ + subject.prepend(2) + subject.prepend(3, :arg, &block) + +- expect(subject.prepend_hooks).to eq([ +- [1, [], nil], +- [2, [], nil], +- [3, [:arg], block] +- ]) ++ hooks = subject.prepend_hooks ++ expect(hooks.size).to eq(3) ++ expect(hooks[0].middleware).to eq(1) ++ expect(hooks[0].arguments.parameters).to eq([]) ++ expect(hooks[0].arguments.keywords).to eq({}) ++ expect(hooks[0].arguments.block).to be_nil ++ expect(hooks[1].middleware).to eq(2) ++ expect(hooks[1].arguments.parameters).to eq([]) ++ expect(hooks[1].arguments.keywords).to eq({}) ++ expect(hooks[1].arguments.block).to be_nil ++ expect(hooks[2].middleware).to eq(3) ++ expect(hooks[2].arguments.parameters).to eq([:arg]) ++ expect(hooks[2].arguments.keywords).to eq({}) ++ expect(hooks[2].arguments.block).to eq(block) + end + end + +@@ -105,12 +141,15 @@ + + subject.apply(builder) + +- expect(builder.stack).to eq([ +- ["1", [2], nil], +- ["2", [], nil], +- ["8", [], nil], +- ["9", [], nil] +- ]) ++ stack = builder.stack ++ expect(stack[0].middleware).to eq("1") ++ expect(stack[0].arguments.parameters).to eq([2]) ++ expect(stack[1].middleware).to eq("2") ++ expect(stack[1].arguments.parameters).to eq([]) ++ expect(stack[2].middleware).to eq("8") ++ expect(stack[2].arguments.parameters).to eq([]) ++ expect(stack[3].middleware).to eq("9") ++ expect(stack[3].arguments.parameters).to eq([]) + end + + it "should not prepend or append if disabled" do +@@ -124,12 +163,11 @@ + + subject.apply(builder, no_prepend_or_append: true) + +- expect(builder.stack).to eq([ +- ["3", [], nil], +- ["4", [], nil], +- ["7", [], nil], +- ["8", [], nil] +- ]) ++ stack = builder.stack ++ expect(stack[0].middleware).to eq("3") ++ expect(stack[1].middleware).to eq("4") ++ expect(stack[2].middleware).to eq("7") ++ expect(stack[3].middleware).to eq("8") + end + end + end +diff --git a/test/unit/vagrant/plugin/manager_test.rb b/test/unit/vagrant/plugin/manager_test.rb +index dcb3dbf5e8..08ac2c3f83 100644 +--- a/test/unit/vagrant/plugin/manager_test.rb ++++ b/test/unit/vagrant/plugin/manager_test.rb +@@ -53,7 +53,7 @@ + before do + allow(Vagrant::Plugin::StateFile).to receive(:new).and_return(state_file) + allow(bundler).to receive(:environment_path=) +- allow(local_data_path).to receive(:join).and_return(local_data_path) ++ allow(local_data_path).to receive(:join).and_return(local_data_path) if local_data_path + allow(subject).to receive(:bundler_init) + end + +@@ -118,7 +118,7 @@ + end + + it "should init the bundler instance with plugins" do +- expect(bundler).to receive(:init!).with(plugins, anything) ++ expect(bundler).to receive(:init!).with(plugins, any_args) + subject.bundler_init(plugins) + end + +diff --git a/test/unit/vagrant/ui_test.rb b/test/unit/vagrant/ui_test.rb +index 4d1ded16e9..e484b81543 100644 +--- a/test/unit/vagrant/ui_test.rb ++++ b/test/unit/vagrant/ui_test.rb +@@ -14,7 +14,7 @@ + end + + it "outputs using `puts` by default" do +- expect(subject).to receive(:safe_puts).with(any_args) { |message, **opts| ++ expect(subject).to receive(:safe_puts).with(any_args) { |message, opts| + expect(opts[:printer]).to eq(:puts) + true + } +@@ -23,7 +23,7 @@ + end + + it "outputs using `print` if new_line is false" do +- expect(subject).to receive(:safe_puts).with(any_args) { |message, **opts| ++ expect(subject).to receive(:safe_puts).with(any_args) { |message, opts| + expect(opts[:printer]).to eq(:print) + true + } +@@ -32,7 +32,7 @@ + end + + it "outputs using `print` if new_line is false" do +- expect(subject).to receive(:safe_puts).with(any_args) { |message, **opts| ++ expect(subject).to receive(:safe_puts).with(any_args) { |message, opts| + expect(opts[:printer]).to eq(:print) + true + } +@@ -44,7 +44,7 @@ + stdout = StringIO.new + subject.stdout = stdout + +- expect(subject).to receive(:safe_puts).with(any_args) { |message, **opts| ++ expect(subject).to receive(:safe_puts).with(any_args) { |message, opts| + expect(opts[:io]).to be(stdout) + true + } +@@ -60,7 +60,7 @@ + stderr = StringIO.new + subject.stderr = stderr + +- expect(subject).to receive(:safe_puts).with(any_args) { |message, **opts| ++ expect(subject).to receive(:safe_puts).with(any_args) { |message, opts| + expect(opts[:io]).to be(stderr) + true + } +@@ -81,7 +81,7 @@ + + context "#detail" do + it "outputs details" do +- expect(subject).to receive(:safe_puts).with(any_args) { |message, **opts| ++ expect(subject).to receive(:safe_puts).with(any_args) { |message, opts| + expect(message).to eq("foo") + true + } +@@ -104,7 +104,7 @@ + before{ Vagrant::Util::CredentialScrubber.sensitive(password) } + + it "should remove sensitive information from the output" do +- expect(subject).to receive(:safe_puts).with(any_args) do |message, **opts| ++ expect(subject).to receive(:safe_puts).with(any_args) do |message, opts| + expect(message).not_to include(password) + end + subject.detail(output) +diff --git a/vagrant.gemspec b/vagrant.gemspec +index 8aaf9cc7d9..9287a99a3e 100644 +--- a/vagrant.gemspec ++++ b/vagrant.gemspec +@@ -12,7 +12,7 @@ Gem::Specification.new do |s| + s.summary = "Build and distribute virtualized development environments." + s.description = "Vagrant is a tool for building and distributing virtualized development environments." + +- s.required_ruby_version = "~> 2.4", "< 2.7" ++ s.required_ruby_version = "~> 2.4", "< 2.8" + s.required_rubygems_version = ">= 1.3.6" + + s.add_dependency "bcrypt_pbkdf", "~> 1.0.0" + +From 203ebf59adf161826a63ecede0e6318a39f13a1a Mon Sep 17 00:00:00 2001 +From: Chris Roberts +Date: Mon, 10 Aug 2020 11:17:24 -0700 +Subject: [PATCH 2/3] Update minimum Ruby constriant to 2.5 + +--- + .github/workflows/testing.yml | 2 +- + vagrant.gemspec | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml +index 95591be6a5..68d284de78 100644 +--- a/.github/workflows/testing.yml ++++ b/.github/workflows/testing.yml +@@ -22,7 +22,7 @@ jobs: + runs-on: ubuntu-18.04 + strategy: + matrix: +- ruby: [ '2.4.x', '2.5.x', '2.6.x' ] ++ ruby: [ '2.5.x', '2.6.x', '2.7.x' ] + name: Vagrant unit tests on Ruby ${{ matrix.ruby }} + steps: + - name: Code Checkout +diff --git a/vagrant.gemspec b/vagrant.gemspec +index 9287a99a3e..f088f3adf0 100644 +--- a/vagrant.gemspec ++++ b/vagrant.gemspec +@@ -12,7 +12,7 @@ Gem::Specification.new do |s| + s.summary = "Build and distribute virtualized development environments." + s.description = "Vagrant is a tool for building and distributing virtualized development environments." + +- s.required_ruby_version = "~> 2.4", "< 2.8" ++ s.required_ruby_version = "~> 2.5", "< 2.8" + s.required_rubygems_version = ">= 1.3.6" + + s.add_dependency "bcrypt_pbkdf", "~> 1.0.0" + +From e7e956ca1244410558f74ab6c5e52838cf2106d8 Mon Sep 17 00:00:00 2001 +From: sophia +Date: Mon, 10 Aug 2020 16:32:54 -0500 +Subject: [PATCH 3/3] Fix a few deprecation warnings for ruby 2.7 + +--- + plugins/kernel_v2/config/vm.rb | 2 +- + plugins/providers/virtualbox/action/forward_ports.rb | 4 ++-- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/plugins/kernel_v2/config/vm.rb b/plugins/kernel_v2/config/vm.rb +index f6fb07c000..14dc2de808 100644 +--- a/plugins/kernel_v2/config/vm.rb ++++ b/plugins/kernel_v2/config/vm.rb +@@ -370,7 +370,7 @@ def provision(name, **options, &block) + + if Vagrant::Util::Experimental.feature_enabled?("dependency_provisioners") + opts = {before: before, after: after} +- prov = VagrantConfigProvisioner.new(name, type.to_sym, opts) ++ prov = VagrantConfigProvisioner.new(name, type.to_sym, **opts) + else + prov = VagrantConfigProvisioner.new(name, type.to_sym) + end +diff --git a/plugins/providers/virtualbox/action/forward_ports.rb b/plugins/providers/virtualbox/action/forward_ports.rb +index aac6639186..a468ae61bc 100644 +--- a/plugins/providers/virtualbox/action/forward_ports.rb ++++ b/plugins/providers/virtualbox/action/forward_ports.rb +@@ -48,7 +48,7 @@ def forward_ports + # 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] +@@ -62,7 +62,7 @@ def forward_ports + # so verify that that is the case. + if interfaces[fp.adapter][:type] != :nat + @env[:ui].detail(I18n.t("vagrant.actions.vm.forward_ports.non_nat", +- message_attributes)) ++ **message_attributes)) + next + end + diff --git a/vagrant-2.2.9-Use-test-doubles-instead-of-true.patch b/vagrant-2.2.9-Use-test-doubles-instead-of-true.patch new file mode 100644 index 0000000..a31aa27 --- /dev/null +++ b/vagrant-2.2.9-Use-test-doubles-instead-of-true.patch @@ -0,0 +1,94 @@ +From ba7ee11601b5d79278b6ca9ffe61867a21af06b9 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?V=C3=ADt=20Ondruch?= +Date: Wed, 20 Jan 2021 18:43:18 +0100 +Subject: [PATCH] Use test doubles instead of `true`. +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This solves possible issues such as: + +~~~ + 1) VagrantPlugins::DockerProvider::Provider#host_vm returns the host machine object + Failure/Error: allow(machine.env).to receive(:root_path).and_return("/.vagrant.d") + ArgumentError: + Cannot proxy frozen objects, rspec-mocks relies on proxies for method stubbing and expectations. + # ./test/unit/plugins/providers/docker/provider_test.rb:82:in `block (3 levels) in ' +~~~ + +This is not good idea, because frozen object should not receive +modifications, because these possibly can't be undone. This is +prohibited since rspec-mock 3.10.1. + +Signed-off-by: Vít Ondruch +--- + test/unit/plugins/providers/docker/provider_test.rb | 2 +- + .../plugins/provisioners/puppet/provisioner/puppet_test.rb | 4 ++-- + .../plugins/synced_folders/rsync/command/rsync_auto_test.rb | 2 +- + test/unit/vagrant/util/ssh_test.rb | 2 +- + 4 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/test/unit/plugins/providers/docker/provider_test.rb b/test/unit/plugins/providers/docker/provider_test.rb +index 3cb6e03cb..b420ba527 100644 +--- a/test/unit/plugins/providers/docker/provider_test.rb ++++ b/test/unit/plugins/providers/docker/provider_test.rb +@@ -78,7 +78,7 @@ describe VagrantPlugins::DockerProvider::Provider do + it "returns the host machine object" do + allow(machine.provider_config).to receive(:vagrant_vagrantfile).and_return("/path/to/Vagrantfile") + allow(machine.provider_config).to receive(:vagrant_machine).and_return(:default) +- allow(machine).to receive(:env).and_return(true) ++ allow(machine).to receive(:env).and_return(double()) + allow(machine.env).to receive(:root_path).and_return("/.vagrant.d") + allow(machine.env).to receive(:home_path).and_return("/path/to") + allow(machine.env).to receive(:ui_class).and_return(true) +diff --git a/test/unit/plugins/provisioners/puppet/provisioner/puppet_test.rb b/test/unit/plugins/provisioners/puppet/provisioner/puppet_test.rb +index c4ee727cc..27f5d9435 100644 +--- a/test/unit/plugins/provisioners/puppet/provisioner/puppet_test.rb ++++ b/test/unit/plugins/provisioners/puppet/provisioner/puppet_test.rb +@@ -81,7 +81,7 @@ describe VagrantPlugins::Puppet::Provisioner::Puppet do + let(:environment_paths) { ["/etc/puppet/environment"] } + + it "builds structured facts if set" do +- allow(machine).to receive(:guest).and_return(true) ++ allow(machine).to receive(:guest).and_return(double()) + allow(machine.guest).to receive(:capability?).and_return(false) + allow(config).to receive(:environment_path).and_return(environment_paths) + allow(config).to receive(:environment).and_return("production") +@@ -105,7 +105,7 @@ describe VagrantPlugins::Puppet::Provisioner::Puppet do + end + + it "does not build structured facts if not set" do +- allow(machine).to receive(:guest).and_return(true) ++ allow(machine).to receive(:guest).and_return(double()) + allow(machine.guest).to receive(:capability?).and_return(false) + allow(config).to receive(:environment_path).and_return(environment_paths) + allow(config).to receive(:environment).and_return("production") +diff --git a/test/unit/plugins/synced_folders/rsync/command/rsync_auto_test.rb b/test/unit/plugins/synced_folders/rsync/command/rsync_auto_test.rb +index 5a9c691ff..3600fbd67 100644 +--- a/test/unit/plugins/synced_folders/rsync/command/rsync_auto_test.rb ++++ b/test/unit/plugins/synced_folders/rsync/command/rsync_auto_test.rb +@@ -81,7 +81,7 @@ describe VagrantPlugins::SyncedFolderRSync::Command::RsyncAuto do + allow(machine.env).to receive(:cwd). + and_return("/Users/brian/code/vagrant-sandbox") + allow(machine.provider).to receive(:capability?).and_return(false) +- allow(machine.config).to receive(:vm).and_return(true) ++ allow(machine.config).to receive(:vm).and_return(double()) + allow(machine.config.vm).to receive(:synced_folders).and_return(config_synced_folders) + + allow(subject).to receive(:synced_folders). +diff --git a/test/unit/vagrant/util/ssh_test.rb b/test/unit/vagrant/util/ssh_test.rb +index 9f30727a0..0fc6146cf 100644 +--- a/test/unit/vagrant/util/ssh_test.rb ++++ b/test/unit/vagrant/util/ssh_test.rb +@@ -270,7 +270,7 @@ describe Vagrant::Util::SSH do + # mock out ChildProcess + process = double() + allow(ChildProcess).to receive(:build).and_return(process) +- allow(process).to receive(:io).and_return(true) ++ allow(process).to receive(:io).and_return(double()) + allow(process.io).to receive(:inherit!).and_return(true) + allow(process).to receive(:start).and_return(true) + allow(process).to receive(:wait).and_return(true) +-- +2.29.2 + diff --git a/vagrant.spec b/vagrant.spec index b7e0650..de7a9f4 100644 --- a/vagrant.spec +++ b/vagrant.spec @@ -6,7 +6,7 @@ Name: vagrant Version: 2.2.9 -Release: 4%{?dist} +Release: 5%{?dist} Summary: Build and distribute virtualized development environments License: MIT URL: http://vagrantup.com @@ -30,6 +30,12 @@ Patch1: vagrant-2.2.9-do-not-load-dependencies.patch # Use Erubi instead of Erubis. # https://github.com/hashicorp/vagrant/pull/11829 Patch2: vagrant-2.2.9-Replace-unmaintained-Erubis-by-Erubi.patch +# Fix Ruby 3.0 compatibility. +# https://github.com/hashicorp/vagrant/pull/11814 +Patch3: vagrant-2.2.10-Updates-to-address-all-Ruby-deprecations-and-warnings.patch +# Fix rspec-mocks 3.10.1+ compatibility. +# https://github.com/hashicorp/vagrant/pull/12145 +Patch4: vagrant-2.2.9-Use-test-doubles-instead-of-true.patch # The load directive is supported since RPM 4.12, i.e. F21+. The build process # fails on older Fedoras. @@ -78,6 +84,7 @@ BuildRequires: rubygem(rest-client) BuildRequires: rubygem(rubyzip) BuildRequires: rubygem(thor) BuildRequires: rubygem(webmock) +BuildRequires: rubygem(webrick) BuildRequires: rubygem(fake_ftp) BuildRequires: pkgconfig(bash-completion) %if %{with help2man} @@ -113,6 +120,8 @@ Documentation for %{name}. %patch0 -p1 %patch2 -p1 +%patch3 -p1 +%patch4 -p1 %build # TODO: package vagrant_cloud, as it is not in Fedora yet @@ -424,6 +433,9 @@ end %{vagrant_plugin_instdir}/vagrant-spec.config.example.rb %changelog +* Wed Jan 20 2021 Vít Ondruch - 2.2.9-5 +- Fix Ruby 3.0 and rspec-mock 3.10.1 compatibility. + * Mon Aug 17 2020 Vít Ondruch - 2.2.9-4 - Use Erubi instead of Erubis. From 577ea8bd22727ffdef25712340a9b346eed30a50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ondruch?= Date: Wed, 20 Jan 2021 19:07:22 +0100 Subject: [PATCH 49/83] Relax net-ssh dependency. This will ease update of `rubygem(net-ssh)` in Fedora and therefore also update to the next version of Vagrant. --- vagrant.spec | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/vagrant.spec b/vagrant.spec index de7a9f4..7424d1a 100644 --- a/vagrant.spec +++ b/vagrant.spec @@ -52,7 +52,7 @@ Requires: (rubygem(i18n) >= 1.8 with rubygem(i18n) < 2.0) Requires: rubygem(json) Requires: (rubygem(listen) >= 3.2 with rubygem(listen) < 4) Requires: rubygem(log4r) >= 1.1.9 -Requires: rubygem(net-ssh) >= 5.2.0 +Requires: (rubygem(net-ssh) >= 5.2.0 with rubygem(net-ssh) < 7) Requires: rubygem(net-scp) >= 1.2.0 Requires: rubygem(net-sftp) >= 2.1 Requires: rubygem(rest-client) >= 1.6.0 @@ -158,6 +158,13 @@ sed -i '/^\s*command(:login) do$/,/\s*end$/ s/^/#/g' plugins/commands/login/plug %gemspec_remove_dep -s %{name}.gemspec -g childprocess %gemspec_add_dep -s %{name}.gemspec -g childprocess '>= 1.0.1' +# Relax net-ssh dependency. This helps with update of net-ssh coming in with +# Vagrant 2.2.10+: +# https://github.com/hashicorp/vagrant/commit/af3053bbdfee45d1dffbb293241364fd0159ce79 +# https://github.com/hashicorp/vagrant/commit/b8e14604494f7648c17b7b42c7a469700fc1b4e3 +%gemspec_remove_dep -s %{name}.gemspec -g net-ssh '~> 5.2.0' +%gemspec_add_dep -s %{name}.gemspec -g net-ssh ['>= 5.2.0', '< 7'] + # Remove optional dependencies %gemspec_remove_dep -s %{name}.gemspec -g ed25519 %gemspec_remove_dep -s %{name}.gemspec -g bcrypt_pbkdf @@ -435,6 +442,7 @@ end %changelog * Wed Jan 20 2021 Vít Ondruch - 2.2.9-5 - Fix Ruby 3.0 and rspec-mock 3.10.1 compatibility. +- Relax net-ssh dependency. * Mon Aug 17 2020 Vít Ondruch - 2.2.9-4 - Use Erubi instead of Erubis. From 27608d84cef5efb3990798372948fb61795aa3c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ondruch?= Date: Thu, 21 Jan 2021 10:18:31 +0100 Subject: [PATCH 50/83] Relax Ruby version restriction. Resolves: rhbz#1915671 --- vagrant-2.2.9-Relax-Ruby-dependency-restriction.patch | 10 ++++++++++ vagrant.spec | 7 +++++++ 2 files changed, 17 insertions(+) create mode 100644 vagrant-2.2.9-Relax-Ruby-dependency-restriction.patch diff --git a/vagrant-2.2.9-Relax-Ruby-dependency-restriction.patch b/vagrant-2.2.9-Relax-Ruby-dependency-restriction.patch new file mode 100644 index 0000000..a167e16 --- /dev/null +++ b/vagrant-2.2.9-Relax-Ruby-dependency-restriction.patch @@ -0,0 +1,10 @@ +--- a/vagrant.gemspec ++++ b/vagrant.gemspec +@@ -12,7 +12,6 @@ + s.summary = "Build and distribute virtualized development environments." + s.description = "Vagrant is a tool for building and distributing virtualized development environments." + +- s.required_ruby_version = "~> 2.5", "< 2.8" + s.required_rubygems_version = ">= 1.3.6" + + s.add_dependency "bcrypt_pbkdf", "~> 1.0.0" diff --git a/vagrant.spec b/vagrant.spec index 7424d1a..a679299 100644 --- a/vagrant.spec +++ b/vagrant.spec @@ -36,6 +36,10 @@ Patch3: vagrant-2.2.10-Updates-to-address-all-Ruby-deprecations-and-warnings.pat # Fix rspec-mocks 3.10.1+ compatibility. # https://github.com/hashicorp/vagrant/pull/12145 Patch4: vagrant-2.2.9-Use-test-doubles-instead-of-true.patch +# Relax Ruby version restriction (use patch to make sure we don't regress +# if upstream fixes this. +# https://bugzilla.redhat.com/show_bug.cgi?id=1915671 +Patch5: vagrant-2.2.9-Relax-Ruby-dependency-restriction.patch # The load directive is supported since RPM 4.12, i.e. F21+. The build process # fails on older Fedoras. @@ -122,6 +126,7 @@ Documentation for %{name}. %patch2 -p1 %patch3 -p1 %patch4 -p1 +%patch5 -p1 %build # TODO: package vagrant_cloud, as it is not in Fedora yet @@ -443,6 +448,8 @@ end * Wed Jan 20 2021 Vít Ondruch - 2.2.9-5 - Fix Ruby 3.0 and rspec-mock 3.10.1 compatibility. - Relax net-ssh dependency. +- Relax Ruby version restriction. + Resolves: rhbz#1915671 * Mon Aug 17 2020 Vít Ondruch - 2.2.9-4 - Use Erubi instead of Erubis. From 259be2b46f7db60d0f581d5974e388b73c3d811e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ondruch?= Date: Thu, 21 Jan 2021 10:43:28 +0100 Subject: [PATCH 51/83] Do prep steps in `%prep` section. --- vagrant.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vagrant.spec b/vagrant.spec index a679299..506dedf 100644 --- a/vagrant.spec +++ b/vagrant.spec @@ -128,7 +128,6 @@ Documentation for %{name}. %patch4 -p1 %patch5 -p1 -%build # TODO: package vagrant_cloud, as it is not in Fedora yet %gemspec_remove_dep -s %{name}.gemspec -g vagrant_cloud @@ -179,6 +178,7 @@ sed -i '/^\s*command(:login) do$/,/\s*end$/ s/^/#/g' plugins/commands/login/plug sed -i '/^\s*require..vagrant.util.experimental.\s*$/ a\require "vagrant/util/map_command_options"' \ plugins/kernel_v2/config/vm.rb +%build gem build %{name}.gemspec gem install -V --local \ From 0da5407f5b8b8432f96a2ddf14894871b829ea01 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 27 Jan 2021 22:52:10 +0000 Subject: [PATCH 52/83] - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- vagrant.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vagrant.spec b/vagrant.spec index 506dedf..2eb7e48 100644 --- a/vagrant.spec +++ b/vagrant.spec @@ -6,7 +6,7 @@ Name: vagrant Version: 2.2.9 -Release: 5%{?dist} +Release: 6%{?dist} Summary: Build and distribute virtualized development environments License: MIT URL: http://vagrantup.com @@ -445,6 +445,9 @@ end %{vagrant_plugin_instdir}/vagrant-spec.config.example.rb %changelog +* Wed Jan 27 2021 Fedora Release Engineering - 2.2.9-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + * Wed Jan 20 2021 Vít Ondruch - 2.2.9-5 - Fix Ruby 3.0 and rspec-mock 3.10.1 compatibility. - Relax net-ssh dependency. From 4a3ce0bd3844aa1897e9fb27c5c0af3530a7cb30 Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Wed, 21 Oct 2020 03:24:55 +0200 Subject: [PATCH 53/83] Update to Vagrant 2.2.16. Resolves: rhbz#1872307 - Enhance .spec file. - Fix compatibility with Ruby 3.0. - Add rexml dependency, as it's no longer a default gem with Ruby 3.0. - Apply net-ssh patches apply regardless of net-ssh version. - Add bcond_with for ed25519, and also respective (Build)Requires, as the dependency is monkey-patched for vagrant use. --- .gitignore | 2 +- sources | 4 +- ...2.16-fix-compatibility-with-ruby-3.0.patch | 185 ++++++++++++++++++ ....9-Relax-Ruby-dependency-restriction.patch | 11 +- ...Replace-unmaintained-Erubis-by-Erubi.patch | 56 ------ ...2.9-Use-test-doubles-instead-of-true.patch | 94 --------- vagrant-2.2.9-do-not-load-dependencies.patch | 15 +- vagrant.spec | 87 ++++---- 8 files changed, 248 insertions(+), 206 deletions(-) create mode 100644 vagrant-2.2.16-fix-compatibility-with-ruby-3.0.patch delete mode 100644 vagrant-2.2.9-Replace-unmaintained-Erubis-by-Erubi.patch delete mode 100644 vagrant-2.2.9-Use-test-doubles-instead-of-true.patch diff --git a/.gitignore b/.gitignore index ce3853d..9789edb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ -/vagrant-*.tar.gz +/v-*.tar.gz /vagrant-spec-*.tar.gz diff --git a/sources b/sources index 33458a6..e27ee7e 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (vagrant-2.2.9.tar.gz) = 15e230bcf336615f0d49a2c40db36f7f26a9f0f6fd42d2ce801f28afc663aadded4fa373e33f9102b21ee70d98563fc68e2b24ffa6c3eec321f58b2c42b0d260 -SHA512 (vagrant-spec-abfc34474d122235d56e4c6b6fb5d3e35bedfa90.tar.gz) = cbb60d661d34b37bc5d414da0b2a31f39e2910c11251e334da5efbd8f010b5bd428bc1ae476fcb9b42ec4e8f8c6265292ba3f8f543625178ecb85aad06e8856f +SHA512 (v2.2.16.tar.gz) = cb1edf0d614e9dda252b0a99571febc05f3dc497825852167d0e80e2a59821fb52ddb91b8085646c7bdeaf6ece642c0889d1a6cb4fdcc37b9f789f86fd8c0ee9 +SHA512 (vagrant-spec-9057cd6e0ac299688da608d459deac66bfad8880.tar.gz) = 7846e910cd4b9a036d1edb22d4ead7f9180ebed60a58c10c26044879b9b5d0adab9cfe645625d9d7f2f399707c5044a36eb06fb0f9dc4e32df66910398dab65c diff --git a/vagrant-2.2.16-fix-compatibility-with-ruby-3.0.patch b/vagrant-2.2.16-fix-compatibility-with-ruby-3.0.patch new file mode 100644 index 0000000..bf30e63 --- /dev/null +++ b/vagrant-2.2.16-fix-compatibility-with-ruby-3.0.patch @@ -0,0 +1,185 @@ +From e4859e2486a3ac031a79ae62ef17bd8cbdbb86e2 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= +Date: Sun, 4 Apr 2021 22:46:45 +0200 +Subject: [PATCH] Fix shell provisioner with ruby 3.0 + +I recently updated to Fedora 34 (which uses ruby 3.0), and `vagrant up` errors out like this: + +``` +/usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/ui.rb:230:in `say': wrong number of arguments (given 4, expected 2..3) (ArgumentError) + from (eval):3:in `detail' + from (eval):9:in `detail' + from /usr/share/vagrant/gems/gems/vagrant-2.2.9/plugins/provisioners/shell/provisioner.rb:79:in `handle_comm' + from /usr/share/vagrant/gems/gems/vagrant-2.2.9/plugins/provisioners/shell/provisioner.rb:127:in `block (3 levels) in provision_ssh' + from /usr/share/vagrant/gems/gems/vagrant-2.2.9/plugins/communicators/ssh/communicator.rb:254:in `block (2 levels) in execute' + from /usr/share/vagrant/gems/gems/vagrant-2.2.9/plugins/communicators/ssh/communicator.rb:617:in `block (3 levels) in shell_execute' + from /usr/share/gems/gems/net-ssh-6.1.0/lib/net/ssh/connection/channel.rb:598:in `do_extended_data' + from /usr/share/gems/gems/net-ssh-6.1.0/lib/net/ssh/connection/session.rb:673:in `channel_extended_data' + from /usr/share/gems/gems/net-ssh-6.1.0/lib/net/ssh/connection/session.rb:548:in `dispatch_incoming_packets' + from /usr/share/gems/gems/net-ssh-6.1.0/lib/net/ssh/connection/session.rb:248:in `ev_preprocess' + from /usr/share/gems/gems/net-ssh-6.1.0/lib/net/ssh/connection/event_loop.rb:100:in `each' + from /usr/share/gems/gems/net-ssh-6.1.0/lib/net/ssh/connection/event_loop.rb:100:in `ev_preprocess' + from /usr/share/gems/gems/net-ssh-6.1.0/lib/net/ssh/connection/event_loop.rb:28:in `process' + from /usr/share/gems/gems/net-ssh-6.1.0/lib/net/ssh/connection/session.rb:227:in `process' + from /usr/share/gems/gems/net-ssh-6.1.0/lib/net/ssh/connection/session.rb:180:in `block in loop' + from /usr/share/gems/gems/net-ssh-6.1.0/lib/net/ssh/connection/session.rb:180:in `loop' + from /usr/share/gems/gems/net-ssh-6.1.0/lib/net/ssh/connection/session.rb:180:in `loop' + from /usr/share/gems/gems/net-ssh-6.1.0/lib/net/ssh/connection/channel.rb:272:in `wait' + from /usr/share/vagrant/gems/gems/vagrant-2.2.9/plugins/communicators/ssh/communicator.rb:702:in `shell_execute' + from /usr/share/vagrant/gems/gems/vagrant-2.2.9/plugins/communicators/ssh/communicator.rb:247:in `block in execute' + from /usr/share/vagrant/gems/gems/vagrant-2.2.9/plugins/communicators/ssh/communicator.rb:391:in `connect' + from /usr/share/vagrant/gems/gems/vagrant-2.2.9/plugins/communicators/ssh/communicator.rb:240:in `execute' + from /usr/share/vagrant/gems/gems/vagrant-2.2.9/plugins/provisioners/shell/provisioner.rb:122:in `block (2 levels) in provision_ssh' + from :90:in `tap' + from /usr/share/vagrant/gems/gems/vagrant-2.2.9/plugins/provisioners/shell/provisioner.rb:96:in `block in provision_ssh' + from /usr/share/vagrant/gems/gems/vagrant-2.2.9/plugins/provisioners/shell/provisioner.rb:329:in `with_script_file' + from /usr/share/vagrant/gems/gems/vagrant-2.2.9/plugins/provisioners/shell/provisioner.rb:94:in `provision_ssh' + from /usr/share/vagrant/gems/gems/vagrant-2.2.9/plugins/provisioners/shell/provisioner.rb:33:in `provision' + from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/action/builtin/provision.rb:138:in `run_provisioner' + from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/action/warden.rb:127:in `call' + from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/action/warden.rb:127:in `block in finalize_action' + from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/action/warden.rb:48:in `call' + from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/action/builder.rb:149:in `call' + from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/action/runner.rb:89:in `block in run' + from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/util/busy.rb:19:in `busy' + from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/action/runner.rb:89:in `run' + from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/environment.rb:525:in `hook' + from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/action/builtin/provision.rb:126:in `call' + from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/action/builtin/provision.rb:126:in `block in call' + from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/action/builtin/provision.rb:103:in `each' + from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/action/builtin/provision.rb:103:in `call' + from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/action/warden.rb:48:in `call' + from /usr/share/vagrant/gems/gems/vagrant-libvirt-0.1.2/lib/vagrant-libvirt/action/create_domain.rb:363:in `call' + from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/action/warden.rb:48:in `call' + from /usr/share/vagrant/gems/gems/vagrant-libvirt-0.1.2/lib/vagrant-libvirt/action/create_domain_volume.rb:89:in `call' + from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/action/warden.rb:48:in `call' + from /usr/share/vagrant/gems/gems/vagrant-libvirt-0.1.2/lib/vagrant-libvirt/action/handle_box_image.rb:124:in `call' + from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/action/warden.rb:48:in `call' + from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/action/builtin/handle_box.rb:56:in `call' + from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/action/warden.rb:48:in `call' + from /usr/share/vagrant/gems/gems/vagrant-libvirt-0.1.2/lib/vagrant-libvirt/action/handle_storage_pool.rb:57:in `call' + from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/action/warden.rb:48:in `call' + from /usr/share/vagrant/gems/gems/vagrant-libvirt-0.1.2/lib/vagrant-libvirt/action/set_name_of_domain.rb:32:in `call' + from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/action/warden.rb:48:in `call' + from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/action/warden.rb:127:in `block in finalize_action' + from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/action/warden.rb:48:in `call' + from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/action/builder.rb:149:in `call' + from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/action/runner.rb:89:in `block in run' + from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/util/busy.rb:19:in `busy' + from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/action/runner.rb:89:in `run' + from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/action/builtin/call.rb:53:in `call' +``` + +I'm not a ruby expert but I believe it's related to [this breaking change](https://www.ruby-lang.org/en/news/2019/12/12/separation-of-positional-and-keyword-arguments-in-ruby-3-0/). This change fixes it for me. +--- + plugins/provisioners/shell/provisioner.rb | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/plugins/provisioners/shell/provisioner.rb b/plugins/provisioners/shell/provisioner.rb +index 08c8cf739d3..e95f176f28b 100644 +--- a/plugins/provisioners/shell/provisioner.rb ++++ b/plugins/provisioners/shell/provisioner.rb +@@ -78,7 +78,7 @@ def handle_comm(type, data) + options = {} + options[:color] = color if !config.keep_color + +- @machine.ui.detail(data.chomp, options) ++ @machine.ui.detail(data.chomp, **options) + end + end + +From c145867fdd4fb2767f73534057a7bdb9cad3468e Mon Sep 17 00:00:00 2001 +From: Pavel Valena +Date: Fri, 7 May 2021 01:52:27 +0200 +Subject: [PATCH] Fix compatibility with Ruby 3.0 + +Currently it fails with Ruby 3.0: +``` + 1) VagrantPlugins::Kernel_V2::VagrantConfigDisk#add_provider_config normalizes +provider config + Failure/Error: subject.add_provider_config(test_provider_config) + + ArgumentError: + wrong number of arguments (given 1, expected 0) + # ./plugins/kernel_v2/config/disk.rb:88:in `add_provider_config' + # ./test/unit/plugins/kernel_v2/config/disk_test.rb:122:in `block (3 levels) +in ' + # /usr/share/gems/gems/webmock-3.12.1/lib/webmock/rspec.rb:37:in `block (2 +levels) in ' +``` +--- + test/unit/plugins/kernel_v2/config/disk_test.rb | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/test/unit/plugins/kernel_v2/config/disk_test.rb b/test/unit/plugins/kernel_v2/config/disk_test.rb +index b05d4f105fb..05e91ced6ed 100644 +--- a/test/unit/plugins/kernel_v2/config/disk_test.rb ++++ b/test/unit/plugins/kernel_v2/config/disk_test.rb +@@ -119,7 +119,7 @@ def assert_valid + describe "#add_provider_config" do + it "normalizes provider config" do + test_provider_config = {provider__something: "special" } +- subject.add_provider_config(test_provider_config) ++ subject.add_provider_config(**test_provider_config) + expect(subject.provider_config).to eq( { provider: {something: "special" }} ) + end + end +From bda7c07c02fafb2a3817982d827fc12d71daa817 Mon Sep 17 00:00:00 2001 +From: Pavel Valena +Date: Fri, 7 May 2021 01:49:31 +0200 +Subject: [PATCH] Remove unsused &block in add_provider_config. + +Also AFAIK this is not valid with Ruby 3.0. +--- + plugins/kernel_v2/config/disk.rb | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/plugins/kernel_v2/config/disk.rb b/plugins/kernel_v2/config/disk.rb +index 0062d8d354b..bd16941ff3c 100644 +--- a/plugins/kernel_v2/config/disk.rb ++++ b/plugins/kernel_v2/config/disk.rb +@@ -85,7 +85,7 @@ def initialize(type) + # Duplicates will be overriden + # + # @param [Hash] options +- def add_provider_config(**options, &block) ++ def add_provider_config(**options) + current = {} + options.each do |k,v| + opts = k.to_s.split("__") +From 3ec791d1687903f6d7a7d837b27633559f791230 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jaime=20Caama=C3=B1o=20Ruiz?= +Date: Wed, 12 May 2021 17:01:34 +0200 +Subject: [PATCH] Additional ruby 3.0 keyword argument fixes + +--- + lib/vagrant/plugin/v2/trigger.rb | 2 +- + plugins/provisioners/container/client.rb | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/lib/vagrant/plugin/v2/trigger.rb b/lib/vagrant/plugin/v2/trigger.rb +index 99d6ac05325..731b5854733 100644 +--- a/lib/vagrant/plugin/v2/trigger.rb ++++ b/lib/vagrant/plugin/v2/trigger.rb +@@ -271,7 +271,7 @@ def run(config, on_error, exit_codes) + options[:color] = :red if !config.keep_color + end + +- @ui.detail(data, options) ++ @ui.detail(data, **options) + end + if !exit_codes.include?(result.exit_code) + raise Errors::TriggersBadExitCodes, +diff --git a/plugins/provisioners/container/client.rb b/plugins/provisioners/container/client.rb +index 72a2d86ab44..db3e2c0ac94 100644 +--- a/plugins/provisioners/container/client.rb ++++ b/plugins/provisioners/container/client.rb +@@ -195,7 +195,7 @@ def handle_comm(type, data) + options = {} + #options[:color] = color if !config.keep_color + +- @machine.ui.info(data.chomp, options) ++ @machine.ui.info(data.chomp, **options) + end + end + end diff --git a/vagrant-2.2.9-Relax-Ruby-dependency-restriction.patch b/vagrant-2.2.9-Relax-Ruby-dependency-restriction.patch index a167e16..84a2923 100644 --- a/vagrant-2.2.9-Relax-Ruby-dependency-restriction.patch +++ b/vagrant-2.2.9-Relax-Ruby-dependency-restriction.patch @@ -1,10 +1,13 @@ +diff --git a/vagrant.gemspec b/vagrant.gemspec +index 1643681..7b87b63 100644 --- a/vagrant.gemspec +++ b/vagrant.gemspec -@@ -12,7 +12,6 @@ +@@ -12,7 +12,6 @@ Gem::Specification.new do |s| s.summary = "Build and distribute virtualized development environments." s.description = "Vagrant is a tool for building and distributing virtualized development environments." - + - s.required_ruby_version = "~> 2.5", "< 2.8" s.required_rubygems_version = ">= 1.3.6" - - s.add_dependency "bcrypt_pbkdf", "~> 1.0.0" + + s.add_dependency "bcrypt_pbkdf", "~> 1.1" + diff --git a/vagrant-2.2.9-Replace-unmaintained-Erubis-by-Erubi.patch b/vagrant-2.2.9-Replace-unmaintained-Erubis-by-Erubi.patch deleted file mode 100644 index 2303ec9..0000000 --- a/vagrant-2.2.9-Replace-unmaintained-Erubis-by-Erubi.patch +++ /dev/null @@ -1,56 +0,0 @@ -From 09f75eb834bfefa6643a676249b48161bbcf0cad Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?V=C3=ADt=20Ondruch?= -Date: Mon, 17 Aug 2020 14:47:19 +0200 -Subject: [PATCH] Replace unmaintained Erubis by Erubi. -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Erubis is not maintained since 2011 and it has some unfixed security -issues. Erubi is used by Ruby on Rails, so it should be much better -choice. - -Signed-off-by: Vít Ondruch ---- - lib/vagrant/util/template_renderer.rb | 4 ++-- - vagrant.gemspec | 2 +- - 2 files changed, 3 insertions(+), 3 deletions(-) - -diff --git a/lib/vagrant/util/template_renderer.rb b/lib/vagrant/util/template_renderer.rb -index 8b8e730ba..eec0b2362 100644 ---- a/lib/vagrant/util/template_renderer.rb -+++ b/lib/vagrant/util/template_renderer.rb -@@ -1,7 +1,7 @@ - require 'ostruct' - require "pathname" - --require 'erubis' -+require 'erubi' - - module Vagrant - module Util -@@ -73,7 +73,7 @@ module Vagrant - # - # @return [String] - def render_string -- Erubis::Eruby.new(template, trim: true).result(binding) -+ eval(Erubi::Engine.new(template).src) - end - - # Returns the full path to the template, taking into account the gem directory -diff --git a/vagrant.gemspec b/vagrant.gemspec -index 465b12805..6f2b726fa 100644 ---- a/vagrant.gemspec -+++ b/vagrant.gemspec -@@ -18,7 +18,7 @@ Gem::Specification.new do |s| - s.add_dependency "bcrypt_pbkdf", "~> 1.0.0" - s.add_dependency "childprocess", "~> 3.0.0" - s.add_dependency "ed25519", "~> 1.2.4" -- s.add_dependency "erubis", "~> 2.7.0" -+ s.add_dependency "erubi" - s.add_dependency "i18n", "~> 1.8" - s.add_dependency "listen", "~> 3.1.5" - s.add_dependency "hashicorp-checkpoint", "~> 0.1.5" --- -2.27.0 - diff --git a/vagrant-2.2.9-Use-test-doubles-instead-of-true.patch b/vagrant-2.2.9-Use-test-doubles-instead-of-true.patch deleted file mode 100644 index a31aa27..0000000 --- a/vagrant-2.2.9-Use-test-doubles-instead-of-true.patch +++ /dev/null @@ -1,94 +0,0 @@ -From ba7ee11601b5d79278b6ca9ffe61867a21af06b9 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?V=C3=ADt=20Ondruch?= -Date: Wed, 20 Jan 2021 18:43:18 +0100 -Subject: [PATCH] Use test doubles instead of `true`. -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -This solves possible issues such as: - -~~~ - 1) VagrantPlugins::DockerProvider::Provider#host_vm returns the host machine object - Failure/Error: allow(machine.env).to receive(:root_path).and_return("/.vagrant.d") - ArgumentError: - Cannot proxy frozen objects, rspec-mocks relies on proxies for method stubbing and expectations. - # ./test/unit/plugins/providers/docker/provider_test.rb:82:in `block (3 levels) in ' -~~~ - -This is not good idea, because frozen object should not receive -modifications, because these possibly can't be undone. This is -prohibited since rspec-mock 3.10.1. - -Signed-off-by: Vít Ondruch ---- - test/unit/plugins/providers/docker/provider_test.rb | 2 +- - .../plugins/provisioners/puppet/provisioner/puppet_test.rb | 4 ++-- - .../plugins/synced_folders/rsync/command/rsync_auto_test.rb | 2 +- - test/unit/vagrant/util/ssh_test.rb | 2 +- - 4 files changed, 5 insertions(+), 5 deletions(-) - -diff --git a/test/unit/plugins/providers/docker/provider_test.rb b/test/unit/plugins/providers/docker/provider_test.rb -index 3cb6e03cb..b420ba527 100644 ---- a/test/unit/plugins/providers/docker/provider_test.rb -+++ b/test/unit/plugins/providers/docker/provider_test.rb -@@ -78,7 +78,7 @@ describe VagrantPlugins::DockerProvider::Provider do - it "returns the host machine object" do - allow(machine.provider_config).to receive(:vagrant_vagrantfile).and_return("/path/to/Vagrantfile") - allow(machine.provider_config).to receive(:vagrant_machine).and_return(:default) -- allow(machine).to receive(:env).and_return(true) -+ allow(machine).to receive(:env).and_return(double()) - allow(machine.env).to receive(:root_path).and_return("/.vagrant.d") - allow(machine.env).to receive(:home_path).and_return("/path/to") - allow(machine.env).to receive(:ui_class).and_return(true) -diff --git a/test/unit/plugins/provisioners/puppet/provisioner/puppet_test.rb b/test/unit/plugins/provisioners/puppet/provisioner/puppet_test.rb -index c4ee727cc..27f5d9435 100644 ---- a/test/unit/plugins/provisioners/puppet/provisioner/puppet_test.rb -+++ b/test/unit/plugins/provisioners/puppet/provisioner/puppet_test.rb -@@ -81,7 +81,7 @@ describe VagrantPlugins::Puppet::Provisioner::Puppet do - let(:environment_paths) { ["/etc/puppet/environment"] } - - it "builds structured facts if set" do -- allow(machine).to receive(:guest).and_return(true) -+ allow(machine).to receive(:guest).and_return(double()) - allow(machine.guest).to receive(:capability?).and_return(false) - allow(config).to receive(:environment_path).and_return(environment_paths) - allow(config).to receive(:environment).and_return("production") -@@ -105,7 +105,7 @@ describe VagrantPlugins::Puppet::Provisioner::Puppet do - end - - it "does not build structured facts if not set" do -- allow(machine).to receive(:guest).and_return(true) -+ allow(machine).to receive(:guest).and_return(double()) - allow(machine.guest).to receive(:capability?).and_return(false) - allow(config).to receive(:environment_path).and_return(environment_paths) - allow(config).to receive(:environment).and_return("production") -diff --git a/test/unit/plugins/synced_folders/rsync/command/rsync_auto_test.rb b/test/unit/plugins/synced_folders/rsync/command/rsync_auto_test.rb -index 5a9c691ff..3600fbd67 100644 ---- a/test/unit/plugins/synced_folders/rsync/command/rsync_auto_test.rb -+++ b/test/unit/plugins/synced_folders/rsync/command/rsync_auto_test.rb -@@ -81,7 +81,7 @@ describe VagrantPlugins::SyncedFolderRSync::Command::RsyncAuto do - allow(machine.env).to receive(:cwd). - and_return("/Users/brian/code/vagrant-sandbox") - allow(machine.provider).to receive(:capability?).and_return(false) -- allow(machine.config).to receive(:vm).and_return(true) -+ allow(machine.config).to receive(:vm).and_return(double()) - allow(machine.config.vm).to receive(:synced_folders).and_return(config_synced_folders) - - allow(subject).to receive(:synced_folders). -diff --git a/test/unit/vagrant/util/ssh_test.rb b/test/unit/vagrant/util/ssh_test.rb -index 9f30727a0..0fc6146cf 100644 ---- a/test/unit/vagrant/util/ssh_test.rb -+++ b/test/unit/vagrant/util/ssh_test.rb -@@ -270,7 +270,7 @@ describe Vagrant::Util::SSH do - # mock out ChildProcess - process = double() - allow(ChildProcess).to receive(:build).and_return(process) -- allow(process).to receive(:io).and_return(true) -+ allow(process).to receive(:io).and_return(double()) - allow(process.io).to receive(:inherit!).and_return(true) - allow(process).to receive(:start).and_return(true) - allow(process).to receive(:wait).and_return(true) --- -2.29.2 - diff --git a/vagrant-2.2.9-do-not-load-dependencies.patch b/vagrant-2.2.9-do-not-load-dependencies.patch index 185d1a4..a659a42 100644 --- a/vagrant-2.2.9-do-not-load-dependencies.patch +++ b/vagrant-2.2.9-do-not-load-dependencies.patch @@ -3,15 +3,11 @@ From: Pavel Valena Date: Thu, 7 May 2020 22:40:54 +0200 Subject: [PATCH] Do not activate gems if gemspec is not found ---- - lib/vagrant/bundler.rb | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - diff --git a/lib/vagrant/bundler.rb b/lib/vagrant/bundler.rb -index 92ee53a..cf92ff7 100644 +index eb2caab..bd9f8a0 100644 --- a/lib/vagrant/bundler.rb +++ b/lib/vagrant/bundler.rb -@@ -622,14 +622,14 @@ module Vagrant +@@ -645,12 +645,10 @@ module Vagrant if !self_spec @logger.warn("Failed to locate activated vagrant specification. Activating...") self_spec = Gem::Specification.find { |s| s.name == "vagrant" } @@ -24,12 +20,5 @@ index 92ee53a..cf92ff7 100644 @logger.info("Activated vagrant specification version - #{self_spec.version}") + end end -+ if self_spec - self_spec.runtime_dependencies.each { |d| gem d.name, *d.requirement.as_list } -+ end # discover all the gems we have available list = {} - directories = [Gem::Specification.default_specifications_dir] --- -2.25.0 - diff --git a/vagrant.spec b/vagrant.spec index 2eb7e48..044c308 100644 --- a/vagrant.spec +++ b/vagrant.spec @@ -1,22 +1,23 @@ %global bashcompletion_dir %(pkg-config --variable=completionsdir bash-completion 2> /dev/null || :) -%global vagrant_spec_commit abfc34474d122235d56e4c6b6fb5d3e35bedfa90 +%global vagrant_spec_commit 9057cd6e0ac299688da608d459deac66bfad8880 %bcond_without help2man +%bcond_with ed25519 Name: vagrant -Version: 2.2.9 -Release: 6%{?dist} +Version: 2.2.16 +Release: 1%{?dist} Summary: Build and distribute virtualized development environments License: MIT URL: http://vagrantup.com -Source0: https://github.com/mitchellh/%{name}/archive/v%{version}/%{name}-%{version}.tar.gz +Source0: https://github.com/hashicorp/%{name}/archive/refs/tags/v%{version}.tar.gz # Upstream binstub with adjusted paths, the offical way how to run vagrant Source1: binstub # The library has no official release yet. But since it is just test # dependency, it should be fine to include the source right here. -# wget https://github.com/mitchellh/vagrant-spec/archive/abfc34474d122235d56e4c6b6fb5d3e35bedfa90/vagrant-spec-abfc34474d122235d56e4c6b6fb5d3e35bedfa90.tar.gz -Source2: https://github.com/mitchellh/%{name}-spec/archive/%{vagrant_spec_commit}/%{name}-spec-%{vagrant_spec_commit}.tar.gz +# wget https://github.com/mitchellh/vagrant-spec/archive/9057cd6e0ac299688da608d459deac66bfad8880/vagrant-spec-9057cd6e0ac299688da608d459deac66bfad8880.tar.gz +Source2: https://github.com/vagrant/%{name}-spec/archive/%{vagrant_spec_commit}/%{name}-spec-%{vagrant_spec_commit}.tar.gz # Monkey-patching needed for Vagrant to work until the respective patches # for RubyGems and Bundler are in place Source4: macros.vagrant @@ -27,19 +28,16 @@ Patch0: vagrant-2.2.3-Fix-fake_ftp-0.3.x-compatibility.patch # Do not load runtime dependencies in %%check if vagrant is not loaded # https://github.com/hashicorp/vagrant/pull/10945 Patch1: vagrant-2.2.9-do-not-load-dependencies.patch -# Use Erubi instead of Erubis. -# https://github.com/hashicorp/vagrant/pull/11829 -Patch2: vagrant-2.2.9-Replace-unmaintained-Erubis-by-Erubi.patch -# Fix Ruby 3.0 compatibility. -# https://github.com/hashicorp/vagrant/pull/11814 -Patch3: vagrant-2.2.10-Updates-to-address-all-Ruby-deprecations-and-warnings.patch -# Fix rspec-mocks 3.10.1+ compatibility. -# https://github.com/hashicorp/vagrant/pull/12145 -Patch4: vagrant-2.2.9-Use-test-doubles-instead-of-true.patch # Relax Ruby version restriction (use patch to make sure we don't regress # if upstream fixes this. # https://bugzilla.redhat.com/show_bug.cgi?id=1915671 Patch5: vagrant-2.2.9-Relax-Ruby-dependency-restriction.patch +# Fix shell provisioner compatibility with ruby 3.0 +# https://github.com/hashicorp/vagrant/pull/12273 +# https://github.com/hashicorp/vagrant/pull/12353 +# https://github.com/hashicorp/vagrant/pull/12352 +# https://github.com/jcaamano/vagrant/commit/3ec791d1687903f6d7a7d837b27633559f791230 +Patch6: vagrant-2.2.16-fix-compatibility-with-ruby-3.0.patch # The load directive is supported since RPM 4.12, i.e. F21+. The build process # fails on older Fedoras. @@ -66,9 +64,15 @@ Requires: curl Recommends: vagrant(vagrant-libvirt) Recommends: rubygem(bcrypt_pbkdf) -Recommends: rubygem(ed25519) Recommends: (podman-docker if podman) +%if %{with ed25519} +Requires: rubygem(ed25519) +BuildRequires: rubygem(ed25519) +%else +Recommends: rubygem(ed25519) +%endif + BuildRequires: bsdtar BuildRequires: ruby BuildRequires: rubygems-devel @@ -123,10 +127,8 @@ Documentation for %{name}. %setup -q -b2 %patch0 -p1 -%patch2 -p1 -%patch3 -p1 -%patch4 -p1 %patch5 -p1 +%patch6 -p1 # TODO: package vagrant_cloud, as it is not in Fedora yet %gemspec_remove_dep -s %{name}.gemspec -g vagrant_cloud @@ -141,6 +143,10 @@ sed -i '/^\s*command(:login) do$/,/\s*end$/ s/^/#/g' plugins/commands/login/plug %gemspec_remove_dep -s %{name}.gemspec -g net-scp '~> 1.2.0' %gemspec_add_dep -s %{name}.gemspec -g net-scp '>= 1.2.0' +# We have older version in Fedora +%gemspec_remove_dep -s %{name}.gemspec -g net-sftp '~> 3.0' +%gemspec_add_dep -s %{name}.gemspec -g net-sftp '>= 2.1.2' + # Remove Windows specific dependencies %gemspec_remove_dep -s %{name}.gemspec -g wdm %gemspec_remove_dep -s %{name}.gemspec -g winrm @@ -150,27 +156,11 @@ sed -i '/^\s*command(:login) do$/,/\s*end$/ s/^/#/g' plugins/commands/login/plug # Remove BSD dependency %gemspec_remove_dep -s %{name}.gemspec -g rb-kqueue -# Do not impose any Ruby version restrictions on Fedora. -%gemspec_remove_dep -s %{name}.gemspec -g ruby_dep - -# Allow newer listen version -# https://github.com/hashicorp/vagrant/pull/11208 -%gemspec_remove_dep -s %{name}.gemspec -g listen '~> 3.1.5' -%gemspec_add_dep -s %{name}.gemspec -g listen '>= 3.1.5' - # Allow older childprocess version %gemspec_remove_dep -s %{name}.gemspec -g childprocess %gemspec_add_dep -s %{name}.gemspec -g childprocess '>= 1.0.1' -# Relax net-ssh dependency. This helps with update of net-ssh coming in with -# Vagrant 2.2.10+: -# https://github.com/hashicorp/vagrant/commit/af3053bbdfee45d1dffbb293241364fd0159ce79 -# https://github.com/hashicorp/vagrant/commit/b8e14604494f7648c17b7b42c7a469700fc1b4e3 -%gemspec_remove_dep -s %{name}.gemspec -g net-ssh '~> 5.2.0' -%gemspec_add_dep -s %{name}.gemspec -g net-ssh ['>= 5.2.0', '< 7'] - # Remove optional dependencies -%gemspec_remove_dep -s %{name}.gemspec -g ed25519 %gemspec_remove_dep -s %{name}.gemspec -g bcrypt_pbkdf # Load missing dependency Vagrant::Util::MapCommandOptions @@ -178,6 +168,17 @@ sed -i '/^\s*command(:login) do$/,/\s*end$/ s/^/#/g' plugins/commands/login/plug sed -i '/^\s*require..vagrant.util.experimental.\s*$/ a\require "vagrant/util/map_command_options"' \ plugins/kernel_v2/config/vm.rb +# Apply net-ssh patches apply regardless of net-ssh version +sed -i 's/^if Net::SSH::Version::STRING.*$/if true/' \ + lib/vagrant/patches/net-ssh.rb + +%if %{without ed25519} +%gemspec_remove_dep -s %{name}.gemspec -g ed25519 +# Disable patch for ed25519 +sed -i '/^ require .net\/ssh\/authentication\/ed25519.$/,/^ end$/ s/^/#/' \ + lib/vagrant/patches/net-ssh.rb +%endif + %build gem build %{name}.gemspec @@ -275,7 +276,7 @@ mv test/unit/vagrant/util/env_test.rb{,.disable} # vagrant_cloud is not in Fedora yet; login command is deprecated # in favor of vagrant_cloud -rm -r test/unit/plugins/commands/{cloud,login}/ +rm -r test/unit/plugins/commands/cloud/ # fake_ftp 0.3.0 compatibility. # https://github.com/livinginthepast/fake_ftp/pull/56 @@ -301,6 +302,16 @@ rm -rf test/unit/plugins/hosts/bsd sed -i '/^\s*it "installs docker if not present" do$/ a\ skip "GH#11606"' \ test/unit/plugins/provisioners/docker/installer_test.rb +# Disable tests failing on class variable access from toplevel +# > Failure/Error: @@logger = nil +# https://github.com/hashicorp/vagrant/issues/12362 +mv test/unit/plugins/synced_folders/unix_mount_helpers_test.rb{,.disable} + +# Disable currently broken powershell tests, due to: +# https://github.com/hashicorp/vagrant/commit/5967a23fa097e89726d335dcf781ae43cb256bc1# +# https://github.com/hashicorp/vagrant/issues/12363 +mv test/unit/vagrant/util/powershell_test.rb{,.disable} + # Export the OS as an environment variable that Vagrant can access, so the # test suite is executed with same host it will be run (also avoids docker # installer_test issue). @@ -445,6 +456,10 @@ end %{vagrant_plugin_instdir}/vagrant-spec.config.example.rb %changelog +* Fri Apr 16 2021 Pavel Valena - 2.2.16-1 +- Update to Vagrant 2.2.16. + Resolves: rhbz#1872307 + * Wed Jan 27 2021 Fedora Release Engineering - 2.2.9-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild From 01bc73e434a8d8ae3d2cad37613dc94712bc8537 Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Thu, 6 May 2021 23:50:38 +0200 Subject: [PATCH 54/83] Fix: new RPM compatibility https://github.com/rpm-software-management/rpm/issues/1669 --- vagrant.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vagrant.spec b/vagrant.spec index 044c308..af1562d 100644 --- a/vagrant.spec +++ b/vagrant.spec @@ -41,7 +41,7 @@ Patch6: vagrant-2.2.16-fix-compatibility-with-ruby-3.0.patch # The load directive is supported since RPM 4.12, i.e. F21+. The build process # fails on older Fedoras. -%{?load:%{SOURCE4}} +%{load:%{SOURCE4}} Requires: ruby(release) Requires: ruby(rubygems) >= 1.3.6 From 499a8974a9c524e61fa44cd5dae171b62f4ba86c Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Fri, 7 May 2021 01:43:53 +0200 Subject: [PATCH 55/83] Temporarily disable 6 tests due to older childprocess, and unknown test suite error. --- vagrant.spec | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/vagrant.spec b/vagrant.spec index af1562d..926a186 100644 --- a/vagrant.spec +++ b/vagrant.spec @@ -336,7 +336,39 @@ done export RUBYOPT # Rake solves the requires issues for tests -rake -f tasks/test.rake test:unit +rake -f tasks/test.rake test:unit \ + | tee error.log + +# Additional failures (3) +# > Cannot proxy frozen objects, rspec-mocks relies on proxies for method... +# https://github.com/hashicorp/vagrant/issues/12365 +# +# Temporarily disable (3) tests failing on older childprocess +# 4) Vagrant::Util::Subprocess#running? should return false when subprocess has completed +# Failure/Error: expect(sp.running?).to be(false) +# expected false +# got true +# # ./test/unit/vagrant/util/subprocess_test.rb:123:in `block (4 levels) in ' +# # ./test/unit/vagrant/util/subprocess_test.rb:120:in `each' +# # ./test/unit/vagrant/util/subprocess_test.rb:120:in `block (3 levels) in ' +# # /usr/share/gems/gems/webmock-3.11.1/lib/webmock/rspec.rb:37:in `block (2 levels) in ' +# 5) Vagrant::Util::Subprocess#stop when subprocess has already completed should return false +# Failure/Error: expect(sp.stop).to be(false) +# expected false +# got true +# # ./test/unit/vagrant/util/subprocess_test.rb:152:in `block (5 levels) in ' +# # ./test/unit/vagrant/util/subprocess_test.rb:149:in `each' +# # ./test/unit/vagrant/util/subprocess_test.rb:149:in `block (4 levels) in ' +# # /usr/share/gems/gems/webmock-3.11.1/lib/webmock/rspec.rb:37:in `block (2 levels) in ' +# 6) Vagrant::Util::Subprocess#stop when subprocess is running should stop the process +# Failure/Error: expect(sp.running?).to be(false) +# expected false +# got true +# # ./test/unit/vagrant/util/subprocess_test.rb:172:in `block (5 levels) in ' +# # ./test/unit/vagrant/util/subprocess_test.rb:168:in `each' +# # ./test/unit/vagrant/util/subprocess_test.rb:168:in `block (4 levels) in ' +# # /usr/share/gems/gems/webmock-3.11.1/lib/webmock/rspec.rb:37:in `block (2 levels) in ' +grep ', 6 failures, ' error.log || exit 1 %if %{with help2man} # Check `--help` output, using which man page is created From f5db5d840fd414f36127d2eefa9680012e3b96d9 Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Thu, 13 May 2021 00:57:29 +0200 Subject: [PATCH 56/83] Fixup .gitignore file. --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 9789edb..7d64fe2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ -/v-*.tar.gz +/v*.tar.gz /vagrant-spec-*.tar.gz From e282d9ac91bd9f232e31464a088b64d883728d12 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 23 Jul 2021 20:15:41 +0000 Subject: [PATCH 57/83] - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- vagrant.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vagrant.spec b/vagrant.spec index 926a186..0340db3 100644 --- a/vagrant.spec +++ b/vagrant.spec @@ -7,7 +7,7 @@ Name: vagrant Version: 2.2.16 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Build and distribute virtualized development environments License: MIT URL: http://vagrantup.com @@ -488,6 +488,9 @@ end %{vagrant_plugin_instdir}/vagrant-spec.config.example.rb %changelog +* Fri Jul 23 2021 Fedora Release Engineering +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + * Fri Apr 16 2021 Pavel Valena - 2.2.16-1 - Update to Vagrant 2.2.16. Resolves: rhbz#1872307 From 05d7a608b706fb65468c507525f649091f28c1e2 Mon Sep 17 00:00:00 2001 From: Philipp Trulson Date: Wed, 27 Oct 2021 00:53:10 +0200 Subject: [PATCH 58/83] Upgrade to Vagrant 2.2.19 Resolves: rhbz#1980195 --- sources | 4 +- ...s-all-Ruby-deprecations-and-warnings.patch | 1384 ----------------- ...2.16-fix-compatibility-with-ruby-3.0.patch | 185 --- ....9-Relax-Ruby-dependency-restriction.patch | 13 - vagrant.spec | 44 +- 5 files changed, 20 insertions(+), 1610 deletions(-) delete mode 100644 vagrant-2.2.10-Updates-to-address-all-Ruby-deprecations-and-warnings.patch delete mode 100644 vagrant-2.2.16-fix-compatibility-with-ruby-3.0.patch delete mode 100644 vagrant-2.2.9-Relax-Ruby-dependency-restriction.patch diff --git a/sources b/sources index e27ee7e..0973e45 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (v2.2.16.tar.gz) = cb1edf0d614e9dda252b0a99571febc05f3dc497825852167d0e80e2a59821fb52ddb91b8085646c7bdeaf6ece642c0889d1a6cb4fdcc37b9f789f86fd8c0ee9 -SHA512 (vagrant-spec-9057cd6e0ac299688da608d459deac66bfad8880.tar.gz) = 7846e910cd4b9a036d1edb22d4ead7f9180ebed60a58c10c26044879b9b5d0adab9cfe645625d9d7f2f399707c5044a36eb06fb0f9dc4e32df66910398dab65c +SHA512 (v2.2.19.tar.gz) = 24a2e5baeac5cf8c45c012cf70dd4132b1dc7a6a5bab19d1046c91cc88e669356e2e5676d96eda6ed7293ff19ada974954969a4a59b9e4a30e2d95de27fa64e4 +SHA512 (vagrant-spec-03d88fe2467716b072951c2b55d78223130851a6.tar.gz) = 3b062cbec04f98355f939c2bf27d35ddcd2bbe0a0734677832d4a656320b44c64b6284e0877dd55e496055e2b969755e1bdc78225010f75ddaafe8f8c8f78a66 diff --git a/vagrant-2.2.10-Updates-to-address-all-Ruby-deprecations-and-warnings.patch b/vagrant-2.2.10-Updates-to-address-all-Ruby-deprecations-and-warnings.patch deleted file mode 100644 index c65382f..0000000 --- a/vagrant-2.2.10-Updates-to-address-all-Ruby-deprecations-and-warnings.patch +++ /dev/null @@ -1,1384 +0,0 @@ -From 5003bb6e150dd7f812969acfd45aac3b92ce5cae Mon Sep 17 00:00:00 2001 -From: Chris Roberts -Date: Mon, 10 Aug 2020 11:11:30 -0700 -Subject: [PATCH 1/3] Updates to address all Ruby deprecations and warnings - -This includes updates for resolving all warnings provided by Ruby -for deprecations and/or removed methods. It also enables support -for Ruby 2.7 in the specification constraint as all 2.7 related -warnings are resolved with this changeset. ---- - lib/vagrant/action/builder.rb | 62 ++++++++--- - lib/vagrant/action/builtin/box_add.rb | 11 +- - .../action/builtin/mixin_synced_folders.rb | 2 +- - lib/vagrant/action/hook.rb | 83 +++++++++----- - lib/vagrant/action/warden.rb | 30 +++++- - lib/vagrant/box.rb | 9 +- - lib/vagrant/bundler.rb | 7 +- - lib/vagrant/errors.rb | 2 +- - lib/vagrant/machine_index.rb | 2 +- - lib/vagrant/ui.rb | 2 +- - lib/vagrant/util/downloader.rb | 5 +- - plugins/communicators/winssh/communicator.rb | 2 +- - plugins/kernel_v2/config/vm.rb | 2 +- - .../plugins/commands/box/command/add_test.rb | 4 +- - .../commands/box/command/outdated_test.rb | 2 +- - .../communicators/ssh/communicator_test.rb | 2 +- - .../windows/cap/change_host_name_test.rb | 4 +- - .../providers/docker/driver_compose_test.rb | 4 +- - .../virtualbox/action/network_test.rb | 14 +-- - .../chef/config/chef_apply_test.rb | 2 +- - test/unit/vagrant/action/builder_test.rb | 26 ++--- - .../vagrant/action/builtin/box_add_test.rb | 46 ++++---- - test/unit/vagrant/action/hook_test.rb | 102 ++++++++++++------ - test/unit/vagrant/plugin/manager_test.rb | 4 +- - test/unit/vagrant/ui_test.rb | 14 +-- - vagrant.gemspec | 2 +- - 26 files changed, 286 insertions(+), 159 deletions(-) - -diff --git a/lib/vagrant/action/builder.rb b/lib/vagrant/action/builder.rb -index 074d512b12..7e25d185b8 100644 ---- a/lib/vagrant/action/builder.rb -+++ b/lib/vagrant/action/builder.rb -@@ -17,6 +17,11 @@ module Action - # Vagrant::Action.run(app) - # - class Builder -+ # Container for Action arguments -+ MiddlewareArguments = Struct.new(:parameters, :block, :keywords, keyword_init: true) -+ # Item within the stack -+ StackItem = Struct.new(:middleware, :arguments, keyword_init: true) -+ - # This is the stack of middlewares added. This should NOT be used - # directly. - # -@@ -28,8 +33,8 @@ class Builder - # see {#use} instead. - # - # @return [Builder] -- def self.build(middleware, *args, &block) -- new.use(middleware, *args, &block) -+ def self.build(middleware, *args, **keywords, &block) -+ new.use(middleware, *args, **keywords, &block) - end - - def initialize -@@ -58,12 +63,21 @@ def flatten - # of the middleware. - # - # @param [Class] middleware The middleware class -- def use(middleware, *args, &block) -+ def use(middleware, *args, **keywords, &block) -+ item = StackItem.new( -+ middleware: middleware, -+ arguments: MiddlewareArguments.new( -+ parameters: args, -+ keywords: keywords, -+ block: block -+ ) -+ ) -+ - if middleware.kind_of?(Builder) - # Merge in the other builder's stack into our own - self.stack.concat(middleware.stack) - else -- self.stack << [middleware, args, block] -+ self.stack << item - end - - self -@@ -71,8 +85,22 @@ def use(middleware, *args, &block) - - # Inserts a middleware at the given index or directly before the - # given middleware object. -- def insert(index, middleware, *args, &block) -- index = self.index(index) unless index.is_a?(Integer) -+ def insert(idx_or_item, middleware, *args, **keywords, &block) -+ item = StackItem.new( -+ middleware: middleware, -+ arguments: MiddlewareArguments.new( -+ parameters: args, -+ keywords: keywords, -+ block: block -+ ) -+ ) -+ -+ if idx_or_item.is_a?(Integer) -+ index = idx_or_item -+ else -+ index = self.index(idx_or_item) -+ end -+ - raise "no such middleware to insert before: #{index.inspect}" unless index - - if middleware.kind_of?(Builder) -@@ -80,27 +108,32 @@ def insert(index, middleware, *args, &block) - stack.insert(index, stack_item) - end - else -- stack.insert(index, [middleware, args, block]) -+ stack.insert(index, item) - end - end - - alias_method :insert_before, :insert - - # Inserts a middleware after the given index or middleware object. -- def insert_after(index, middleware, *args, &block) -- index = self.index(index) unless index.is_a?(Integer) -+ def insert_after(idx_or_item, middleware, *args, **keywords, &block) -+ if idx_or_item.is_a?(Integer) -+ index = idx_or_item -+ else -+ index = self.index(idx_or_item) -+ end -+ - raise "no such middleware to insert after: #{index.inspect}" unless index - insert(index + 1, middleware, *args, &block) - end - - # Replaces the given middlware object or index with the new - # middleware. -- def replace(index, middleware, *args, &block) -+ def replace(index, middleware, *args, **keywords, &block) - if index.is_a?(Integer) - delete(index) -- insert(index, middleware, *args, &block) -+ insert(index, middleware, *args, **keywords, &block) - else -- insert_before(index, middleware, *args, &block) -+ insert_before(index, middleware, *args, **keywords, &block) - delete(index) - end - end -@@ -123,8 +156,9 @@ def call(env) - def index(object) - stack.each_with_index do |item, i| - return i if item == object -- return i if item[0] == object -- return i if item[0].respond_to?(:name) && item[0].name == object -+ return i if item.middleware == object -+ return i if item.middleware.respond_to?(:name) && -+ item.middleware.name == object - end - - nil -diff --git a/lib/vagrant/action/builtin/box_add.rb b/lib/vagrant/action/builtin/box_add.rb -index dac1fefa52..a635d77cec 100644 ---- a/lib/vagrant/action/builtin/box_add.rb -+++ b/lib/vagrant/action/builtin/box_add.rb -@@ -25,6 +25,7 @@ class BoxAdd - def initialize(app, env) - @app = app - @logger = Log4r::Logger.new("vagrant::action::builtin::box_add") -+ @parser = URI::RFC2396_Parser.new - end - - def call(env) -@@ -44,7 +45,7 @@ def call(env) - 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:///#{@parser.escape(u)}" - end - - if u =~ /^[a-z0-9]+:.*$/i && !u.start_with?("file://") -@@ -53,9 +54,9 @@ def call(env) - end - - # Expand the path and try to use that, if possible -- p = File.expand_path(URI.unescape(u.gsub(/^file:\/\//, ""))) -+ p = File.expand_path(@parser.unescape(u.gsub(/^file:\/\//, ""))) - p = Util::Platform.cygwin_windows_path(p) -- next "file://#{URI.escape(p.gsub("\\", "/"))}" if File.file?(p) -+ next "file://#{@parser.escape(p.gsub("\\", "/"))}" if File.file?(p) - - u - end -@@ -434,7 +435,7 @@ def downloader(url, env, **opts) - downloader_options[:ui] = env[:ui] if opts[:ui] - downloader_options[:location_trusted] = env[:box_download_location_trusted] - downloader_options[:box_extra_download_options] = env[:box_extra_download_options] -- -+ - Util::Downloader.new(url, temp_path, downloader_options) - end - -@@ -495,7 +496,7 @@ def metadata_url?(url, env) - 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 = @parser.unescape(url) - - begin - File.open(url, "r") do |f| -diff --git a/lib/vagrant/action/builtin/mixin_synced_folders.rb b/lib/vagrant/action/builtin/mixin_synced_folders.rb -index c2d8aabb5a..1209f5d690 100644 ---- a/lib/vagrant/action/builtin/mixin_synced_folders.rb -+++ b/lib/vagrant/action/builtin/mixin_synced_folders.rb -@@ -72,7 +72,7 @@ def plugins - # - # @param [Machine] machine The machine that the folders belong to - # @param [Hash] folders The result from a {#synced_folders} call. -- def save_synced_folders(machine, folders, **opts) -+ def save_synced_folders(machine, folders, opts={}) - if opts[:merge] - existing = cached_synced_folders(machine) - if existing -diff --git a/lib/vagrant/action/hook.rb b/lib/vagrant/action/hook.rb -index 3ab3080859..7270e6a33f 100644 ---- a/lib/vagrant/action/hook.rb -+++ b/lib/vagrant/action/hook.rb -@@ -7,23 +7,23 @@ class Hook - # This is a hash of the middleware to prepend to a certain - # other middleware. - # -- # @return [Hash>] -+ # @return [Hash>] - attr_reader :before_hooks - - # This is a hash of the middleware to append to a certain other - # middleware. - # -- # @return [Hash>] -+ # @return [Hash>] - attr_reader :after_hooks - - # This is a list of the hooks to just prepend to the beginning - # -- # @return [Array] -+ # @return [Array] - attr_reader :prepend_hooks - - # This is a list of the hooks to just append to the end - # -- # @return [Array] -+ # @return [Array] - attr_reader :append_hooks - - def initialize -@@ -37,16 +37,32 @@ def initialize - # - # @param [Class] existing The existing middleware. - # @param [Class] new The new middleware. -- def before(existing, new, *args, &block) -- @before_hooks[existing] << [new, args, block] -+ def before(existing, new, *args, **keywords, &block) -+ item = Builder::StackItem.new( -+ middleware: new, -+ arguments: Builder::MiddlewareArguments.new( -+ parameters: args, -+ keywords: keywords, -+ block: block -+ ) -+ ) -+ @before_hooks[existing] << item - end - - # Add a middleware after an existing middleware. - # - # @param [Class] existing The existing middleware. - # @param [Class] new The new middleware. -- def after(existing, new, *args, &block) -- @after_hooks[existing] << [new, args, block] -+ def after(existing, new, *args, **keywords, &block) -+ item = Builder::StackItem.new( -+ middleware: new, -+ arguments: Builder::MiddlewareArguments.new( -+ parameters: args, -+ keywords: keywords, -+ block: block -+ ) -+ ) -+ @after_hooks[existing] << item - end - - # Append a middleware to the end of the stack. Note that if the -@@ -54,15 +70,31 @@ def after(existing, new, *args, &block) - # be run. - # - # @param [Class] new The middleware to append. -- def append(new, *args, &block) -- @append_hooks << [new, args, block] -+ def append(new, *args, **keywords, &block) -+ item = Builder::StackItem.new( -+ middleware: new, -+ arguments: Builder::MiddlewareArguments.new( -+ parameters: args, -+ keywords: keywords, -+ block: block -+ ) -+ ) -+ @append_hooks << item - end - - # Prepend a middleware to the beginning of the stack. - # - # @param [Class] new The new middleware to prepend. -- def prepend(new, *args, &block) -- @prepend_hooks << [new, args, block] -+ def prepend(new, *args, **keywords, &block) -+ item = Builder::StackItem.new( -+ middleware: new, -+ arguments: Builder::MiddlewareArguments.new( -+ parameters: args, -+ keywords: keywords, -+ block: block -+ ) -+ ) -+ @prepend_hooks << item - end - - # @return [Boolean] -@@ -77,27 +109,28 @@ def empty? - # called directly. - # - # @param [Builder] builder -- def apply(builder, options=nil) -- options ||= {} -- -+ def apply(builder, options={}) - if !options[:no_prepend_or_append] - # Prepends first -- @prepend_hooks.each do |klass, args, block| -+ @prepend_hooks.each do |item| - if options[:root] - idx = builder.index(options[:root]) - else - idx = 0 - end -- builder.insert(idx, klass, *args, &block) -+ builder.insert(idx, item.middleware, *item.arguments.parameters, -+ **item.arguments.keywords, &item.arguments.block) - end - - # Appends -- @append_hooks.each do |klass, args, block| -+ @append_hooks.each do |item| - if options[:root] - idx = builder.index(options[:root]) -- builder.insert(idx + 1, klass, *args, &block) -+ builder.insert(idx + 1, item.middleware, *item.arguments.parameters, -+ **item.arguments.keywords, &item.arguments.block) - else -- builder.use(klass, *args, &block) -+ builder.use(item.middleware, *item.arguments.parameters, -+ **item.arguments.keywords, &item.arguments.block) - end - end - end -@@ -106,8 +139,9 @@ def apply(builder, options=nil) - @before_hooks.each do |key, list| - next if !builder.index(key) - -- list.each do |klass, args, block| -- builder.insert_before(key, klass, *args, &block) -+ list.each do |item| -+ builder.insert_before(key, item.middleware, *item.arguments.parameters, -+ **item.arguments.keywords, &item.arguments.block) - end - end - -@@ -115,8 +149,9 @@ def apply(builder, options=nil) - @after_hooks.each do |key, list| - next if !builder.index(key) - -- list.each do |klass, args, block| -- builder.insert_after(key, klass, *args, &block) -+ list.each do |item| -+ builder.insert_after(key, item.middleware, *item.arguments.parameters, -+ **item.arguments.keywords, &item.arguments.block) - end - end - end -diff --git a/lib/vagrant/action/warden.rb b/lib/vagrant/action/warden.rb -index 828e317fcc..931ce87fc8 100644 ---- a/lib/vagrant/action/warden.rb -+++ b/lib/vagrant/action/warden.rb -@@ -92,14 +92,34 @@ def recover(env) - # A somewhat confusing function which simply initializes each - # middleware properly to call the next middleware in the sequence. - def finalize_action(action, env) -- klass, args, block = action -+ if action.is_a?(Builder::StackItem) -+ klass = action.middleware -+ args = action.arguments.parameters -+ keywords = action.arguments.keywords -+ block = action.arguments.block -+ else -+ klass = action -+ args = [] -+ keywords = {} -+ end - -- # Default the arguments to an empty array. Otherwise in Ruby 1.8 -- # a `nil` args will actually pass `nil` into the class. -- args ||= [] -+ args = nil if args.empty? -+ keywords = nil if keywords.empty? - - if klass.is_a?(Class) -- klass.new(self, env, *args, &block) -+ # NOTE: We need to detect if we are passing args and/or -+ # keywords and do it explicitly. Earlier versions -+ # are not as lax about splatting keywords when the -+ # target method is not expecting them. -+ if args && keywords -+ klass.new(self, env, *args, **keywords, &block) -+ elsif args -+ klass.new(self, env, *args, &block) -+ elsif keywords -+ klass.new(self, env, **keywords, &block) -+ else -+ klass.new(self, env, &block) -+ end - elsif klass.respond_to?(:call) - # Make it a lambda which calls the item then forwards - # up the chain -diff --git a/lib/vagrant/box.rb b/lib/vagrant/box.rb -index 2f12775f5e..0ee5d29f39 100644 ---- a/lib/vagrant/box.rb -+++ b/lib/vagrant/box.rb -@@ -57,12 +57,13 @@ class Box - # @param [Symbol] provider The provider that this box implements. - # @param [Pathname] directory The directory where this box exists on - # disk. -- def initialize(name, provider, version, directory, **opts) -+ # @param [String] metadata_url Metadata URL for box -+ def initialize(name, provider, version, directory, metadata_url: nil) - @name = name - @version = version - @provider = provider - @directory = directory -- @metadata_url = opts[:metadata_url] -+ @metadata_url = metadata_url - - metadata_file = directory.join("metadata.json") - raise Errors::BoxMetadataFileNotFound, name: @name if !metadata_file.file? -@@ -120,7 +121,7 @@ def in_use?(index) - # - # @param [Hash] download_options Options to pass to the downloader. - # @return [BoxMetadata] -- def load_metadata(**download_options) -+ def load_metadata(download_options={}) - tf = Tempfile.new("vagrant-load-metadata") - tf.close - -@@ -132,7 +133,7 @@ def load_metadata(**download_options) - end - - opts = { headers: ["Accept: application/json"] }.merge(download_options) -- Util::Downloader.new(url, tf.path, **opts).download! -+ Util::Downloader.new(url, tf.path, opts).download! - BoxMetadata.new(File.open(tf.path, "r")) - rescue Errors::DownloaderError => e - raise Errors::BoxMetadataDownloadError, -diff --git a/lib/vagrant/bundler.rb b/lib/vagrant/bundler.rb -index f4d2a02396..336ac1e057 100644 ---- a/lib/vagrant/bundler.rb -+++ b/lib/vagrant/bundler.rb -@@ -632,7 +632,12 @@ def vagrant_internal_specs - self_spec.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] -+ if Gem.respond_to?(:default_specifications_dir) -+ spec_dir = Gem.default_specifications_dir -+ else -+ spec_dir = Gem::Specification.default_specifications_dir -+ end -+ directories = [spec_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 e41c0f72eb..782615bc45 100644 ---- a/lib/vagrant/errors.rb -+++ b/lib/vagrant/errors.rb -@@ -100,7 +100,7 @@ def status_code; 1; end - - 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/machine_index.rb b/lib/vagrant/machine_index.rb -index eec0062923..802f6dfa73 100644 ---- a/lib/vagrant/machine_index.rb -+++ b/lib/vagrant/machine_index.rb -@@ -452,7 +452,7 @@ def valid?(home_path) - # Creates a {Vagrant::Environment} for this entry. - # - # @return [Vagrant::Environment] -- def vagrant_env(home_path, **opts) -+ def vagrant_env(home_path, opts={}) - Vagrant::Util::SilenceWarnings.silence! do - Environment.new({ - cwd: @vagrantfile_path, -diff --git a/lib/vagrant/ui.rb b/lib/vagrant/ui.rb -index a521fd105a..b1a80a49f5 100644 ---- a/lib/vagrant/ui.rb -+++ b/lib/vagrant/ui.rb -@@ -227,7 +227,7 @@ def clear_line - - # This method handles actually outputting a message of a given type - # to the console. -- def say(type, message, **opts) -+ def say(type, message, opts={}) - defaults = { new_line: true, prefix: true } - opts = defaults.merge(@opts).merge(opts) - -diff --git a/lib/vagrant/util/downloader.rb b/lib/vagrant/util/downloader.rb -index 26c0d7067e..bf966ecafe 100644 ---- a/lib/vagrant/util/downloader.rb -+++ b/lib/vagrant/util/downloader.rb -@@ -1,3 +1,4 @@ -+require "cgi" - require "uri" - - require "log4r" -@@ -42,8 +43,8 @@ def initialize(source, destination, options=nil) - 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/communicators/winssh/communicator.rb b/plugins/communicators/winssh/communicator.rb -index 1239049d21..3ea012f618 100644 ---- a/plugins/communicators/winssh/communicator.rb -+++ b/plugins/communicators/winssh/communicator.rb -@@ -217,7 +217,7 @@ def sftp_connect - # The WinSSH communicator connection provides isolated modification - # to the generated connection instances. This modification forces - # all provided commands to run within powershell -- def connect(*args) -+ def connect(**opts) - connection = nil - super { |c| connection = c } - -diff --git a/plugins/kernel_v2/config/vm.rb b/plugins/kernel_v2/config/vm.rb -index acc6df6a6b..f6fb07c000 100644 ---- a/plugins/kernel_v2/config/vm.rb -+++ b/plugins/kernel_v2/config/vm.rb -@@ -380,7 +380,7 @@ def provision(name, **options, &block) - 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 - -@@ -435,7 +435,7 @@ def disk(type, **options, &block) - disk_config.set_options(options) - - # Add provider config -- disk_config.add_provider_config(provider_options, &block) -+ disk_config.add_provider_config(**provider_options, &block) - - if !Vagrant::Util::Experimental.feature_enabled?("disks") - @logger.warn("Disk config defined, but experimental feature is not enabled. To use this feature, enable it with the experimental flag `disks`. Disk will not be added to internal config, and will be ignored.") -diff --git a/test/unit/plugins/commands/box/command/add_test.rb b/test/unit/plugins/commands/box/command/add_test.rb -index 77cf7d1acd..ea3c5f3317 100644 ---- a/test/unit/plugins/commands/box/command/add_test.rb -+++ b/test/unit/plugins/commands/box/command/add_test.rb -@@ -32,7 +32,7 @@ - let(:argv) { ["foo"] } - - it "executes the runner with the proper actions" do -- expect(action_runner).to receive(:run).with(any_args) { |action, **opts| -+ expect(action_runner).to receive(:run).with(any_args) { |action, opts| - expect(opts[:box_name]).to be_nil - expect(opts[:box_url]).to eq("foo") - true -@@ -46,7 +46,7 @@ - let(:argv) { ["foo", "bar"] } - - it "executes the runner with the proper actions" do -- expect(action_runner).to receive(:run).with(any_args) { |action, **opts| -+ expect(action_runner).to receive(:run).with(any_args) { |action, opts| - expect(opts[:box_name]).to eq("foo") - expect(opts[:box_url]).to eq("bar") - true -diff --git a/test/unit/plugins/commands/box/command/outdated_test.rb b/test/unit/plugins/commands/box/command/outdated_test.rb -index c395171aaa..6b52614cdc 100644 ---- a/test/unit/plugins/commands/box/command/outdated_test.rb -+++ b/test/unit/plugins/commands/box/command/outdated_test.rb -@@ -24,7 +24,7 @@ - let(:argv) { ["--force"] } - - it "passes along the force update option" do -- expect(action_runner).to receive(:run).with(any_args) { |action, **opts| -+ expect(action_runner).to receive(:run).with(any_args) { |action, opts| - expect(opts[:box_outdated_force]).to be_truthy - true - } -diff --git a/test/unit/plugins/communicators/ssh/communicator_test.rb b/test/unit/plugins/communicators/ssh/communicator_test.rb -index 3686fa6a04..f04ddf673b 100644 ---- a/test/unit/plugins/communicators/ssh/communicator_test.rb -+++ b/test/unit/plugins/communicators/ssh/communicator_test.rb -@@ -120,7 +120,7 @@ - context "when printing message to the user" do - before do - allow(machine).to receive(:ssh_info). -- and_return(host: '10.1.2.3', port: 22).ordered -+ and_return(host: '10.1.2.3', port: 22) - allow(communicator).to receive(:connect) - allow(communicator).to receive(:ready?).and_return(true) - end -diff --git a/test/unit/plugins/guests/windows/cap/change_host_name_test.rb b/test/unit/plugins/guests/windows/cap/change_host_name_test.rb -index a75412ae22..07ef98461d 100644 ---- a/test/unit/plugins/guests/windows/cap/change_host_name_test.rb -+++ b/test/unit/plugins/guests/windows/cap/change_host_name_test.rb -@@ -6,7 +6,8 @@ - let(:described_class) do - VagrantPlugins::GuestWindows::Plugin.components.guest_capabilities[:windows].get(:change_host_name) - end -- let(:machine) { double("machine") } -+ let(:machine) { double("machine", guest: guest) } -+ let(:guest) { double("guest") } - let(:communicator) { VagrantTests::DummyCommunicator::Communicator.new(machine) } - - before do -@@ -34,7 +35,6 @@ - 'if (!([System.Net.Dns]::GetHostName() -eq \'newhostname\')) { exit 0 } exit 1', - exit_code: 0) - communicator.stub_command(rename_script, exit_code: 0) -- allow(machine).to receive(:guest) - allow(machine.guest).to receive(:capability) - allow(machine.guest).to receive(:capability?) - described_class.change_host_name_and_wait(machine, 'newhostname', 0) -diff --git a/test/unit/plugins/providers/docker/driver_compose_test.rb b/test/unit/plugins/providers/docker/driver_compose_test.rb -index 9606de5ddb..d8b3006cab 100644 ---- a/test/unit/plugins/providers/docker/driver_compose_test.rb -+++ b/test/unit/plugins/providers/docker/driver_compose_test.rb -@@ -32,7 +32,7 @@ - end - let(:data_directory){ double("data-directory", join: composition_path) } - let(:local_data_path){ double("local-data-path") } -- let(:compose_execute_up){ ["docker-compose", "-f", "docker-compose.yml", "-p", "cwd", "up", "--remove-orphans", "-d", {}] } -+ let(:compose_execute_up){ ["docker-compose", "-f", "docker-compose.yml", "-p", "cwd", "up", "--remove-orphans", "-d", any_args] } - - - subject{ described_class.new(machine) } -@@ -277,7 +277,7 @@ - before { allow(subject).to receive(:created?).and_return(true) } - - it 'removes the container' do -- expect(subject).to receive(:execute).with("docker-compose", "-f", "docker-compose.yml", "-p", "cwd", "rm", "-f", "docker_1", {}) -+ expect(subject).to receive(:execute).with("docker-compose", "-f", "docker-compose.yml", "-p", "cwd", "rm", "-f", "docker_1", any_args) - subject.rm(cid) - end - end -diff --git a/test/unit/plugins/providers/virtualbox/action/network_test.rb b/test/unit/plugins/providers/virtualbox/action/network_test.rb -index 34ed17d94e..69b30b3390 100644 ---- a/test/unit/plugins/providers/virtualbox/action/network_test.rb -+++ b/test/unit/plugins/providers/virtualbox/action/network_test.rb -@@ -44,7 +44,7 @@ - - it "creates a host-only interface with an IPv6 address :1" do - guest = double("guest") -- machine.config.vm.network 'private_network', { type: :static, ip: 'dead:beef::100' } -+ machine.config.vm.network 'private_network', type: :static, ip: 'dead:beef::100' - #allow(driver).to receive(:read_bridged_interfaces) { [] } - allow(driver).to receive(:read_host_only_interfaces) { [] } - #allow(driver).to receive(:read_dhcp_servers) { [] } -@@ -71,19 +71,11 @@ - end - - it "raises the appropriate error when provided with an invalid IP address" do -- guest = double("guest") -- machine.config.vm.network 'private_network', { ip: '192.168.33.06' } -+ machine.config.vm.network 'private_network', ip: '192.168.33.06' - - expect{ subject.call(env) }.to raise_error(Vagrant::Errors::NetworkAddressInvalid) - end - -- it "raises no invalid network error when provided with a valid IP address" do -- guest = double("guest") -- machine.config.vm.network 'private_network', { ip: '192.168.33.6' } -- -- expect{ subject.call(env) }.not_to raise_error(Vagrant::Errors::NetworkAddressInvalid) -- end -- - context "with a dhcp private network" do - let(:bridgedifs) { [] } - let(:hostonlyifs) { [] } -@@ -92,7 +84,7 @@ - let(:network_args) {{ type: :dhcp }} - - before do -- machine.config.vm.network 'private_network', network_args -+ machine.config.vm.network 'private_network', **network_args - allow(driver).to receive(:read_bridged_interfaces) { bridgedifs } - allow(driver).to receive(:read_host_only_interfaces) { hostonlyifs } - allow(driver).to receive(:read_dhcp_servers) { dhcpservers } -diff --git a/test/unit/plugins/provisioners/chef/config/chef_apply_test.rb b/test/unit/plugins/provisioners/chef/config/chef_apply_test.rb -index 135c042138..5bcee520c1 100644 ---- a/test/unit/plugins/provisioners/chef/config/chef_apply_test.rb -+++ b/test/unit/plugins/provisioners/chef/config/chef_apply_test.rb -@@ -10,7 +10,7 @@ - let(:machine) { double("machine") } - - def chef_error(key, options = {}) -- I18n.t("vagrant.provisioners.chef.#{key}", options) -+ I18n.t("vagrant.provisioners.chef.#{key}", **options) - end - - describe "#recipe" do -diff --git a/test/unit/vagrant/action/builder_test.rb b/test/unit/vagrant/action/builder_test.rb -index cf87f375e3..efb4194573 100644 ---- a/test/unit/vagrant/action/builder_test.rb -+++ b/test/unit/vagrant/action/builder_test.rb -@@ -549,12 +549,12 @@ def call(env) - - it "should add trigger action to start of stack" do - subject.apply_dynamic_updates(env) -- expect(subject.stack[0].first).to eq(Vagrant::Action::Builtin::Trigger) -+ expect(subject.stack[0].middleware).to eq(Vagrant::Action::Builtin::Trigger) - end - - it "should have timing and type arguments" do - subject.apply_dynamic_updates(env) -- args = subject.stack[0][1] -+ args = subject.stack[0].arguments.parameters - expect(args).to include(type) - expect(args).to include(timing) - expect(args).to include(action.to_s) -@@ -566,12 +566,12 @@ def call(env) - - it "should add trigger action to middle of stack" do - subject.apply_dynamic_updates(env) -- expect(subject.stack[1].first).to eq(Vagrant::Action::Builtin::Trigger) -+ expect(subject.stack[1].middleware).to eq(Vagrant::Action::Builtin::Trigger) - end - - it "should have timing and type arguments" do - subject.apply_dynamic_updates(env) -- args = subject.stack[1][1] -+ args = subject.stack[1].arguments.parameters - expect(args).to include(type) - expect(args).to include(timing) - expect(args).to include(action.to_s) -@@ -587,12 +587,12 @@ def call(env) - - it "should add trigger action to start of stack" do - subject.apply_dynamic_updates(env) -- expect(subject.stack[0].first).to eq(Vagrant::Action::Builtin::Trigger) -+ expect(subject.stack[0].middleware).to eq(Vagrant::Action::Builtin::Trigger) - end - - it "should have timing and type arguments" do - subject.apply_dynamic_updates(env) -- args = subject.stack[0][1] -+ args = subject.stack[0].arguments.parameters - expect(args).to include(type) - expect(args).to include(timing) - expect(args).to include(action.to_s) -@@ -609,7 +609,7 @@ def call(env) - - it "should have timing and type arguments" do - subject.apply_dynamic_updates(env) -- args = subject.stack[1][1] -+ args = subject.stack[1].arguments.parameters - expect(args).to include(type) - expect(args).to include(timing) - expect(args).to include(action.to_s) -@@ -688,7 +688,7 @@ def call(env) - - it "should include arguments to the trigger action" do - subject.apply_action_name(env) -- args = subject.stack[0][1] -+ args = subject.stack[0].arguments.parameters - expect(args).to include(raw_action_name) - expect(args).to include(timing) - expect(args).to include(:action) -@@ -705,9 +705,9 @@ def call(env) - - it "should include arguments to the trigger action" do - subject.apply_action_name(env) -- builder = subject.stack.first[1]&.first -+ builder = subject.stack.first.arguments.parameters.first - expect(builder).not_to be_nil -- args = builder.stack.first[1] -+ args = builder.stack.first.arguments.parameters - expect(args).to include(raw_action_name) - expect(args).to include(timing) - expect(args).to include(:action) -@@ -728,12 +728,12 @@ def call(env) - - it "should add a trigger action to the start of the stack" do - subject.apply_action_name(env) -- expect(subject.stack[0].first).to eq(Vagrant::Action::Builtin::Trigger) -+ expect(subject.stack[0].middleware).to eq(Vagrant::Action::Builtin::Trigger) - end - - it "should include arguments to the trigger action" do - subject.apply_action_name(env) -- args = subject.stack[0][1] -+ args = subject.stack[0].arguments.parameters - expect(args).to include(action_name) - expect(args).to include(timing) - expect(args).to include(:hook) -@@ -750,7 +750,7 @@ def call(env) - - it "should include arguments to the trigger action" do - subject.apply_action_name(env) -- args = subject.stack.last[1] -+ args = subject.stack.last.arguments.parameters - expect(args).to include(action_name) - expect(args).to include(timing) - expect(args).to include(:hook) -diff --git a/test/unit/vagrant/action/builtin/box_add_test.rb b/test/unit/vagrant/action/builtin/box_add_test.rb -index 91bbc27a25..48406c2cf8 100644 ---- a/test/unit/vagrant/action/builtin/box_add_test.rb -+++ b/test/unit/vagrant/action/builtin/box_add_test.rb -@@ -91,7 +91,7 @@ def with_web_server(path, **opts) - env[:box_name] = "foo" - env[:box_url] = box_path.to_s - -- expect(box_collection).to receive(:add).with(any_args) { |path, name, version, **opts| -+ expect(box_collection).to receive(:add).with(any_args) { |path, name, version, opts| - expect(checksum(path)).to eq(checksum(box_path)) - expect(name).to eq("foo") - expect(version).to eq("0") -@@ -113,7 +113,7 @@ def with_web_server(path, **opts) - box_path.to_s, - ] - -- expect(box_collection).to receive(:add).with(any_args) { |path, name, version, **opts| -+ expect(box_collection).to receive(:add).with(any_args) { |path, name, version, opts| - expect(checksum(path)).to eq(checksum(box_path)) - expect(name).to eq("foo") - expect(version).to eq("0") -@@ -132,7 +132,7 @@ def with_web_server(path, **opts) - env[:box_name] = "foo" - env[:box_url] = "http://127.0.0.1:#{port}/#{box_path.basename}" - -- expect(box_collection).to receive(:add).with(any_args) { |path, name, version, **opts| -+ expect(box_collection).to receive(:add).with(any_args) { |path, name, version, opts| - expect(checksum(path)).to eq(checksum(box_path)) - expect(name).to eq("foo") - expect(version).to eq("0") -@@ -152,7 +152,7 @@ def with_web_server(path, **opts) - env[:box_name] = "foo" - env[:box_url] = "ftp://127.0.0.1:#{port}/#{box_path.basename}" - -- expect(box_collection).to receive(:add).with(any_args) { |path, name, version, **opts| -+ expect(box_collection).to receive(:add).with(any_args) { |path, name, version, opts| - expect(checksum(path)).to eq(checksum(box_path)) - expect(name).to eq("foo") - expect(version).to eq("0") -@@ -218,7 +218,7 @@ def with_web_server(path, **opts) - env[:box_checksum_type] = "" - - -- expect(box_collection).to receive(:add).with(any_args) { |path, name, version, **opts| -+ expect(box_collection).to receive(:add).with(any_args) { |path, name, version, opts| - expect(checksum(path)).to eq(checksum(box_path)) - expect(name).to eq("foo") - expect(version).to eq("0") -@@ -291,7 +291,7 @@ def with_web_server(path, **opts) - env[:box_provider] = "virtualbox" - - allow(box_collection).to receive(:find).and_return(box) -- expect(box_collection).to receive(:add).with(any_args) { |path, name, version, **opts| -+ expect(box_collection).to receive(:add).with(any_args) { |path, name, version, opts| - expect(checksum(path)).to eq(checksum(box_path)) - expect(name).to eq("foo") - expect(version).to eq("0") -@@ -311,7 +311,7 @@ def with_web_server(path, **opts) - box_url_name = "http://127.0.0.1:#{port}/#{box_path.basename}" - env[:box_name] = box_url_name - -- expect(box_collection).to receive(:add).with(any_args) { |path, name, version, **opts| -+ expect(box_collection).to receive(:add).with(any_args) { |path, name, version, opts| - expect(name).to eq(box_url_name) - expect(version).to eq("0") - expect(opts[:metadata_url]).to be_nil -@@ -333,7 +333,7 @@ def with_web_server(path, **opts) - box_url_name = "box name with spaces" - env[:box_name] = box_url_name - -- expect(box_collection).to receive(:add).with(any_args) { |path, name, version, **opts| -+ expect(box_collection).to receive(:add).with(any_args) { |path, name, version, opts| - expect(name).to eq(box_url_name) - expect(version).to eq("0") - expect(opts[:metadata_url]).to be_nil -@@ -356,7 +356,7 @@ def with_web_server(path, **opts) - env[:box_name] = "foo" - env[:box_url] = "http://#{username}:#{password}@127.0.0.1:#{port}/#{box_path.basename}" - -- expect(box_collection).to receive(:add).with(any_args) { |path, name, version, **opts| -+ expect(box_collection).to receive(:add).with(any_args) { |path, name, version, opts| - expect(checksum(path)).to eq(checksum(box_path)) - expect(name).to eq("foo") - expect(version).to eq("0") -@@ -404,7 +404,7 @@ def with_web_server(path, **opts) - with_web_server(md_path) do |port| - env[:box_url] = "http://127.0.0.1:#{port}/#{md_path.basename}" - -- expect(box_collection).to receive(:add).with(any_args) { |path, name, version, **opts| -+ expect(box_collection).to receive(:add).with(any_args) { |path, name, version, opts| - expect(name).to eq("foo/bar") - expect(version).to eq("0.7") - expect(checksum(path)).to eq(checksum(box_path)) -@@ -449,7 +449,7 @@ def with_web_server(path, **opts) - with_web_server(md_path, **opts) do |port| - env[:box_url] = "http://127.0.0.1:#{port}/#{md_path.basename}" - -- expect(box_collection).to receive(:add).with(any_args) { |path, name, version, **opts| -+ expect(box_collection).to receive(:add).with(any_args) { |path, name, version, opts| - expect(name).to eq("foo/bar") - expect(version).to eq("0.7") - expect(checksum(path)).to eq(checksum(box_path)) -@@ -494,7 +494,7 @@ def with_web_server(path, **opts) - url = "http://127.0.0.1:#{port}" - env[:box_url] = "mitchellh/precise64.json" - -- expect(box_collection).to receive(:add).with(any_args) { |path, name, version, **opts| -+ expect(box_collection).to receive(:add).with(any_args) { |path, name, version, opts| - expect(name).to eq("mitchellh/precise64") - expect(version).to eq("0.7") - expect(checksum(path)).to eq(checksum(box_path)) -@@ -545,7 +545,7 @@ def with_web_server(path, **opts) - env[:box_url] = "mitchellh/precise64.json" - env[:box_server_url] = url - -- expect(box_collection).to receive(:add).with(any_args) { |path, name, version, **opts| -+ expect(box_collection).to receive(:add).with(any_args) { |path, name, version, opts| - expect(name).to eq("mitchellh/precise64") - expect(version).to eq("0.7") - expect(checksum(path)).to eq(checksum(box_path)) -@@ -606,7 +606,7 @@ def with_web_server(path, **opts) - end - end - -- expect(box_collection).to receive(:add).with(any_args) { |path, name, version, **opts| -+ expect(box_collection).to receive(:add).with(any_args) { |path, name, version, opts| - expect(name).to eq("foo/bar") - expect(version).to eq("0.7") - expect(checksum(path)).to eq(checksum(box_path)) -@@ -651,7 +651,7 @@ def with_web_server(path, **opts) - with_web_server(md_path) do |port| - env[:box_url] = "http://127.0.0.1:#{port}/#{md_path.basename}" - -- expect(box_collection).to receive(:add).with(any_args) { |path, name, version, **opts| -+ expect(box_collection).to receive(:add).with(any_args) { |path, name, version, opts| - expect(name).to eq("foo/bar") - expect(version).to eq("0.7") - expect(checksum(path)).to eq(checksum(box_path)) -@@ -795,7 +795,7 @@ def with_web_server(path, **opts) - end - - env[:box_url] = tf.path -- expect(box_collection).to receive(:add).with(any_args) { |path, name, version, **opts| -+ expect(box_collection).to receive(:add).with(any_args) { |path, name, version, opts| - expect(checksum(path)).to eq(checksum(box_path)) - expect(name).to eq("foo/bar") - expect(version).to eq("0.7") -@@ -839,7 +839,7 @@ def with_web_server(path, **opts) - - env[:box_url] = tf.path - env[:box_provider] = "vmware" -- expect(box_collection).to receive(:add).with(any_args) { |path, name, version, **opts| -+ expect(box_collection).to receive(:add).with(any_args) { |path, name, version, opts| - expect(checksum(path)).to eq(checksum(box_path)) - expect(name).to eq("foo/bar") - expect(version).to eq("0.7") -@@ -888,7 +888,7 @@ def with_web_server(path, **opts) - - env[:box_url] = tf.path - env[:box_provider] = "vmware" -- expect(box_collection).to receive(:add).with(any_args) { |path, name, version, **opts| -+ expect(box_collection).to receive(:add).with(any_args) { |path, name, version, opts| - expect(checksum(path)).to eq(checksum(box_path)) - expect(name).to eq("foo/bar") - expect(version).to eq("0.7") -@@ -928,7 +928,7 @@ def with_web_server(path, **opts) - - env[:box_url] = tf.path - env[:box_version] = "~> 0.1" -- expect(box_collection).to receive(:add).with(any_args) { |path, name, version, **opts| -+ expect(box_collection).to receive(:add).with(any_args) { |path, name, version, opts| - expect(checksum(path)).to eq(checksum(box_path)) - expect(name).to eq("foo/bar") - expect(version).to eq("0.5") -@@ -973,7 +973,7 @@ def with_web_server(path, **opts) - env[:box_url] = tf.path - env[:box_provider] = "vmware" - env[:box_version] = "~> 0.1" -- expect(box_collection).to receive(:add).with(any_args) { |path, name, version, **opts| -+ expect(box_collection).to receive(:add).with(any_args) { |path, name, version, opts| - expect(checksum(path)).to eq(checksum(box_path)) - expect(name).to eq("foo/bar") - expect(version).to eq("0.5") -@@ -1021,7 +1021,7 @@ def with_web_server(path, **opts) - - env[:box_url] = tf.path - env[:box_provider] = ["virtualbox", "vmware"] -- expect(box_collection).to receive(:add).with(any_args) { |path, name, version, **opts| -+ expect(box_collection).to receive(:add).with(any_args) { |path, name, version, opts| - expect(checksum(path)).to eq(checksum(box_path)) - expect(name).to eq("foo/bar") - expect(version).to eq("0.7") -@@ -1069,7 +1069,7 @@ def with_web_server(path, **opts) - - expect(env[:ui]).to receive(:ask).and_return("1") - -- expect(box_collection).to receive(:add).with(any_args) { |path, name, version, **opts| -+ expect(box_collection).to receive(:add).with(any_args) { |path, name, version, opts| - expect(checksum(path)).to eq(checksum(box_path)) - expect(name).to eq("foo/bar") - expect(version).to eq("0.7") -@@ -1245,7 +1245,7 @@ def with_web_server(path, **opts) - env[:box_force] = true - env[:box_url] = tf.path - allow(box_collection).to receive(:find).and_return(box) -- expect(box_collection).to receive(:add).with(any_args) { |path, name, version, **opts| -+ expect(box_collection).to receive(:add).with(any_args) { |path, name, version, opts| - expect(checksum(path)).to eq(checksum(box_path)) - expect(name).to eq("foo/bar") - expect(version).to eq("0.7") -diff --git a/test/unit/vagrant/action/hook_test.rb b/test/unit/vagrant/action/hook_test.rb -index 9c6054b099..c4a3ba9dd8 100644 ---- a/test/unit/vagrant/action/hook_test.rb -+++ b/test/unit/vagrant/action/hook_test.rb -@@ -36,11 +36,20 @@ - subject.before(existing, 2) - subject.before(existing, 3, :arg, &block) - -- expect(subject.before_hooks[existing]).to eq([ -- [1, [], nil], -- [2, [], nil], -- [3, [:arg], block] -- ]) -+ hooks = subject.before_hooks[existing] -+ expect(hooks.size).to eq(3) -+ expect(hooks[0].middleware).to eq(1) -+ expect(hooks[0].arguments.parameters).to eq([]) -+ expect(hooks[0].arguments.keywords).to eq({}) -+ expect(hooks[0].arguments.block).to be_nil -+ expect(hooks[1].middleware).to eq(2) -+ expect(hooks[1].arguments.parameters).to eq([]) -+ expect(hooks[1].arguments.keywords).to eq({}) -+ expect(hooks[1].arguments.block).to be_nil -+ expect(hooks[2].middleware).to eq(3) -+ expect(hooks[2].arguments.parameters).to eq([:arg]) -+ expect(hooks[2].arguments.keywords).to eq({}) -+ expect(hooks[2].arguments.block).to eq(block) - end - end - -@@ -54,11 +63,20 @@ - subject.after(existing, 2) - subject.after(existing, 3, :arg, &block) - -- expect(subject.after_hooks[existing]).to eq([ -- [1, [], nil], -- [2, [], nil], -- [3, [:arg], block] -- ]) -+ hooks = subject.after_hooks[existing] -+ expect(hooks.size).to eq(3) -+ expect(hooks[0].middleware).to eq(1) -+ expect(hooks[0].arguments.parameters).to eq([]) -+ expect(hooks[0].arguments.keywords).to eq({}) -+ expect(hooks[0].arguments.block).to be_nil -+ expect(hooks[1].middleware).to eq(2) -+ expect(hooks[1].arguments.parameters).to eq([]) -+ expect(hooks[1].arguments.keywords).to eq({}) -+ expect(hooks[1].arguments.block).to be_nil -+ expect(hooks[2].middleware).to eq(3) -+ expect(hooks[2].arguments.parameters).to eq([:arg]) -+ expect(hooks[2].arguments.keywords).to eq({}) -+ expect(hooks[2].arguments.block).to eq(block) - end - end - -@@ -70,11 +88,20 @@ - subject.append(2) - subject.append(3, :arg, &block) - -- expect(subject.append_hooks).to eq([ -- [1, [], nil], -- [2, [], nil], -- [3, [:arg], block] -- ]) -+ hooks = subject.append_hooks -+ expect(hooks.size).to eq(3) -+ expect(hooks[0].middleware).to eq(1) -+ expect(hooks[0].arguments.parameters).to eq([]) -+ expect(hooks[0].arguments.keywords).to eq({}) -+ expect(hooks[0].arguments.block).to be_nil -+ expect(hooks[1].middleware).to eq(2) -+ expect(hooks[1].arguments.parameters).to eq([]) -+ expect(hooks[1].arguments.keywords).to eq({}) -+ expect(hooks[1].arguments.block).to be_nil -+ expect(hooks[2].middleware).to eq(3) -+ expect(hooks[2].arguments.parameters).to eq([:arg]) -+ expect(hooks[2].arguments.keywords).to eq({}) -+ expect(hooks[2].arguments.block).to eq(block) - end - end - -@@ -86,11 +113,20 @@ - subject.prepend(2) - subject.prepend(3, :arg, &block) - -- expect(subject.prepend_hooks).to eq([ -- [1, [], nil], -- [2, [], nil], -- [3, [:arg], block] -- ]) -+ hooks = subject.prepend_hooks -+ expect(hooks.size).to eq(3) -+ expect(hooks[0].middleware).to eq(1) -+ expect(hooks[0].arguments.parameters).to eq([]) -+ expect(hooks[0].arguments.keywords).to eq({}) -+ expect(hooks[0].arguments.block).to be_nil -+ expect(hooks[1].middleware).to eq(2) -+ expect(hooks[1].arguments.parameters).to eq([]) -+ expect(hooks[1].arguments.keywords).to eq({}) -+ expect(hooks[1].arguments.block).to be_nil -+ expect(hooks[2].middleware).to eq(3) -+ expect(hooks[2].arguments.parameters).to eq([:arg]) -+ expect(hooks[2].arguments.keywords).to eq({}) -+ expect(hooks[2].arguments.block).to eq(block) - end - end - -@@ -105,12 +141,15 @@ - - subject.apply(builder) - -- expect(builder.stack).to eq([ -- ["1", [2], nil], -- ["2", [], nil], -- ["8", [], nil], -- ["9", [], nil] -- ]) -+ stack = builder.stack -+ expect(stack[0].middleware).to eq("1") -+ expect(stack[0].arguments.parameters).to eq([2]) -+ expect(stack[1].middleware).to eq("2") -+ expect(stack[1].arguments.parameters).to eq([]) -+ expect(stack[2].middleware).to eq("8") -+ expect(stack[2].arguments.parameters).to eq([]) -+ expect(stack[3].middleware).to eq("9") -+ expect(stack[3].arguments.parameters).to eq([]) - end - - it "should not prepend or append if disabled" do -@@ -124,12 +163,11 @@ - - subject.apply(builder, no_prepend_or_append: true) - -- expect(builder.stack).to eq([ -- ["3", [], nil], -- ["4", [], nil], -- ["7", [], nil], -- ["8", [], nil] -- ]) -+ stack = builder.stack -+ expect(stack[0].middleware).to eq("3") -+ expect(stack[1].middleware).to eq("4") -+ expect(stack[2].middleware).to eq("7") -+ expect(stack[3].middleware).to eq("8") - end - end - end -diff --git a/test/unit/vagrant/plugin/manager_test.rb b/test/unit/vagrant/plugin/manager_test.rb -index dcb3dbf5e8..08ac2c3f83 100644 ---- a/test/unit/vagrant/plugin/manager_test.rb -+++ b/test/unit/vagrant/plugin/manager_test.rb -@@ -53,7 +53,7 @@ - before do - allow(Vagrant::Plugin::StateFile).to receive(:new).and_return(state_file) - allow(bundler).to receive(:environment_path=) -- allow(local_data_path).to receive(:join).and_return(local_data_path) -+ allow(local_data_path).to receive(:join).and_return(local_data_path) if local_data_path - allow(subject).to receive(:bundler_init) - end - -@@ -118,7 +118,7 @@ - end - - it "should init the bundler instance with plugins" do -- expect(bundler).to receive(:init!).with(plugins, anything) -+ expect(bundler).to receive(:init!).with(plugins, any_args) - subject.bundler_init(plugins) - end - -diff --git a/test/unit/vagrant/ui_test.rb b/test/unit/vagrant/ui_test.rb -index 4d1ded16e9..e484b81543 100644 ---- a/test/unit/vagrant/ui_test.rb -+++ b/test/unit/vagrant/ui_test.rb -@@ -14,7 +14,7 @@ - end - - it "outputs using `puts` by default" do -- expect(subject).to receive(:safe_puts).with(any_args) { |message, **opts| -+ expect(subject).to receive(:safe_puts).with(any_args) { |message, opts| - expect(opts[:printer]).to eq(:puts) - true - } -@@ -23,7 +23,7 @@ - end - - it "outputs using `print` if new_line is false" do -- expect(subject).to receive(:safe_puts).with(any_args) { |message, **opts| -+ expect(subject).to receive(:safe_puts).with(any_args) { |message, opts| - expect(opts[:printer]).to eq(:print) - true - } -@@ -32,7 +32,7 @@ - end - - it "outputs using `print` if new_line is false" do -- expect(subject).to receive(:safe_puts).with(any_args) { |message, **opts| -+ expect(subject).to receive(:safe_puts).with(any_args) { |message, opts| - expect(opts[:printer]).to eq(:print) - true - } -@@ -44,7 +44,7 @@ - stdout = StringIO.new - subject.stdout = stdout - -- expect(subject).to receive(:safe_puts).with(any_args) { |message, **opts| -+ expect(subject).to receive(:safe_puts).with(any_args) { |message, opts| - expect(opts[:io]).to be(stdout) - true - } -@@ -60,7 +60,7 @@ - stderr = StringIO.new - subject.stderr = stderr - -- expect(subject).to receive(:safe_puts).with(any_args) { |message, **opts| -+ expect(subject).to receive(:safe_puts).with(any_args) { |message, opts| - expect(opts[:io]).to be(stderr) - true - } -@@ -81,7 +81,7 @@ - - context "#detail" do - it "outputs details" do -- expect(subject).to receive(:safe_puts).with(any_args) { |message, **opts| -+ expect(subject).to receive(:safe_puts).with(any_args) { |message, opts| - expect(message).to eq("foo") - true - } -@@ -104,7 +104,7 @@ - before{ Vagrant::Util::CredentialScrubber.sensitive(password) } - - it "should remove sensitive information from the output" do -- expect(subject).to receive(:safe_puts).with(any_args) do |message, **opts| -+ expect(subject).to receive(:safe_puts).with(any_args) do |message, opts| - expect(message).not_to include(password) - end - subject.detail(output) -diff --git a/vagrant.gemspec b/vagrant.gemspec -index 8aaf9cc7d9..9287a99a3e 100644 ---- a/vagrant.gemspec -+++ b/vagrant.gemspec -@@ -12,7 +12,7 @@ Gem::Specification.new do |s| - s.summary = "Build and distribute virtualized development environments." - s.description = "Vagrant is a tool for building and distributing virtualized development environments." - -- s.required_ruby_version = "~> 2.4", "< 2.7" -+ s.required_ruby_version = "~> 2.4", "< 2.8" - s.required_rubygems_version = ">= 1.3.6" - - s.add_dependency "bcrypt_pbkdf", "~> 1.0.0" - -From 203ebf59adf161826a63ecede0e6318a39f13a1a Mon Sep 17 00:00:00 2001 -From: Chris Roberts -Date: Mon, 10 Aug 2020 11:17:24 -0700 -Subject: [PATCH 2/3] Update minimum Ruby constriant to 2.5 - ---- - .github/workflows/testing.yml | 2 +- - vagrant.gemspec | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml -index 95591be6a5..68d284de78 100644 ---- a/.github/workflows/testing.yml -+++ b/.github/workflows/testing.yml -@@ -22,7 +22,7 @@ jobs: - runs-on: ubuntu-18.04 - strategy: - matrix: -- ruby: [ '2.4.x', '2.5.x', '2.6.x' ] -+ ruby: [ '2.5.x', '2.6.x', '2.7.x' ] - name: Vagrant unit tests on Ruby ${{ matrix.ruby }} - steps: - - name: Code Checkout -diff --git a/vagrant.gemspec b/vagrant.gemspec -index 9287a99a3e..f088f3adf0 100644 ---- a/vagrant.gemspec -+++ b/vagrant.gemspec -@@ -12,7 +12,7 @@ Gem::Specification.new do |s| - s.summary = "Build and distribute virtualized development environments." - s.description = "Vagrant is a tool for building and distributing virtualized development environments." - -- s.required_ruby_version = "~> 2.4", "< 2.8" -+ s.required_ruby_version = "~> 2.5", "< 2.8" - s.required_rubygems_version = ">= 1.3.6" - - s.add_dependency "bcrypt_pbkdf", "~> 1.0.0" - -From e7e956ca1244410558f74ab6c5e52838cf2106d8 Mon Sep 17 00:00:00 2001 -From: sophia -Date: Mon, 10 Aug 2020 16:32:54 -0500 -Subject: [PATCH 3/3] Fix a few deprecation warnings for ruby 2.7 - ---- - plugins/kernel_v2/config/vm.rb | 2 +- - plugins/providers/virtualbox/action/forward_ports.rb | 4 ++-- - 2 files changed, 3 insertions(+), 3 deletions(-) - -diff --git a/plugins/kernel_v2/config/vm.rb b/plugins/kernel_v2/config/vm.rb -index f6fb07c000..14dc2de808 100644 ---- a/plugins/kernel_v2/config/vm.rb -+++ b/plugins/kernel_v2/config/vm.rb -@@ -370,7 +370,7 @@ def provision(name, **options, &block) - - if Vagrant::Util::Experimental.feature_enabled?("dependency_provisioners") - opts = {before: before, after: after} -- prov = VagrantConfigProvisioner.new(name, type.to_sym, opts) -+ prov = VagrantConfigProvisioner.new(name, type.to_sym, **opts) - else - prov = VagrantConfigProvisioner.new(name, type.to_sym) - end -diff --git a/plugins/providers/virtualbox/action/forward_ports.rb b/plugins/providers/virtualbox/action/forward_ports.rb -index aac6639186..a468ae61bc 100644 ---- a/plugins/providers/virtualbox/action/forward_ports.rb -+++ b/plugins/providers/virtualbox/action/forward_ports.rb -@@ -48,7 +48,7 @@ def forward_ports - # 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] -@@ -62,7 +62,7 @@ def forward_ports - # so verify that that is the case. - if interfaces[fp.adapter][:type] != :nat - @env[:ui].detail(I18n.t("vagrant.actions.vm.forward_ports.non_nat", -- message_attributes)) -+ **message_attributes)) - next - end - diff --git a/vagrant-2.2.16-fix-compatibility-with-ruby-3.0.patch b/vagrant-2.2.16-fix-compatibility-with-ruby-3.0.patch deleted file mode 100644 index bf30e63..0000000 --- a/vagrant-2.2.16-fix-compatibility-with-ruby-3.0.patch +++ /dev/null @@ -1,185 +0,0 @@ -From e4859e2486a3ac031a79ae62ef17bd8cbdbb86e2 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= -Date: Sun, 4 Apr 2021 22:46:45 +0200 -Subject: [PATCH] Fix shell provisioner with ruby 3.0 - -I recently updated to Fedora 34 (which uses ruby 3.0), and `vagrant up` errors out like this: - -``` -/usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/ui.rb:230:in `say': wrong number of arguments (given 4, expected 2..3) (ArgumentError) - from (eval):3:in `detail' - from (eval):9:in `detail' - from /usr/share/vagrant/gems/gems/vagrant-2.2.9/plugins/provisioners/shell/provisioner.rb:79:in `handle_comm' - from /usr/share/vagrant/gems/gems/vagrant-2.2.9/plugins/provisioners/shell/provisioner.rb:127:in `block (3 levels) in provision_ssh' - from /usr/share/vagrant/gems/gems/vagrant-2.2.9/plugins/communicators/ssh/communicator.rb:254:in `block (2 levels) in execute' - from /usr/share/vagrant/gems/gems/vagrant-2.2.9/plugins/communicators/ssh/communicator.rb:617:in `block (3 levels) in shell_execute' - from /usr/share/gems/gems/net-ssh-6.1.0/lib/net/ssh/connection/channel.rb:598:in `do_extended_data' - from /usr/share/gems/gems/net-ssh-6.1.0/lib/net/ssh/connection/session.rb:673:in `channel_extended_data' - from /usr/share/gems/gems/net-ssh-6.1.0/lib/net/ssh/connection/session.rb:548:in `dispatch_incoming_packets' - from /usr/share/gems/gems/net-ssh-6.1.0/lib/net/ssh/connection/session.rb:248:in `ev_preprocess' - from /usr/share/gems/gems/net-ssh-6.1.0/lib/net/ssh/connection/event_loop.rb:100:in `each' - from /usr/share/gems/gems/net-ssh-6.1.0/lib/net/ssh/connection/event_loop.rb:100:in `ev_preprocess' - from /usr/share/gems/gems/net-ssh-6.1.0/lib/net/ssh/connection/event_loop.rb:28:in `process' - from /usr/share/gems/gems/net-ssh-6.1.0/lib/net/ssh/connection/session.rb:227:in `process' - from /usr/share/gems/gems/net-ssh-6.1.0/lib/net/ssh/connection/session.rb:180:in `block in loop' - from /usr/share/gems/gems/net-ssh-6.1.0/lib/net/ssh/connection/session.rb:180:in `loop' - from /usr/share/gems/gems/net-ssh-6.1.0/lib/net/ssh/connection/session.rb:180:in `loop' - from /usr/share/gems/gems/net-ssh-6.1.0/lib/net/ssh/connection/channel.rb:272:in `wait' - from /usr/share/vagrant/gems/gems/vagrant-2.2.9/plugins/communicators/ssh/communicator.rb:702:in `shell_execute' - from /usr/share/vagrant/gems/gems/vagrant-2.2.9/plugins/communicators/ssh/communicator.rb:247:in `block in execute' - from /usr/share/vagrant/gems/gems/vagrant-2.2.9/plugins/communicators/ssh/communicator.rb:391:in `connect' - from /usr/share/vagrant/gems/gems/vagrant-2.2.9/plugins/communicators/ssh/communicator.rb:240:in `execute' - from /usr/share/vagrant/gems/gems/vagrant-2.2.9/plugins/provisioners/shell/provisioner.rb:122:in `block (2 levels) in provision_ssh' - from :90:in `tap' - from /usr/share/vagrant/gems/gems/vagrant-2.2.9/plugins/provisioners/shell/provisioner.rb:96:in `block in provision_ssh' - from /usr/share/vagrant/gems/gems/vagrant-2.2.9/plugins/provisioners/shell/provisioner.rb:329:in `with_script_file' - from /usr/share/vagrant/gems/gems/vagrant-2.2.9/plugins/provisioners/shell/provisioner.rb:94:in `provision_ssh' - from /usr/share/vagrant/gems/gems/vagrant-2.2.9/plugins/provisioners/shell/provisioner.rb:33:in `provision' - from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/action/builtin/provision.rb:138:in `run_provisioner' - from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/action/warden.rb:127:in `call' - from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/action/warden.rb:127:in `block in finalize_action' - from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/action/warden.rb:48:in `call' - from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/action/builder.rb:149:in `call' - from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/action/runner.rb:89:in `block in run' - from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/util/busy.rb:19:in `busy' - from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/action/runner.rb:89:in `run' - from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/environment.rb:525:in `hook' - from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/action/builtin/provision.rb:126:in `call' - from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/action/builtin/provision.rb:126:in `block in call' - from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/action/builtin/provision.rb:103:in `each' - from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/action/builtin/provision.rb:103:in `call' - from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/action/warden.rb:48:in `call' - from /usr/share/vagrant/gems/gems/vagrant-libvirt-0.1.2/lib/vagrant-libvirt/action/create_domain.rb:363:in `call' - from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/action/warden.rb:48:in `call' - from /usr/share/vagrant/gems/gems/vagrant-libvirt-0.1.2/lib/vagrant-libvirt/action/create_domain_volume.rb:89:in `call' - from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/action/warden.rb:48:in `call' - from /usr/share/vagrant/gems/gems/vagrant-libvirt-0.1.2/lib/vagrant-libvirt/action/handle_box_image.rb:124:in `call' - from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/action/warden.rb:48:in `call' - from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/action/builtin/handle_box.rb:56:in `call' - from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/action/warden.rb:48:in `call' - from /usr/share/vagrant/gems/gems/vagrant-libvirt-0.1.2/lib/vagrant-libvirt/action/handle_storage_pool.rb:57:in `call' - from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/action/warden.rb:48:in `call' - from /usr/share/vagrant/gems/gems/vagrant-libvirt-0.1.2/lib/vagrant-libvirt/action/set_name_of_domain.rb:32:in `call' - from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/action/warden.rb:48:in `call' - from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/action/warden.rb:127:in `block in finalize_action' - from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/action/warden.rb:48:in `call' - from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/action/builder.rb:149:in `call' - from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/action/runner.rb:89:in `block in run' - from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/util/busy.rb:19:in `busy' - from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/action/runner.rb:89:in `run' - from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/action/builtin/call.rb:53:in `call' -``` - -I'm not a ruby expert but I believe it's related to [this breaking change](https://www.ruby-lang.org/en/news/2019/12/12/separation-of-positional-and-keyword-arguments-in-ruby-3-0/). This change fixes it for me. ---- - plugins/provisioners/shell/provisioner.rb | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/plugins/provisioners/shell/provisioner.rb b/plugins/provisioners/shell/provisioner.rb -index 08c8cf739d3..e95f176f28b 100644 ---- a/plugins/provisioners/shell/provisioner.rb -+++ b/plugins/provisioners/shell/provisioner.rb -@@ -78,7 +78,7 @@ def handle_comm(type, data) - options = {} - options[:color] = color if !config.keep_color - -- @machine.ui.detail(data.chomp, options) -+ @machine.ui.detail(data.chomp, **options) - end - end - -From c145867fdd4fb2767f73534057a7bdb9cad3468e Mon Sep 17 00:00:00 2001 -From: Pavel Valena -Date: Fri, 7 May 2021 01:52:27 +0200 -Subject: [PATCH] Fix compatibility with Ruby 3.0 - -Currently it fails with Ruby 3.0: -``` - 1) VagrantPlugins::Kernel_V2::VagrantConfigDisk#add_provider_config normalizes -provider config - Failure/Error: subject.add_provider_config(test_provider_config) - - ArgumentError: - wrong number of arguments (given 1, expected 0) - # ./plugins/kernel_v2/config/disk.rb:88:in `add_provider_config' - # ./test/unit/plugins/kernel_v2/config/disk_test.rb:122:in `block (3 levels) -in ' - # /usr/share/gems/gems/webmock-3.12.1/lib/webmock/rspec.rb:37:in `block (2 -levels) in ' -``` ---- - test/unit/plugins/kernel_v2/config/disk_test.rb | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/test/unit/plugins/kernel_v2/config/disk_test.rb b/test/unit/plugins/kernel_v2/config/disk_test.rb -index b05d4f105fb..05e91ced6ed 100644 ---- a/test/unit/plugins/kernel_v2/config/disk_test.rb -+++ b/test/unit/plugins/kernel_v2/config/disk_test.rb -@@ -119,7 +119,7 @@ def assert_valid - describe "#add_provider_config" do - it "normalizes provider config" do - test_provider_config = {provider__something: "special" } -- subject.add_provider_config(test_provider_config) -+ subject.add_provider_config(**test_provider_config) - expect(subject.provider_config).to eq( { provider: {something: "special" }} ) - end - end -From bda7c07c02fafb2a3817982d827fc12d71daa817 Mon Sep 17 00:00:00 2001 -From: Pavel Valena -Date: Fri, 7 May 2021 01:49:31 +0200 -Subject: [PATCH] Remove unsused &block in add_provider_config. - -Also AFAIK this is not valid with Ruby 3.0. ---- - plugins/kernel_v2/config/disk.rb | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/plugins/kernel_v2/config/disk.rb b/plugins/kernel_v2/config/disk.rb -index 0062d8d354b..bd16941ff3c 100644 ---- a/plugins/kernel_v2/config/disk.rb -+++ b/plugins/kernel_v2/config/disk.rb -@@ -85,7 +85,7 @@ def initialize(type) - # Duplicates will be overriden - # - # @param [Hash] options -- def add_provider_config(**options, &block) -+ def add_provider_config(**options) - current = {} - options.each do |k,v| - opts = k.to_s.split("__") -From 3ec791d1687903f6d7a7d837b27633559f791230 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Jaime=20Caama=C3=B1o=20Ruiz?= -Date: Wed, 12 May 2021 17:01:34 +0200 -Subject: [PATCH] Additional ruby 3.0 keyword argument fixes - ---- - lib/vagrant/plugin/v2/trigger.rb | 2 +- - plugins/provisioners/container/client.rb | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/lib/vagrant/plugin/v2/trigger.rb b/lib/vagrant/plugin/v2/trigger.rb -index 99d6ac05325..731b5854733 100644 ---- a/lib/vagrant/plugin/v2/trigger.rb -+++ b/lib/vagrant/plugin/v2/trigger.rb -@@ -271,7 +271,7 @@ def run(config, on_error, exit_codes) - options[:color] = :red if !config.keep_color - end - -- @ui.detail(data, options) -+ @ui.detail(data, **options) - end - if !exit_codes.include?(result.exit_code) - raise Errors::TriggersBadExitCodes, -diff --git a/plugins/provisioners/container/client.rb b/plugins/provisioners/container/client.rb -index 72a2d86ab44..db3e2c0ac94 100644 ---- a/plugins/provisioners/container/client.rb -+++ b/plugins/provisioners/container/client.rb -@@ -195,7 +195,7 @@ def handle_comm(type, data) - options = {} - #options[:color] = color if !config.keep_color - -- @machine.ui.info(data.chomp, options) -+ @machine.ui.info(data.chomp, **options) - end - end - end diff --git a/vagrant-2.2.9-Relax-Ruby-dependency-restriction.patch b/vagrant-2.2.9-Relax-Ruby-dependency-restriction.patch deleted file mode 100644 index 84a2923..0000000 --- a/vagrant-2.2.9-Relax-Ruby-dependency-restriction.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/vagrant.gemspec b/vagrant.gemspec -index 1643681..7b87b63 100644 ---- a/vagrant.gemspec -+++ b/vagrant.gemspec -@@ -12,7 +12,6 @@ Gem::Specification.new do |s| - s.summary = "Build and distribute virtualized development environments." - s.description = "Vagrant is a tool for building and distributing virtualized development environments." - -- s.required_ruby_version = "~> 2.5", "< 2.8" - s.required_rubygems_version = ">= 1.3.6" - - s.add_dependency "bcrypt_pbkdf", "~> 1.1" - diff --git a/vagrant.spec b/vagrant.spec index 0340db3..5e53c4a 100644 --- a/vagrant.spec +++ b/vagrant.spec @@ -1,13 +1,13 @@ %global bashcompletion_dir %(pkg-config --variable=completionsdir bash-completion 2> /dev/null || :) -%global vagrant_spec_commit 9057cd6e0ac299688da608d459deac66bfad8880 +%global vagrant_spec_commit 03d88fe2467716b072951c2b55d78223130851a6 %bcond_without help2man %bcond_with ed25519 Name: vagrant -Version: 2.2.16 -Release: 2%{?dist} +Version: 2.2.19 +Release: 1%{?dist} Summary: Build and distribute virtualized development environments License: MIT URL: http://vagrantup.com @@ -16,8 +16,8 @@ Source0: https://github.com/hashicorp/%{name}/archive/refs/tags/v%{version}.tar. Source1: binstub # The library has no official release yet. But since it is just test # dependency, it should be fine to include the source right here. -# wget https://github.com/mitchellh/vagrant-spec/archive/9057cd6e0ac299688da608d459deac66bfad8880/vagrant-spec-9057cd6e0ac299688da608d459deac66bfad8880.tar.gz -Source2: https://github.com/vagrant/%{name}-spec/archive/%{vagrant_spec_commit}/%{name}-spec-%{vagrant_spec_commit}.tar.gz +# wget https://github.com/hashicorp/vagrant-spec/archive/03d88fe2467716b072951c2b55d78223130851a6/vagrant-spec-03d88fe2467716b072951c2b55d78223130851a6.tar.gz +Source2: https://github.com/hashicorp/%{name}-spec/archive/%{vagrant_spec_commit}/%{name}-spec-%{vagrant_spec_commit}.tar.gz # Monkey-patching needed for Vagrant to work until the respective patches # for RubyGems and Bundler are in place Source4: macros.vagrant @@ -28,16 +28,6 @@ Patch0: vagrant-2.2.3-Fix-fake_ftp-0.3.x-compatibility.patch # Do not load runtime dependencies in %%check if vagrant is not loaded # https://github.com/hashicorp/vagrant/pull/10945 Patch1: vagrant-2.2.9-do-not-load-dependencies.patch -# Relax Ruby version restriction (use patch to make sure we don't regress -# if upstream fixes this. -# https://bugzilla.redhat.com/show_bug.cgi?id=1915671 -Patch5: vagrant-2.2.9-Relax-Ruby-dependency-restriction.patch -# Fix shell provisioner compatibility with ruby 3.0 -# https://github.com/hashicorp/vagrant/pull/12273 -# https://github.com/hashicorp/vagrant/pull/12353 -# https://github.com/hashicorp/vagrant/pull/12352 -# https://github.com/jcaamano/vagrant/commit/3ec791d1687903f6d7a7d837b27633559f791230 -Patch6: vagrant-2.2.16-fix-compatibility-with-ruby-3.0.patch # The load directive is supported since RPM 4.12, i.e. F21+. The build process # fails on older Fedoras. @@ -127,8 +117,6 @@ Documentation for %{name}. %setup -q -b2 %patch0 -p1 -%patch5 -p1 -%patch6 -p1 # TODO: package vagrant_cloud, as it is not in Fedora yet %gemspec_remove_dep -s %{name}.gemspec -g vagrant_cloud @@ -139,13 +127,15 @@ rm -rf ./plugins/commands/cloud/ sed -i '/^\s*I18n\..*$/ s/^/#/g' plugins/commands/login/plugin.rb sed -i '/^\s*command(:login) do$/,/\s*end$/ s/^/#/g' plugins/commands/login/plugin.rb -# We have newer versions in Fedora -%gemspec_remove_dep -s %{name}.gemspec -g net-scp '~> 1.2.0' -%gemspec_add_dep -s %{name}.gemspec -g net-scp '>= 1.2.0' - # We have older version in Fedora %gemspec_remove_dep -s %{name}.gemspec -g net-sftp '~> 3.0' %gemspec_add_dep -s %{name}.gemspec -g net-sftp '>= 2.1.2' +%gemspec_remove_dep -s %{name}.gemspec -g net-scp '~> 3.0.0' +%gemspec_add_dep -s %{name}.gemspec -g net-scp '>= 1.2.0' + +# We have newer version in Fedora +%gemspec_remove_dep -s %{name}.gemspec -g listen +%gemspec_add_dep -s %{name}.gemspec -g listen '>= 3.5.1' # Remove Windows specific dependencies %gemspec_remove_dep -s %{name}.gemspec -g wdm @@ -339,10 +329,6 @@ export RUBYOPT rake -f tasks/test.rake test:unit \ | tee error.log -# Additional failures (3) -# > Cannot proxy frozen objects, rspec-mocks relies on proxies for method... -# https://github.com/hashicorp/vagrant/issues/12365 -# # Temporarily disable (3) tests failing on older childprocess # 4) Vagrant::Util::Subprocess#running? should return false when subprocess has completed # Failure/Error: expect(sp.running?).to be(false) @@ -368,7 +354,9 @@ rake -f tasks/test.rake test:unit \ # # ./test/unit/vagrant/util/subprocess_test.rb:168:in `each' # # ./test/unit/vagrant/util/subprocess_test.rb:168:in `block (4 levels) in ' # # /usr/share/gems/gems/webmock-3.11.1/lib/webmock/rspec.rb:37:in `block (2 levels) in ' -grep ', 6 failures, ' error.log || exit 1 +# Note: failures will dissapear when rubygem-childprocess update PR is merged +# https://src.fedoraproject.org/rpms/rubygem-childprocess/pull-request/2/ +grep -E ', (3|0) failures, ' error.log || exit 1 %if %{with help2man} # Check `--help` output, using which man page is created @@ -488,6 +476,10 @@ end %{vagrant_plugin_instdir}/vagrant-spec.config.example.rb %changelog +* Mon Nov 15 2021 Pavel Valena - 2.2.19-1 +- Upgrade Vagrant to 2.2.19. + Resolves: rhbz#1980195 + * Fri Jul 23 2021 Fedora Release Engineering - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild From c79d075bd6b0b2ab5f45b6aeaf3189ce082d7fb9 Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Wed, 30 Jun 2021 13:07:53 +0200 Subject: [PATCH 59/83] Add zsh autocompletion. --- vagrant.spec | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/vagrant.spec b/vagrant.spec index 5e53c4a..71e93dd 100644 --- a/vagrant.spec +++ b/vagrant.spec @@ -197,6 +197,9 @@ install -D -m 0644 %{buildroot}%{vagrant_plugin_instdir}/contrib/bash/completion %{buildroot}%{bashcompletion_dir}/%{name} sed -i '/#!\// d' %{buildroot}%{bashcompletion_dir}/%{name} +install -D -m 0644 %{buildroot}%{vagrant_plugin_instdir}/contrib/zsh/_%{name} \ + %{buildroot}%{_datadir}/zsh/site-functions/_%{name} + # Install Vagrant macros mkdir -p %{buildroot}%{_rpmconfigdir}/macros.d/ @@ -445,6 +448,7 @@ end # TODO: Make more use of contribs. %{vagrant_plugin_instdir}/contrib %exclude %{vagrant_plugin_instdir}/contrib/bash +%exclude %{vagrant_plugin_instdir}/contrib/zsh/_%{name} # This is not the original .gemspec. %exclude %{vagrant_plugin_instdir}/vagrant.gemspec %{vagrant_plugin_instdir}/keys @@ -462,6 +466,9 @@ end %dir %{dirname:%{bashcompletion_dir}} %dir %{bashcompletion_dir} %{bashcompletion_dir}/%{name} +# By "owning" the site-functions dir, we don't need to Require zsh +%dir %{_datadir}/zsh +%{_datadir}/zsh/site-functions/_%{name} %{_rpmconfigdir}/macros.d/macros.%{name} %if %{with help2man} %{_mandir}/man1/%{name}.1* @@ -479,6 +486,7 @@ end * Mon Nov 15 2021 Pavel Valena - 2.2.19-1 - Upgrade Vagrant to 2.2.19. Resolves: rhbz#1980195 +- Add zsh autocompletion. * Fri Jul 23 2021 Fedora Release Engineering - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild From ee96fbd1ba731755afbc0571f6d507e1409bd973 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ondruch?= Date: Wed, 20 Jan 2021 19:07:22 +0100 Subject: [PATCH 60/83] Relax net-ssh dependency. This will ease update of `rubygem(net-ssh)` in Fedora and therefore also update to the next version of Vagrant. Applied: 577ea8bd22727ffdef25712340a9b346eed30a50 --- vagrant.spec | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/vagrant.spec b/vagrant.spec index 71e93dd..9cec8c8 100644 --- a/vagrant.spec +++ b/vagrant.spec @@ -150,6 +150,10 @@ sed -i '/^\s*command(:login) do$/,/\s*end$/ s/^/#/g' plugins/commands/login/plug %gemspec_remove_dep -s %{name}.gemspec -g childprocess %gemspec_add_dep -s %{name}.gemspec -g childprocess '>= 1.0.1' +# Relax net-ssh dependency. We have newer net-ssh in Fedora +%gemspec_remove_dep -s %{name}.gemspec -g net-ssh +%gemspec_add_dep -s %{name}.gemspec -g net-ssh ['>= 5.2.0', '< 7'] + # Remove optional dependencies %gemspec_remove_dep -s %{name}.gemspec -g bcrypt_pbkdf @@ -487,6 +491,7 @@ end - Upgrade Vagrant to 2.2.19. Resolves: rhbz#1980195 - Add zsh autocompletion. +- Relax net-ssh dependency once more. * Fri Jul 23 2021 Fedora Release Engineering - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild From 7a08ef5729e85d640eb6cb84160bae402a2b2ee4 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 22 Jan 2022 03:44:53 +0000 Subject: [PATCH 61/83] - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- vagrant.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vagrant.spec b/vagrant.spec index 9cec8c8..c55507c 100644 --- a/vagrant.spec +++ b/vagrant.spec @@ -7,7 +7,7 @@ Name: vagrant Version: 2.2.19 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Build and distribute virtualized development environments License: MIT URL: http://vagrantup.com @@ -487,6 +487,9 @@ end %{vagrant_plugin_instdir}/vagrant-spec.config.example.rb %changelog +* Sat Jan 22 2022 Fedora Release Engineering +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + * Mon Nov 15 2021 Pavel Valena - 2.2.19-1 - Upgrade Vagrant to 2.2.19. Resolves: rhbz#1980195 From f8a97e75f066d571afdb2a18ce4fe6ee6f2fbfe3 Mon Sep 17 00:00:00 2001 From: Jarek Prokop Date: Mon, 21 Feb 2022 19:45:10 +0100 Subject: [PATCH 62/83] Fix FTBFS for ruby 3.1 due to new rspec-mocks. BuildRequires for rubygem-rake is needed because rspec dropped the dependency on the gem in new release. --- vagrant-2.2.19-fix-3.1-compatibility.patch | 72 ++++++++++++++++++++++ vagrant.spec | 12 +++- 2 files changed, 83 insertions(+), 1 deletion(-) create mode 100644 vagrant-2.2.19-fix-3.1-compatibility.patch diff --git a/vagrant-2.2.19-fix-3.1-compatibility.patch b/vagrant-2.2.19-fix-3.1-compatibility.patch new file mode 100644 index 0000000..2056f71 --- /dev/null +++ b/vagrant-2.2.19-fix-3.1-compatibility.patch @@ -0,0 +1,72 @@ +From 2b1c25d247aba492e582a01cff8ecdd33d4d165b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Dan=20=C4=8Cerm=C3=A1k?= +Date: Mon, 28 Feb 2022 10:46:17 +0100 +Subject: [PATCH 1/2] Stop using the last argument as kwargs in unit tests + +A few unit tests started failing with Ruby 3.0, because they were relying on +keyword arguments being converted into hashes automatically. This behavior was +deprecated in Ruby 2.7 and results in errors in Ruby 3.0 onward. + +For further details: +https://rubyreferences.github.io/rubychanges/3.0.html#keyword-arguments-are-now-fully-separated-from-positional-arguments +--- + test/unit/plugins/commands/package/command_test.rb | 4 ++-- + .../plugins/providers/hyperv/action/read_guest_ip_test.rb | 2 +- + test/unit/vagrant/ui_test.rb | 4 ++-- + 3 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/test/unit/plugins/commands/package/command_test.rb b/test/unit/plugins/commands/package/command_test.rb +index 7b289bd1e3a..d0f81393bf6 100644 +--- a/test/unit/plugins/commands/package/command_test.rb ++++ b/test/unit/plugins/commands/package/command_test.rb +@@ -64,7 +64,7 @@ + + it "packages default machine inside specified folder" do + expect(package_command).to receive(:package_vm).with( +- a_machine_named('default'), :output => "package-output-folder/default" ++ a_machine_named('default'), { output: "package-output-folder/default" } + ) + package_command.execute + end +@@ -96,7 +96,7 @@ + let(:argv){ ['--base', 'machine-id'] } + + it "packages vm defined within virtualbox" do +- expect(package_command).to receive(:package_base).with(:base => 'machine-id') ++ expect(package_command).to receive(:package_base).with({ base: 'machine-id' }) + package_command.execute + end + +diff --git a/test/unit/plugins/providers/hyperv/action/read_guest_ip_test.rb b/test/unit/plugins/providers/hyperv/action/read_guest_ip_test.rb +index 5642c6271f1..ecce003a602 100644 +--- a/test/unit/plugins/providers/hyperv/action/read_guest_ip_test.rb ++++ b/test/unit/plugins/providers/hyperv/action/read_guest_ip_test.rb +@@ -31,7 +31,7 @@ + end + + it "should set the host information into the env" do +- expect(env).to receive(:[]=).with(:machine_ssh_info, host: "ADDRESS") ++ expect(env).to receive(:[]=).with(:machine_ssh_info, { host: "ADDRESS" }) + expect(driver).to receive(:read_guest_ip).and_return("ip" => "ADDRESS") + subject.call(env) + end +diff --git a/test/unit/vagrant/ui_test.rb b/test/unit/vagrant/ui_test.rb +index e484b81543b..120b1dda2a6 100644 +--- a/test/unit/vagrant/ui_test.rb ++++ b/test/unit/vagrant/ui_test.rb +@@ -379,12 +379,12 @@ + + describe "#machine" do + it "sets the target option" do +- expect(ui).to receive(:machine).with(:foo, target: prefix) ++ expect(ui).to receive(:machine).with(:foo, { target: prefix }) + subject.machine(:foo) + end + + it "preserves existing options" do +- expect(ui).to receive(:machine).with(:foo, :bar, foo: :bar, target: prefix) ++ expect(ui).to receive(:machine).with(:foo, :bar, { foo: :bar, target: prefix }) + subject.machine(:foo, :bar, foo: :bar) + end + end + diff --git a/vagrant.spec b/vagrant.spec index c55507c..d6c9ad7 100644 --- a/vagrant.spec +++ b/vagrant.spec @@ -7,7 +7,7 @@ Name: vagrant Version: 2.2.19 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Build and distribute virtualized development environments License: MIT URL: http://vagrantup.com @@ -28,6 +28,9 @@ Patch0: vagrant-2.2.3-Fix-fake_ftp-0.3.x-compatibility.patch # Do not load runtime dependencies in %%check if vagrant is not loaded # https://github.com/hashicorp/vagrant/pull/10945 Patch1: vagrant-2.2.9-do-not-load-dependencies.patch +# Fix spec test suite for new rspec-mocks. +# https://github.com/hashicorp/vagrant/pull/12699 +Patch2: vagrant-2.2.19-fix-3.1-compatibility.patch # The load directive is supported since RPM 4.12, i.e. F21+. The build process # fails on older Fedoras. @@ -49,6 +52,7 @@ Requires: rubygem(net-scp) >= 1.2.0 Requires: rubygem(net-sftp) >= 2.1 Requires: rubygem(rest-client) >= 1.6.0 Requires: rubygem(rubyzip) >= 1.1.7 +Requires: rubygem(net-ftp) Requires: bsdtar Requires: curl @@ -84,6 +88,8 @@ BuildRequires: rubygem(thor) BuildRequires: rubygem(webmock) BuildRequires: rubygem(webrick) BuildRequires: rubygem(fake_ftp) +BuildRequires: rubygem(rake) +BuildRequires: rubygem(net-ftp) BuildRequires: pkgconfig(bash-completion) %if %{with help2man} BuildRequires: help2man @@ -117,6 +123,7 @@ Documentation for %{name}. %setup -q -b2 %patch0 -p1 +%patch2 -p1 # TODO: package vagrant_cloud, as it is not in Fedora yet %gemspec_remove_dep -s %{name}.gemspec -g vagrant_cloud @@ -487,6 +494,9 @@ end %{vagrant_plugin_instdir}/vagrant-spec.config.example.rb %changelog +* Mon Feb 21 2022 Jarek Prokop - 2.2.19-3 +- Fix FTBFS due to new rspec-mocks. + * Sat Jan 22 2022 Fedora Release Engineering - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild From c0bb4d585ae07680588a38037b290becea5959c5 Mon Sep 17 00:00:00 2001 From: Jarek Prokop Date: Tue, 1 Mar 2022 12:32:24 +0100 Subject: [PATCH 63/83] Relax required Ruby version. Otherwise RubyGems throws confusing error when trying to run vagrant. Relevant RubyGems issue: https://github.com/rubygems/rubygems/issues/4338 --- vagrant.spec | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/vagrant.spec b/vagrant.spec index d6c9ad7..412ccab 100644 --- a/vagrant.spec +++ b/vagrant.spec @@ -134,6 +134,11 @@ rm -rf ./plugins/commands/cloud/ sed -i '/^\s*I18n\..*$/ s/^/#/g' plugins/commands/login/plugin.rb sed -i '/^\s*command(:login) do$/,/\s*end$/ s/^/#/g' plugins/commands/login/plugin.rb +# Expand required Ruby compatibility, otherwise RubyGems throws exceptions. +# Relevant rhbz: https://bugzilla.redhat.com/show_bug.cgi?id=2053476#c0 +# Relevant RubyGems issue: https://github.com/rubygems/rubygems/issues/4338 +sed -i -e '/required_ruby_version/ s/, "< 3.1"//' %{name}.gemspec + # We have older version in Fedora %gemspec_remove_dep -s %{name}.gemspec -g net-sftp '~> 3.0' %gemspec_add_dep -s %{name}.gemspec -g net-sftp '>= 2.1.2' @@ -496,6 +501,8 @@ end %changelog * Mon Feb 21 2022 Jarek Prokop - 2.2.19-3 - Fix FTBFS due to new rspec-mocks. +- Relax required ruby version. + Resolves: rhbz#2053476 * Sat Jan 22 2022 Fedora Release Engineering - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild From 61abdd780241ab2ac6aaa09597ece815564868bd Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Fri, 11 Mar 2022 01:51:11 +0100 Subject: [PATCH 64/83] Add missing dependency on bin/ps Without it: ______________________________________________________ $ vagrant up Bringing machine 'default' up with 'libvirt' provider... The executable 'ps' Vagrant is trying to run was not found in the PATH variable. This is an error. Please verify this software is installed and on the path. ______________________________________________________ --- vagrant.spec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/vagrant.spec b/vagrant.spec index 412ccab..8eb1791 100644 --- a/vagrant.spec +++ b/vagrant.spec @@ -7,7 +7,7 @@ Name: vagrant Version: 2.2.19 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Build and distribute virtualized development environments License: MIT URL: http://vagrantup.com @@ -55,6 +55,7 @@ Requires: rubygem(rubyzip) >= 1.1.7 Requires: rubygem(net-ftp) Requires: bsdtar Requires: curl +Requires: %{_bindir}/ps Recommends: vagrant(vagrant-libvirt) Recommends: rubygem(bcrypt_pbkdf) @@ -499,6 +500,9 @@ end %{vagrant_plugin_instdir}/vagrant-spec.config.example.rb %changelog +* Fri Mar 11 2022 Pavel Valena - 2.2.19-4 +- Add missing dependency on bin/ps + * Mon Feb 21 2022 Jarek Prokop - 2.2.19-3 - Fix FTBFS due to new rspec-mocks. - Relax required ruby version. From e781282c4e85f4111b5a705852daf084ad8b831f Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 23 Jul 2022 11:38:12 +0000 Subject: [PATCH 65/83] Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- vagrant.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vagrant.spec b/vagrant.spec index 8eb1791..dfa63c5 100644 --- a/vagrant.spec +++ b/vagrant.spec @@ -7,7 +7,7 @@ Name: vagrant Version: 2.2.19 -Release: 4%{?dist} +Release: 5%{?dist} Summary: Build and distribute virtualized development environments License: MIT URL: http://vagrantup.com @@ -500,6 +500,9 @@ end %{vagrant_plugin_instdir}/vagrant-spec.config.example.rb %changelog +* Sat Jul 23 2022 Fedora Release Engineering +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + * Fri Mar 11 2022 Pavel Valena - 2.2.19-4 - Add missing dependency on bin/ps From 43092b81b63fd3f83fed7a9015d382eb48f7013e Mon Sep 17 00:00:00 2001 From: Mamoru TASAKA Date: Mon, 26 Dec 2022 16:49:25 +0900 Subject: [PATCH 66/83] Backport upstream fix for ruby3.2 File.exists? removal Apply proposal fix for ruby3.2 Object#=~ removal --- ...-ruby32-File_exists-removal-zsh-test.patch | 38 ++++++ ...t-pr12913-ruby32-File_exists-removal.patch | 110 ++++++++++++++++++ ...34-ruby32-object-regex-match-removal.patch | 41 +++++++ vagrant.spec | 18 ++- 4 files changed, 206 insertions(+), 1 deletion(-) create mode 100644 vagrant-2.2.3-ruby32-File_exists-removal-zsh-test.patch create mode 100644 vagrant-pr12913-ruby32-File_exists-removal.patch create mode 100644 vagrant-pr13034-ruby32-object-regex-match-removal.patch diff --git a/vagrant-2.2.3-ruby32-File_exists-removal-zsh-test.patch b/vagrant-2.2.3-ruby32-File_exists-removal-zsh-test.patch new file mode 100644 index 0000000..7c4a732 --- /dev/null +++ b/vagrant-2.2.3-ruby32-File_exists-removal-zsh-test.patch @@ -0,0 +1,38 @@ +From 2fe4056a7dcf96dd894875b02032a988777e05d4 Mon Sep 17 00:00:00 2001 +From: Chris Roberts +Date: Mon, 14 Nov 2022 10:11:00 -0800 +Subject: [PATCH] Fix test using `File.exists?` to use non-deprecated name + +--- + test/unit/vagrant/util/install_cli_autocomplete_test.rb | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/test/unit/vagrant/util/install_cli_autocomplete_test.rb b/test/unit/vagrant/util/install_cli_autocomplete_test.rb +index a62c065ddce..330b8b44805 100644 +--- a/test/unit/vagrant/util/install_cli_autocomplete_test.rb ++++ b/test/unit/vagrant/util/install_cli_autocomplete_test.rb +@@ -12,7 +12,7 @@ + + describe "#shell_installed" do + it "should return path to config file if exists" do +- allow(File).to receive(:exists?).with(target_file).and_return(true) ++ allow(File).to receive(:exist?).with(target_file).and_return(true) + expect(subject.shell_installed(home)).to eq(target_file) + end + +@@ -36,7 +36,7 @@ + + describe "#install" do + it "installs autocomplete" do +- allow(File).to receive(:exists?).with(target_file).and_return(true) ++ allow(File).to receive(:exist?).with(target_file).and_return(true) + allow(File).to receive(:foreach).with(target_file).and_yield("nothing") + expect(File).to receive(:open).with(target_file, "a") + subject.install(home) +@@ -67,4 +67,4 @@ + expect{ subject.install(["oops"]) }.to raise_error(ArgumentError) + end + end +-end +\ No newline at end of file ++end diff --git a/vagrant-pr12913-ruby32-File_exists-removal.patch b/vagrant-pr12913-ruby32-File_exists-removal.patch new file mode 100644 index 0000000..1f44dd6 --- /dev/null +++ b/vagrant-pr12913-ruby32-File_exists-removal.patch @@ -0,0 +1,110 @@ +From 6f9f88e05557d40570a3885b6d3d3a6a24c06090 Mon Sep 17 00:00:00 2001 +From: Nicolas St-Laurent +Date: Thu, 22 Sep 2022 08:54:46 -0400 +Subject: [PATCH] Replace deprecated File.exists? with File.exist?. + +--- + lib/vagrant/util/install_cli_autocomplete.rb | 2 +- + plugins/hosts/gentoo/host.rb | 2 +- + plugins/hosts/slackware/host.rb | 2 +- + plugins/provisioners/ansible/provisioner/host.rb | 2 +- + plugins/provisioners/chef/config/chef_zero.rb | 2 +- + test/unit/plugins/provisioners/ansible/provisioner_test.rb | 6 +++--- + 6 files changed, 8 insertions(+), 8 deletions(-) + +diff --git a/lib/vagrant/util/install_cli_autocomplete.rb b/lib/vagrant/util/install_cli_autocomplete.rb +index 9aaf61a1de2..119749e0f08 100644 +--- a/lib/vagrant/util/install_cli_autocomplete.rb ++++ b/lib/vagrant/util/install_cli_autocomplete.rb +@@ -29,7 +29,7 @@ def shell_installed(home) + @logger.info("Searching for config in home #{home}") + @config_paths.each do |path| + config_file = File.join(home, path) +- if File.exists?(config_file) ++ if File.exist?(config_file) + @logger.info("Found config file #{config_file}") + return config_file + end +diff --git a/plugins/hosts/gentoo/host.rb b/plugins/hosts/gentoo/host.rb +index ac7e019d045..6d8b88a6a35 100644 +--- a/plugins/hosts/gentoo/host.rb ++++ b/plugins/hosts/gentoo/host.rb +@@ -4,7 +4,7 @@ module VagrantPlugins + module HostGentoo + class Host < Vagrant.plugin("2", :host) + def detect?(env) +- File.exists?("/etc/gentoo-release") ++ File.exist?("/etc/gentoo-release") + end + end + end +diff --git a/plugins/hosts/slackware/host.rb b/plugins/hosts/slackware/host.rb +index ec3503ac02e..bea7cab7476 100644 +--- a/plugins/hosts/slackware/host.rb ++++ b/plugins/hosts/slackware/host.rb +@@ -4,7 +4,7 @@ module VagrantPlugins + module HostSlackware + class Host < Vagrant.plugin("2", :host) + def detect?(env) +- return File.exists?("/etc/slackware-version") || ++ return File.exist?("/etc/slackware-version") || + !Dir.glob("/usr/lib/setup/Plamo-*").empty? + end + end +diff --git a/plugins/provisioners/ansible/provisioner/host.rb b/plugins/provisioners/ansible/provisioner/host.rb +index 3e594b83c11..f2a57133c79 100644 +--- a/plugins/provisioners/ansible/provisioner/host.rb ++++ b/plugins/provisioners/ansible/provisioner/host.rb +@@ -185,7 +185,7 @@ def ship_generated_inventory(inventory_content) + + inventory_file = Pathname.new(File.join(inventory_path, 'vagrant_ansible_inventory')) + @@lock.synchronize do +- if !File.exists?(inventory_file) or inventory_content != File.read(inventory_file) ++ if !File.exist?(inventory_file) or inventory_content != File.read(inventory_file) + begin + # ansible dir inventory will ignore files starting with '.' + inventory_tmpfile = Tempfile.new('.vagrant_ansible_inventory', inventory_path) +diff --git a/plugins/provisioners/chef/config/chef_zero.rb b/plugins/provisioners/chef/config/chef_zero.rb +index c19485f882e..84ed08cf5b2 100644 +--- a/plugins/provisioners/chef/config/chef_zero.rb ++++ b/plugins/provisioners/chef/config/chef_zero.rb +@@ -81,7 +81,7 @@ def validate(machine) + errors << I18n.t("vagrant.config.chef.nodes_path_empty") + else + missing_paths = Array.new +- nodes_path.each { |dir| missing_paths << dir[1] if !File.exists? dir[1] } ++ nodes_path.each { |dir| missing_paths << dir[1] if !File.exist? dir[1] } + # If it exists at least one path on disk it's ok for Chef provisioning + if missing_paths.size == nodes_path.size + errors << I18n.t("vagrant.config.chef.nodes_path_missing", path: missing_paths.to_s) +diff --git a/test/unit/plugins/provisioners/ansible/provisioner_test.rb b/test/unit/plugins/provisioners/ansible/provisioner_test.rb +index 180f26869bb..f5828f14340 100644 +--- a/test/unit/plugins/provisioners/ansible/provisioner_test.rb ++++ b/test/unit/plugins/provisioners/ansible/provisioner_test.rb +@@ -181,7 +181,7 @@ def self.it_should_create_and_use_generated_inventory(with_user = true) + it "generates an inventory with all active machines" do + expect(Vagrant::Util::Subprocess).to receive(:execute).with('ansible-playbook', any_args) { |*args| + expect(config.inventory_path).to be_nil +- expect(File.exists?(generated_inventory_file)).to be(true) ++ expect(File.exist?(generated_inventory_file)).to be(true) + inventory_content = File.read(generated_inventory_file) + _ssh = config.compatibility_mode == VagrantPlugins::Ansible::COMPATIBILITY_MODE_V2_0 ? "" : "_ssh" + if with_user +@@ -697,7 +697,7 @@ def ensure_that_config_is_valid + it "generates an inventory with winrm connection settings" do + expect(Vagrant::Util::Subprocess).to receive(:execute).with('ansible-playbook', any_args) { |*args| + expect(config.inventory_path).to be_nil +- expect(File.exists?(generated_inventory_file)).to be(true) ++ expect(File.exist?(generated_inventory_file)).to be(true) + inventory_content = File.read(generated_inventory_file) + + expect(inventory_content).to include("machine1 ansible_connection=winrm ansible_ssh_host=127.0.0.1 ansible_ssh_port=55986 ansible_ssh_user='winner' ansible_ssh_pass='winword'\n") +@@ -731,7 +731,7 @@ def ensure_that_config_is_valid + expect(Vagrant::Util::Subprocess).to receive(:execute).with('ansible-playbook', any_args) { |*args| + expect(args).to include("--inventory-file=#{existing_file}") + expect(args).not_to include("--inventory-file=#{generated_inventory_file}") +- expect(File.exists?(generated_inventory_file)).to be(false) ++ expect(File.exist?(generated_inventory_file)).to be(false) + }.and_return(default_execute_result) + end + diff --git a/vagrant-pr13034-ruby32-object-regex-match-removal.patch b/vagrant-pr13034-ruby32-object-regex-match-removal.patch new file mode 100644 index 0000000..f8af034 --- /dev/null +++ b/vagrant-pr13034-ruby32-object-regex-match-removal.patch @@ -0,0 +1,41 @@ +From 1dd089fc97e44066982cec62b8264dd03b1df531 Mon Sep 17 00:00:00 2001 +From: Mamoru TASAKA +Date: Tue, 20 Dec 2022 23:27:59 +0900 +Subject: [PATCH] ansible/provisioner_test: fix for ruby32 Kernel#=~ removal + +Kernel#=~ has done nothing and just has returned nil, and +now with ruby3.2 this deprecated method is removed. + +So for $ bundle exec rake under ruby 3.2, check if variable +really accepts =~ method first. + +Fixes #13028 . +--- + test/unit/plugins/provisioners/ansible/provisioner_test.rb | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/test/unit/plugins/provisioners/ansible/provisioner_test.rb b/test/unit/plugins/provisioners/ansible/provisioner_test.rb +index f5828f14340..15fb3bbdcf1 100644 +--- a/test/unit/plugins/provisioners/ansible/provisioner_test.rb ++++ b/test/unit/plugins/provisioners/ansible/provisioner_test.rb +@@ -91,7 +91,7 @@ def self.it_should_set_arguments_and_environment_variables( + expect(args[1]).to eq("--connection=ssh") + expect(args[2]).to eq("--timeout=30") + +- inventory_count = args.count { |x| x =~ /^--inventory-file=.+$/ } ++ inventory_count = args.count { |x| x.respond_to?(:=~) && x =~ /^--inventory-file=.+$/ } + expect(inventory_count).to be > 0 + + expect(args[args.length-2]).to eq("playbook.yml") +@@ -100,9 +100,9 @@ def self.it_should_set_arguments_and_environment_variables( + + it "sets --limit argument" do + expect(Vagrant::Util::Subprocess).to receive(:execute).with('ansible-playbook', any_args) { |*args| +- all_limits = args.select { |x| x =~ /^(--limit=|-l)/ } ++ all_limits = args.select { |x| x.respond_to?(:=~) && x =~ /^(--limit=|-l)/ } + if config.raw_arguments +- raw_limits = config.raw_arguments.select { |x| x =~ /^(--limit=|-l)/ } ++ raw_limits = config.raw_arguments.select { |x| x.respond_to?(:=~) && x =~ /^(--limit=|-l)/ } + expect(all_limits.length - raw_limits.length).to eq(1) + expect(all_limits.last).to eq(raw_limits.last) + else diff --git a/vagrant.spec b/vagrant.spec index dfa63c5..ae0be77 100644 --- a/vagrant.spec +++ b/vagrant.spec @@ -7,7 +7,7 @@ Name: vagrant Version: 2.2.19 -Release: 5%{?dist} +Release: 6%{?dist} Summary: Build and distribute virtualized development environments License: MIT URL: http://vagrantup.com @@ -31,6 +31,15 @@ Patch1: vagrant-2.2.9-do-not-load-dependencies.patch # Fix spec test suite for new rspec-mocks. # https://github.com/hashicorp/vagrant/pull/12699 Patch2: vagrant-2.2.19-fix-3.1-compatibility.patch +# ruby3.2 removes Object#=~ +# https://github.com/hashicorp/vagrant/pull/13034 (currently under review) +Patch3: vagrant-pr13034-ruby32-object-regex-match-removal.patch +# ruby3.2 removes File.exists +# https://github.com/hashicorp/vagrant/pull/12913 +Patch4: vagrant-pr12913-ruby32-File_exists-removal.patch +# and also one more fix for File.exists-removal +# https://github.com/hashicorp/vagrant/commit/2fe4056a7dcf96dd894875b02032a988777e05d4 +Patch5: vagrant-2.2.3-ruby32-File_exists-removal-zsh-test.patch # The load directive is supported since RPM 4.12, i.e. F21+. The build process # fails on older Fedoras. @@ -125,6 +134,9 @@ Documentation for %{name}. %patch0 -p1 %patch2 -p1 +%patch3 -p1 +%patch4 -p1 +%patch5 -p1 # TODO: package vagrant_cloud, as it is not in Fedora yet %gemspec_remove_dep -s %{name}.gemspec -g vagrant_cloud @@ -500,6 +512,10 @@ end %{vagrant_plugin_instdir}/vagrant-spec.config.example.rb %changelog +* Mon Dec 26 2022 Mamoru TASAKA - 2.2.19-6 +- Backport upstream fix for ruby3.2 File.exists? removal +- Apply proposal fix for ruby3.2 Object#=~ removal + * Sat Jul 23 2022 Fedora Release Engineering - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild From d06302793543b2f3667aaafa3182928c0c045342 Mon Sep 17 00:00:00 2001 From: Mamoru TASAKA Date: Fri, 6 Jan 2023 21:38:47 +0900 Subject: [PATCH 67/83] Replace regex match patch with the one by the upstream --- ...43-ruby32-object-regex-match-removal.patch | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) rename vagrant-pr13034-ruby32-object-regex-match-removal.patch => vagrant-pr13043-ruby32-object-regex-match-removal.patch (62%) diff --git a/vagrant-pr13034-ruby32-object-regex-match-removal.patch b/vagrant-pr13043-ruby32-object-regex-match-removal.patch similarity index 62% rename from vagrant-pr13034-ruby32-object-regex-match-removal.patch rename to vagrant-pr13043-ruby32-object-regex-match-removal.patch index f8af034..a78c2a1 100644 --- a/vagrant-pr13034-ruby32-object-regex-match-removal.patch +++ b/vagrant-pr13043-ruby32-object-regex-match-removal.patch @@ -1,21 +1,19 @@ -From 1dd089fc97e44066982cec62b8264dd03b1df531 Mon Sep 17 00:00:00 2001 -From: Mamoru TASAKA -Date: Tue, 20 Dec 2022 23:27:59 +0900 -Subject: [PATCH] ansible/provisioner_test: fix for ruby32 Kernel#=~ removal +From 9743c857481556838ee417a0033efdee3fb0c7fc Mon Sep 17 00:00:00 2001 +From: sophia +Date: Tue, 3 Jan 2023 13:20:14 -0800 +Subject: [PATCH 4/5] Only check for arguments matching test string if the + argument is a string -Kernel#=~ has done nothing and just has returned nil, and -now with ruby3.2 this deprecated method is removed. +This issue surfaced in the tests after updating to Ruby 3.2.0 where +the =~ operator has been removed. -So for $ bundle exec rake under ruby 3.2, check if variable -really accepts =~ method first. - -Fixes #13028 . +ref: https://github.com/ruby/ruby/blob/cca54c8b1b71072bb07850c9d3f20b261d3b312c/NEWS.md?plain=1#L498 --- test/unit/plugins/provisioners/ansible/provisioner_test.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/unit/plugins/provisioners/ansible/provisioner_test.rb b/test/unit/plugins/provisioners/ansible/provisioner_test.rb -index f5828f14340..15fb3bbdcf1 100644 +index f5828f14340..fdf9aa67eaa 100644 --- a/test/unit/plugins/provisioners/ansible/provisioner_test.rb +++ b/test/unit/plugins/provisioners/ansible/provisioner_test.rb @@ -91,7 +91,7 @@ def self.it_should_set_arguments_and_environment_variables( @@ -23,7 +21,7 @@ index f5828f14340..15fb3bbdcf1 100644 expect(args[2]).to eq("--timeout=30") - inventory_count = args.count { |x| x =~ /^--inventory-file=.+$/ } -+ inventory_count = args.count { |x| x.respond_to?(:=~) && x =~ /^--inventory-file=.+$/ } ++ inventory_count = args.count { |x| x.match(/^--inventory-file=.+$/) if x.is_a?(String) } expect(inventory_count).to be > 0 expect(args[args.length-2]).to eq("playbook.yml") @@ -32,10 +30,12 @@ index f5828f14340..15fb3bbdcf1 100644 it "sets --limit argument" do expect(Vagrant::Util::Subprocess).to receive(:execute).with('ansible-playbook', any_args) { |*args| - all_limits = args.select { |x| x =~ /^(--limit=|-l)/ } -+ all_limits = args.select { |x| x.respond_to?(:=~) && x =~ /^(--limit=|-l)/ } ++ all_limits = args.select { |x| x.match(/^(--limit=|-l)/) if x.is_a?(String) } if config.raw_arguments - raw_limits = config.raw_arguments.select { |x| x =~ /^(--limit=|-l)/ } -+ raw_limits = config.raw_arguments.select { |x| x.respond_to?(:=~) && x =~ /^(--limit=|-l)/ } ++ raw_limits = config.raw_arguments.select { |x| x.match(/^(--limit=|-l)/) if x.is_a?(String) } expect(all_limits.length - raw_limits.length).to eq(1) expect(all_limits.last).to eq(raw_limits.last) else + + From 4e823ef39dd50ee7dd2fc34580cf98e73b119a8c Mon Sep 17 00:00:00 2001 From: Mamoru TASAKA Date: Fri, 6 Jan 2023 21:40:18 +0900 Subject: [PATCH 68/83] add spec file change --- vagrant.spec | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/vagrant.spec b/vagrant.spec index ae0be77..49b4694 100644 --- a/vagrant.spec +++ b/vagrant.spec @@ -7,7 +7,7 @@ Name: vagrant Version: 2.2.19 -Release: 6%{?dist} +Release: 7%{?dist} Summary: Build and distribute virtualized development environments License: MIT URL: http://vagrantup.com @@ -32,8 +32,8 @@ Patch1: vagrant-2.2.9-do-not-load-dependencies.patch # https://github.com/hashicorp/vagrant/pull/12699 Patch2: vagrant-2.2.19-fix-3.1-compatibility.patch # ruby3.2 removes Object#=~ -# https://github.com/hashicorp/vagrant/pull/13034 (currently under review) -Patch3: vagrant-pr13034-ruby32-object-regex-match-removal.patch +# https://github.com/hashicorp/vagrant/pull/13043 , extracted minimum required change +Patch3: vagrant-pr13043-ruby32-object-regex-match-removal.patch # ruby3.2 removes File.exists # https://github.com/hashicorp/vagrant/pull/12913 Patch4: vagrant-pr12913-ruby32-File_exists-removal.patch @@ -512,6 +512,9 @@ end %{vagrant_plugin_instdir}/vagrant-spec.config.example.rb %changelog +* Fri Jan 6 2023 Mamoru TASAKA - 2.2.19-7 +- Replace regex match patch with the one by the upstream + * Mon Dec 26 2022 Mamoru TASAKA - 2.2.19-6 - Backport upstream fix for ruby3.2 File.exists? removal - Apply proposal fix for ruby3.2 Object#=~ removal From fb5d878e411b34d942c7301cbd33a3c740244b57 Mon Sep 17 00:00:00 2001 From: Jarek Prokop Date: Thu, 15 Dec 2022 15:24:36 +0100 Subject: [PATCH 69/83] Enable rubygem-ed25519 requires. The gem is available in Fedora. Group the bcrypt_pbkdf with ed25519 as the ed25519 implementation depends on that gem. Resolves: rhbz#1962869 --- vagrant.spec | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/vagrant.spec b/vagrant.spec index 49b4694..5f48f7d 100644 --- a/vagrant.spec +++ b/vagrant.spec @@ -3,11 +3,11 @@ %global vagrant_spec_commit 03d88fe2467716b072951c2b55d78223130851a6 %bcond_without help2man -%bcond_with ed25519 +%bcond_without ed25519 Name: vagrant Version: 2.2.19 -Release: 7%{?dist} +Release: 8%{?dist} Summary: Build and distribute virtualized development environments License: MIT URL: http://vagrantup.com @@ -67,14 +67,16 @@ Requires: curl Requires: %{_bindir}/ps Recommends: vagrant(vagrant-libvirt) -Recommends: rubygem(bcrypt_pbkdf) Recommends: (podman-docker if podman) %if %{with ed25519} Requires: rubygem(ed25519) +Requires: rubygem(bcrypt_pbkdf) BuildRequires: rubygem(ed25519) +BuildRequires: rubygem(bcrypt_pbkdf) %else Recommends: rubygem(ed25519) +Recommends: rubygem(bcrypt_pbkdf) %endif BuildRequires: bsdtar @@ -179,9 +181,6 @@ sed -i -e '/required_ruby_version/ s/, "< 3.1"//' %{name}.gemspec %gemspec_remove_dep -s %{name}.gemspec -g net-ssh %gemspec_add_dep -s %{name}.gemspec -g net-ssh ['>= 5.2.0', '< 7'] -# Remove optional dependencies -%gemspec_remove_dep -s %{name}.gemspec -g bcrypt_pbkdf - # Load missing dependency Vagrant::Util::MapCommandOptions # https://github.com/hashicorp/vagrant/pull/11609 sed -i '/^\s*require..vagrant.util.experimental.\s*$/ a\require "vagrant/util/map_command_options"' \ @@ -192,10 +191,16 @@ sed -i 's/^if Net::SSH::Version::STRING.*$/if true/' \ lib/vagrant/patches/net-ssh.rb %if %{without ed25519} +# Remove optional dependencies +%gemspec_remove_dep -s %{name}.gemspec -g bcrypt_pbkdf + %gemspec_remove_dep -s %{name}.gemspec -g ed25519 # Disable patch for ed25519 sed -i '/^ require .net\/ssh\/authentication\/ed25519.$/,/^ end$/ s/^/#/' \ lib/vagrant/patches/net-ssh.rb +%else +%gemspec_remove_dep -s %{name}.gemspec -g ed25519 +%gemspec_add_dep -s %{name}.gemspec -g ed25519 ['>= 1.2.4', '< 1.4'] %endif %build @@ -512,6 +517,10 @@ end %{vagrant_plugin_instdir}/vagrant-spec.config.example.rb %changelog +* Mon Jan 09 2023 Jarek Prokop - 2.2.19-8 +- Enable rubygem-ed25519 requires. + Resolves: rhbz#1962869 + * Fri Jan 6 2023 Mamoru TASAKA - 2.2.19-7 - Replace regex match patch with the one by the upstream From b9bccaf626d8ecd519a47f0bb59238cefac690cc Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 21 Jan 2023 06:03:56 +0000 Subject: [PATCH 70/83] Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- vagrant.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vagrant.spec b/vagrant.spec index 5f48f7d..459476b 100644 --- a/vagrant.spec +++ b/vagrant.spec @@ -7,7 +7,7 @@ Name: vagrant Version: 2.2.19 -Release: 8%{?dist} +Release: 9%{?dist} Summary: Build and distribute virtualized development environments License: MIT URL: http://vagrantup.com @@ -517,6 +517,9 @@ end %{vagrant_plugin_instdir}/vagrant-spec.config.example.rb %changelog +* Sat Jan 21 2023 Fedora Release Engineering +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + * Mon Jan 09 2023 Jarek Prokop - 2.2.19-8 - Enable rubygem-ed25519 requires. Resolves: rhbz#1962869 From 5f94d1453b60395f6c31a1912b8c66cd11cc4e1a Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Thu, 16 Mar 2023 18:04:04 +0100 Subject: [PATCH 71/83] Prevent trailing space character on user agent https://github.com/hashicorp/vagrant/pull/12925/ Resolves: rhbz#2177215 --- vagrant-2.3.1-Fix-downloader-user-agent.patch | 21 +++++++++++++++++++ vagrant.spec | 10 ++++++++- 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 vagrant-2.3.1-Fix-downloader-user-agent.patch diff --git a/vagrant-2.3.1-Fix-downloader-user-agent.patch b/vagrant-2.3.1-Fix-downloader-user-agent.patch new file mode 100644 index 0000000..6085623 --- /dev/null +++ b/vagrant-2.3.1-Fix-downloader-user-agent.patch @@ -0,0 +1,21 @@ +From c7ef689d86294bcdb8ae5d31ddabcba416e3382d Mon Sep 17 00:00:00 2001 +From: Chris Roberts +Date: Wed, 28 Sep 2022 13:51:54 -0700 +Subject: [PATCH] Prevent trailing space character on user agent + +--- + lib/vagrant/util/downloader.rb | 2 +- + +diff --git a/lib/vagrant/util/downloader.rb b/lib/vagrant/util/downloader.rb +index eee9744e74f..a7daf9684b7 100644 +--- a/lib/vagrant/util/downloader.rb ++++ b/lib/vagrant/util/downloader.rb +@@ -21,7 +21,7 @@ class Downloader + # are properly tracked. + # + # Vagrant/1.7.4 (+https://www.vagrantup.com; ruby2.1.0) +- USER_AGENT = "Vagrant/#{VERSION} (+https://www.vagrantup.com; #{RUBY_ENGINE}#{RUBY_VERSION}) #{ENV['VAGRANT_USER_AGENT_PROVISIONAL_STRING']}".freeze ++ USER_AGENT = "Vagrant/#{VERSION} (+https://www.vagrantup.com; #{RUBY_ENGINE}#{RUBY_VERSION}) #{ENV['VAGRANT_USER_AGENT_PROVISIONAL_STRING']}".strip.freeze + + # Hosts that do not require notification on redirect + SILENCED_HOSTS = [ diff --git a/vagrant.spec b/vagrant.spec index 459476b..6e61490 100644 --- a/vagrant.spec +++ b/vagrant.spec @@ -7,7 +7,7 @@ Name: vagrant Version: 2.2.19 -Release: 9%{?dist} +Release: 10%{?dist} Summary: Build and distribute virtualized development environments License: MIT URL: http://vagrantup.com @@ -40,6 +40,10 @@ Patch4: vagrant-pr12913-ruby32-File_exists-removal.patch # and also one more fix for File.exists-removal # https://github.com/hashicorp/vagrant/commit/2fe4056a7dcf96dd894875b02032a988777e05d4 Patch5: vagrant-2.2.3-ruby32-File_exists-removal-zsh-test.patch +# Prevent trailing space character on user agent +# https://bugzilla.redhat.com/show_bug.cgi?id=2177215 +# https://github.com/hashicorp/vagrant/pull/12925/ +Patch6: vagrant-2.3.1-Fix-downloader-user-agent.patch # The load directive is supported since RPM 4.12, i.e. F21+. The build process # fails on older Fedoras. @@ -139,6 +143,7 @@ Documentation for %{name}. %patch3 -p1 %patch4 -p1 %patch5 -p1 +%patch6 -p1 # TODO: package vagrant_cloud, as it is not in Fedora yet %gemspec_remove_dep -s %{name}.gemspec -g vagrant_cloud @@ -517,6 +522,9 @@ end %{vagrant_plugin_instdir}/vagrant-spec.config.example.rb %changelog +* Thu Mar 16 2023 Pavel Valena - 2.2.19-10 +- Handle URL properly + * Sat Jan 21 2023 Fedora Release Engineering - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild From 9132acfcfcec68437e957fe3c2b13d5d0df24d3f Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Thu, 29 Sep 2022 22:52:30 +0200 Subject: [PATCH 72/83] Upgrade to Vagrant 2.3.0 also upgrade vagrant-spec to newest commit. --- vagrant-2.2.19-fix-3.1-compatibility.patch | 72 ------------------- ...2.3-Fix-fake_ftp-0.3.x-compatibility.patch | 52 -------------- vagrant.spec | 40 +++-------- 3 files changed, 11 insertions(+), 153 deletions(-) delete mode 100644 vagrant-2.2.19-fix-3.1-compatibility.patch delete mode 100644 vagrant-2.2.3-Fix-fake_ftp-0.3.x-compatibility.patch diff --git a/vagrant-2.2.19-fix-3.1-compatibility.patch b/vagrant-2.2.19-fix-3.1-compatibility.patch deleted file mode 100644 index 2056f71..0000000 --- a/vagrant-2.2.19-fix-3.1-compatibility.patch +++ /dev/null @@ -1,72 +0,0 @@ -From 2b1c25d247aba492e582a01cff8ecdd33d4d165b Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Dan=20=C4=8Cerm=C3=A1k?= -Date: Mon, 28 Feb 2022 10:46:17 +0100 -Subject: [PATCH 1/2] Stop using the last argument as kwargs in unit tests - -A few unit tests started failing with Ruby 3.0, because they were relying on -keyword arguments being converted into hashes automatically. This behavior was -deprecated in Ruby 2.7 and results in errors in Ruby 3.0 onward. - -For further details: -https://rubyreferences.github.io/rubychanges/3.0.html#keyword-arguments-are-now-fully-separated-from-positional-arguments ---- - test/unit/plugins/commands/package/command_test.rb | 4 ++-- - .../plugins/providers/hyperv/action/read_guest_ip_test.rb | 2 +- - test/unit/vagrant/ui_test.rb | 4 ++-- - 3 files changed, 5 insertions(+), 5 deletions(-) - -diff --git a/test/unit/plugins/commands/package/command_test.rb b/test/unit/plugins/commands/package/command_test.rb -index 7b289bd1e3a..d0f81393bf6 100644 ---- a/test/unit/plugins/commands/package/command_test.rb -+++ b/test/unit/plugins/commands/package/command_test.rb -@@ -64,7 +64,7 @@ - - it "packages default machine inside specified folder" do - expect(package_command).to receive(:package_vm).with( -- a_machine_named('default'), :output => "package-output-folder/default" -+ a_machine_named('default'), { output: "package-output-folder/default" } - ) - package_command.execute - end -@@ -96,7 +96,7 @@ - let(:argv){ ['--base', 'machine-id'] } - - it "packages vm defined within virtualbox" do -- expect(package_command).to receive(:package_base).with(:base => 'machine-id') -+ expect(package_command).to receive(:package_base).with({ base: 'machine-id' }) - package_command.execute - end - -diff --git a/test/unit/plugins/providers/hyperv/action/read_guest_ip_test.rb b/test/unit/plugins/providers/hyperv/action/read_guest_ip_test.rb -index 5642c6271f1..ecce003a602 100644 ---- a/test/unit/plugins/providers/hyperv/action/read_guest_ip_test.rb -+++ b/test/unit/plugins/providers/hyperv/action/read_guest_ip_test.rb -@@ -31,7 +31,7 @@ - end - - it "should set the host information into the env" do -- expect(env).to receive(:[]=).with(:machine_ssh_info, host: "ADDRESS") -+ expect(env).to receive(:[]=).with(:machine_ssh_info, { host: "ADDRESS" }) - expect(driver).to receive(:read_guest_ip).and_return("ip" => "ADDRESS") - subject.call(env) - end -diff --git a/test/unit/vagrant/ui_test.rb b/test/unit/vagrant/ui_test.rb -index e484b81543b..120b1dda2a6 100644 ---- a/test/unit/vagrant/ui_test.rb -+++ b/test/unit/vagrant/ui_test.rb -@@ -379,12 +379,12 @@ - - describe "#machine" do - it "sets the target option" do -- expect(ui).to receive(:machine).with(:foo, target: prefix) -+ expect(ui).to receive(:machine).with(:foo, { target: prefix }) - subject.machine(:foo) - end - - it "preserves existing options" do -- expect(ui).to receive(:machine).with(:foo, :bar, foo: :bar, target: prefix) -+ expect(ui).to receive(:machine).with(:foo, :bar, { foo: :bar, target: prefix }) - subject.machine(:foo, :bar, foo: :bar) - end - end - diff --git a/vagrant-2.2.3-Fix-fake_ftp-0.3.x-compatibility.patch b/vagrant-2.2.3-Fix-fake_ftp-0.3.x-compatibility.patch deleted file mode 100644 index 3b4b484..0000000 --- a/vagrant-2.2.3-Fix-fake_ftp-0.3.x-compatibility.patch +++ /dev/null @@ -1,52 +0,0 @@ -From 60214f4f66ef4fb864aa535c6dccfe5a8b197de8 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?V=C3=ADt=20Ondruch?= -Date: Tue, 26 Feb 2019 12:17:44 +0100 -Subject: [PATCH] Fix fake_ftp 0.3.x compatibility. - -fake_ftp introduced support direcotry support, which changes the -behavior: - -https://github.com/livinginthepast/fake_ftp/pull/42 ---- - test/unit/plugins/pushes/ftp/adapter_test.rb | 4 ++-- - test/unit/plugins/pushes/ftp/push_test.rb | 2 +- - 2 files changed, 3 insertions(+), 3 deletions(-) - -diff --git a/test/unit/plugins/pushes/ftp/adapter_test.rb b/test/unit/plugins/pushes/ftp/adapter_test.rb -index 93888f840..a92cc7422 100644 ---- a/test/unit/plugins/pushes/ftp/adapter_test.rb -+++ b/test/unit/plugins/pushes/ftp/adapter_test.rb -@@ -77,7 +77,7 @@ describe VagrantPlugins::FTPPush::FTPAdapter do - ftp.upload("#{@dir}/file", "/file") - end - -- expect(server.files).to include("file") -+ expect(server.files).to include("/file") - end - - it "uploads in passive mode" do -@@ -86,7 +86,7 @@ describe VagrantPlugins::FTPPush::FTPAdapter do - ftp.upload("#{@dir}/file", "/file") - end - -- expect(server.file("file")).to be_passive -+ expect(server.file("/file")).to be_passive - end - end - end -diff --git a/test/unit/plugins/pushes/ftp/push_test.rb b/test/unit/plugins/pushes/ftp/push_test.rb -index 83509fb7d..49c08da6f 100644 ---- a/test/unit/plugins/pushes/ftp/push_test.rb -+++ b/test/unit/plugins/pushes/ftp/push_test.rb -@@ -71,7 +71,7 @@ describe VagrantPlugins::FTPPush::Push do - - it "pushes the files to the server" do - subject.push -- expect(server.files).to eq(%w(Gemfile data.txt)) -+ expect(server.files).to eq(%w(/var/www/site/Gemfile /var/www/site/data.txt)) - end - - it "raises informative exception when too many files to process" do --- -2.20.1 - diff --git a/vagrant.spec b/vagrant.spec index 6e61490..834f964 100644 --- a/vagrant.spec +++ b/vagrant.spec @@ -1,13 +1,13 @@ %global bashcompletion_dir %(pkg-config --variable=completionsdir bash-completion 2> /dev/null || :) -%global vagrant_spec_commit 03d88fe2467716b072951c2b55d78223130851a6 +%global vagrant_spec_commit a88825f4cb254b703d0f9235667223f02ad5c600 %bcond_without help2man %bcond_without ed25519 Name: vagrant -Version: 2.2.19 -Release: 10%{?dist} +Version: 2.3.0 +Release: 1%{?dist} Summary: Build and distribute virtualized development environments License: MIT URL: http://vagrantup.com @@ -22,28 +22,9 @@ Source2: https://github.com/hashicorp/%{name}-spec/archive/%{vagrant_spec_commit # for RubyGems and Bundler are in place Source4: macros.vagrant -# Fix fake_ftp 0.3.x compatibility. -# https://github.com/hashicorp/vagrant/issues/10646 -Patch0: vagrant-2.2.3-Fix-fake_ftp-0.3.x-compatibility.patch # Do not load runtime dependencies in %%check if vagrant is not loaded # https://github.com/hashicorp/vagrant/pull/10945 Patch1: vagrant-2.2.9-do-not-load-dependencies.patch -# Fix spec test suite for new rspec-mocks. -# https://github.com/hashicorp/vagrant/pull/12699 -Patch2: vagrant-2.2.19-fix-3.1-compatibility.patch -# ruby3.2 removes Object#=~ -# https://github.com/hashicorp/vagrant/pull/13043 , extracted minimum required change -Patch3: vagrant-pr13043-ruby32-object-regex-match-removal.patch -# ruby3.2 removes File.exists -# https://github.com/hashicorp/vagrant/pull/12913 -Patch4: vagrant-pr12913-ruby32-File_exists-removal.patch -# and also one more fix for File.exists-removal -# https://github.com/hashicorp/vagrant/commit/2fe4056a7dcf96dd894875b02032a988777e05d4 -Patch5: vagrant-2.2.3-ruby32-File_exists-removal-zsh-test.patch -# Prevent trailing space character on user agent -# https://bugzilla.redhat.com/show_bug.cgi?id=2177215 -# https://github.com/hashicorp/vagrant/pull/12925/ -Patch6: vagrant-2.3.1-Fix-downloader-user-agent.patch # The load directive is supported since RPM 4.12, i.e. F21+. The build process # fails on older Fedoras. @@ -138,13 +119,6 @@ Documentation for %{name}. %prep %setup -q -b2 -%patch0 -p1 -%patch2 -p1 -%patch3 -p1 -%patch4 -p1 -%patch5 -p1 -%patch6 -p1 - # TODO: package vagrant_cloud, as it is not in Fedora yet %gemspec_remove_dep -s %{name}.gemspec -g vagrant_cloud @@ -186,6 +160,11 @@ sed -i -e '/required_ruby_version/ s/, "< 3.1"//' %{name}.gemspec %gemspec_remove_dep -s %{name}.gemspec -g net-ssh %gemspec_add_dep -s %{name}.gemspec -g net-ssh ['>= 5.2.0', '< 7'] +# Remove optional dependencies +%gemspec_remove_dep -s %{name}.gemspec -g googleapis-common-protos-types +%gemspec_remove_dep -s %{name}.gemspec -g grpc +%gemspec_remove_dep -s %{name}.gemspec -g rgl + # Load missing dependency Vagrant::Util::MapCommandOptions # https://github.com/hashicorp/vagrant/pull/11609 sed -i '/^\s*require..vagrant.util.experimental.\s*$/ a\require "vagrant/util/map_command_options"' \ @@ -522,6 +501,9 @@ end %{vagrant_plugin_instdir}/vagrant-spec.config.example.rb %changelog +* Thu Sep 29 2022 Pavel Valena - 2.3.0-1 +- Upgrade to Vagrant 2.3.0. + * Thu Mar 16 2023 Pavel Valena - 2.2.19-10 - Handle URL properly From 8185bb5452c40e7e16fe60a9210bcf2690fc7cb8 Mon Sep 17 00:00:00 2001 From: Jarek Prokop Date: Tue, 21 Mar 2023 12:57:47 +0100 Subject: [PATCH 73/83] Rebase to 2.3.4 Remove test adjustments. Fixes mentioning GH#{11606,12362,12363} are present. Remove test adjustments for Ruby 2.7 compatibility. There is a much newer Ruby available in Fedora. Newer childprocess is present in Fedora for some time now. We can stop grepping for failures. Remove test adjustment for fake_ftp 0.3.0 compatibility. Not required anymore. Remove obsolete for vagrant-atomic that was retired in F26. Remove the net-ssh patch. It is not present anymore in the new version. And we are going to have net-ssh >= 7. --- sources | 4 +- ...e-loading-of-direct_conversions-file.patch | 41 ++++++ ...not-accessible-if-EROFS-error-occurs.patch | 23 +++ ...k-for-arguments-matching-test-string.patch | 39 ++++++ vagrant-2.3.4-remove_grpc.patch | 70 ++++++++++ vagrant.spec | 131 ++++++++---------- 6 files changed, 233 insertions(+), 75 deletions(-) create mode 100644 vagrant-2.3.4-Disable-loading-of-direct_conversions-file.patch create mode 100644 vagrant-2.3.4-Environment-home-dir-is-also-not-accessible-if-EROFS-error-occurs.patch create mode 100644 vagrant-2.3.4-Only-check-for-arguments-matching-test-string.patch create mode 100644 vagrant-2.3.4-remove_grpc.patch diff --git a/sources b/sources index 0973e45..b967078 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (v2.2.19.tar.gz) = 24a2e5baeac5cf8c45c012cf70dd4132b1dc7a6a5bab19d1046c91cc88e669356e2e5676d96eda6ed7293ff19ada974954969a4a59b9e4a30e2d95de27fa64e4 -SHA512 (vagrant-spec-03d88fe2467716b072951c2b55d78223130851a6.tar.gz) = 3b062cbec04f98355f939c2bf27d35ddcd2bbe0a0734677832d4a656320b44c64b6284e0877dd55e496055e2b969755e1bdc78225010f75ddaafe8f8c8f78a66 +SHA512 (v2.3.4.tar.gz) = 0d47e57c3c190743b4d0484ba1e48e3aad73ced3b356f0a4e54b66649eab2bd5d3fc57a06c62b4cc7d6c8e4617ef18a283c03d01553cc575c0884e464a27b501 +SHA512 (vagrant-spec-a88825f4cb254b703d0f9235667223f02ad5c600.tar.gz) = 50e4e2c9e69ccb0309876d204d8d66f606188e1d11853071a74819fe75126ed65fa3d02a31bdf2f8e29679a81d12fa2daed806eba034532c8150fe53d749fb84 diff --git a/vagrant-2.3.4-Disable-loading-of-direct_conversions-file.patch b/vagrant-2.3.4-Disable-loading-of-direct_conversions-file.patch new file mode 100644 index 0000000..2d2ee21 --- /dev/null +++ b/vagrant-2.3.4-Disable-loading-of-direct_conversions-file.patch @@ -0,0 +1,41 @@ +From aa62e1be219a129efe09464981bd3ae1f7b31282 Mon Sep 17 00:00:00 2001 +From: Jarek Prokop +Date: Tue, 9 May 2023 19:41:28 +0200 +Subject: [PATCH] Disable loading of direct_conversions file. + +plugins/commands/serve/util/direct_conversions.rb file contains +logic for Protobuf related code. It needs related google/protobuf +dependencies, therefore it is better to remove the file and +prevent loading it until we have google/protobuf components available +in Fedora. +--- + plugins/commands/serve/command.rb | 2 +- + plugins/commands/serve/util.rb | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/plugins/commands/serve/command.rb b/plugins/commands/serve/command.rb +index 9948f28bd..65d74f5d2 100644 +--- a/plugins/commands/serve/command.rb ++++ b/plugins/commands/serve/command.rb +@@ -138,4 +138,4 @@ module VagrantPlugins + end + + # Load in our conversions down here so all the autoload stuff is in place +-require Vagrant.source_root.join("plugins/commands/serve/util/direct_conversions.rb").to_s ++#require Vagrant.source_root.join("plugins/commands/serve/util/direct_conversions.rb").to_s +diff --git a/plugins/commands/serve/util.rb b/plugins/commands/serve/util.rb +index a8f963df7..930d023a6 100644 +--- a/plugins/commands/serve/util.rb ++++ b/plugins/commands/serve/util.rb +@@ -4,7 +4,7 @@ module VagrantPlugins + autoload :Cacher, Vagrant.source_root.join("plugins/commands/serve/util/cacher").to_s + autoload :ClientSetup, Vagrant.source_root.join("plugins/commands/serve/util/client_setup").to_s + autoload :Connector, Vagrant.source_root.join("plugins/commands/serve/util/connector").to_s +- autoload :DirectConversion, Vagrant.source_root.join("plugins/commands/serve/util/direct_conversions").to_s ++ # autoload :DirectConversion, Vagrant.source_root.join("plugins/commands/serve/util/direct_conversions").to_s + autoload :ExceptionTransformer, Vagrant.source_root.join("plugins/commands/serve/util/exception_transformer").to_s + autoload :FuncSpec, Vagrant.source_root.join("plugins/commands/serve/util/func_spec").to_s + autoload :HasBroker, Vagrant.source_root.join("plugins/commands/serve/util/has_broker").to_s +-- +2.40.1 + diff --git a/vagrant-2.3.4-Environment-home-dir-is-also-not-accessible-if-EROFS-error-occurs.patch b/vagrant-2.3.4-Environment-home-dir-is-also-not-accessible-if-EROFS-error-occurs.patch new file mode 100644 index 0000000..2afd734 --- /dev/null +++ b/vagrant-2.3.4-Environment-home-dir-is-also-not-accessible-if-EROFS-error-occurs.patch @@ -0,0 +1,23 @@ +From 7661eba89a5786a1b0826dbb2f45f8827d9a5103 Mon Sep 17 00:00:00 2001 +From: sophia +Date: Tue, 3 Jan 2023 12:23:37 -0800 +Subject: [PATCH] Environment home dir is also not accessible if EROFS error + occurs + +--- + lib/vagrant/environment.rb | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/vagrant/environment.rb b/lib/vagrant/environment.rb +index de99cbf3ba5..8b2531182ca 100644 +--- a/lib/vagrant/environment.rb ++++ b/lib/vagrant/environment.rb +@@ -846,7 +846,7 @@ def setup_home_path + begin + @logger.info("Creating: #{dir}") + FileUtils.mkdir_p(dir) +- rescue Errno::EACCES ++ rescue Errno::EACCES, Errno::EROFS + raise Errors::HomeDirectoryNotAccessible, home_path: @home_path.to_s + end + end diff --git a/vagrant-2.3.4-Only-check-for-arguments-matching-test-string.patch b/vagrant-2.3.4-Only-check-for-arguments-matching-test-string.patch new file mode 100644 index 0000000..50ae417 --- /dev/null +++ b/vagrant-2.3.4-Only-check-for-arguments-matching-test-string.patch @@ -0,0 +1,39 @@ +From 9743c857481556838ee417a0033efdee3fb0c7fc Mon Sep 17 00:00:00 2001 +From: sophia +Date: Tue, 3 Jan 2023 13:20:14 -0800 +Subject: [PATCH] Only check for arguments matching test string if the argument + is a string + +This issue surfaced in the tests after updating to Ruby 3.2.0 where +the =~ operator has been removed. + +ref: https://github.com/ruby/ruby/blob/cca54c8b1b71072bb07850c9d3f20b261d3b312c/NEWS.md?plain=1#L498 +--- + test/unit/plugins/provisioners/ansible/provisioner_test.rb | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/test/unit/plugins/provisioners/ansible/provisioner_test.rb b/test/unit/plugins/provisioners/ansible/provisioner_test.rb +index f5828f14340..fdf9aa67eaa 100644 +--- a/test/unit/plugins/provisioners/ansible/provisioner_test.rb ++++ b/test/unit/plugins/provisioners/ansible/provisioner_test.rb +@@ -91,7 +91,7 @@ def self.it_should_set_arguments_and_environment_variables( + expect(args[1]).to eq("--connection=ssh") + expect(args[2]).to eq("--timeout=30") + +- inventory_count = args.count { |x| x =~ /^--inventory-file=.+$/ } ++ inventory_count = args.count { |x| x.match(/^--inventory-file=.+$/) if x.is_a?(String) } + expect(inventory_count).to be > 0 + + expect(args[args.length-2]).to eq("playbook.yml") +@@ -100,9 +100,9 @@ def self.it_should_set_arguments_and_environment_variables( + + it "sets --limit argument" do + expect(Vagrant::Util::Subprocess).to receive(:execute).with('ansible-playbook', any_args) { |*args| +- all_limits = args.select { |x| x =~ /^(--limit=|-l)/ } ++ all_limits = args.select { |x| x.match(/^(--limit=|-l)/) if x.is_a?(String) } + if config.raw_arguments +- raw_limits = config.raw_arguments.select { |x| x =~ /^(--limit=|-l)/ } ++ raw_limits = config.raw_arguments.select { |x| x.match(/^(--limit=|-l)/) if x.is_a?(String) } + expect(all_limits.length - raw_limits.length).to eq(1) + expect(all_limits.last).to eq(raw_limits.last) + else diff --git a/vagrant-2.3.4-remove_grpc.patch b/vagrant-2.3.4-remove_grpc.patch new file mode 100644 index 0000000..27c12d6 --- /dev/null +++ b/vagrant-2.3.4-remove_grpc.patch @@ -0,0 +1,70 @@ +diff '--color=auto' -Naur /var/lib/mock/fedora-rawhide-x86_64/root/builddir/build/BUILDROOT/vagrant-2.3.4-1.fc39.x86_64/usr/share/vagrant/gems/gems/vagrant-2.3.4/lib/vagrant.rb /var/lib/mock/vagrant-rebase/root/builddir/build/BUILDROOT/vagrant-2.3.4-1.fc39.x86_64/usr/share/vagrant/gems/gems/vagrant-2.3.4/lib/vagrant.rb +--- /var/lib/mock/fedora-rawhide-x86_64/root/builddir/build/BUILDROOT/vagrant-2.3.4-1.fc39.x86_64/usr/share/vagrant/gems/gems/vagrant-2.3.4/lib/vagrant.rb 2023-02-16 13:41:49.267357857 +0100 ++++ /var/lib/mock/vagrant-rebase/root/builddir/build/BUILDROOT/vagrant-2.3.4-1.fc39.x86_64/usr/share/vagrant/gems/gems/vagrant-2.3.4/lib/vagrant.rb 2023-03-17 16:47:49.956035219 +0100 +@@ -46,19 +46,19 @@ + require "vagrant/plugin/manager" + + # Update the load path so our protos can be located +-$LOAD_PATH << Vagrant.source_root.join("lib/vagrant/protobufs").to_s +-$LOAD_PATH << Vagrant.source_root.join("lib/vagrant/protobufs/proto").to_s +-$LOAD_PATH << Vagrant.source_root.join("lib/vagrant/protobufs/proto/vagrant_plugin_sdk").to_s ++# $LOAD_PATH << Vagrant.source_root.join("lib/vagrant/protobufs").to_s ++# $LOAD_PATH << Vagrant.source_root.join("lib/vagrant/protobufs/proto").to_s ++# $LOAD_PATH << Vagrant.source_root.join("lib/vagrant/protobufs/proto/vagrant_plugin_sdk").to_s + + # Load our protos so they are available +-require 'vagrant/protobufs/proto/vagrant_server/server_pb' +-require 'vagrant/protobufs/proto/vagrant_server/server_services_pb' +-require 'vagrant/protobufs/proto/ruby_vagrant/ruby-server_pb' +-require 'vagrant/protobufs/proto/ruby_vagrant/ruby-server_services_pb' +-require 'vagrant/protobufs/proto/vagrant_plugin_sdk/plugin_pb' +-require 'vagrant/protobufs/proto/vagrant_plugin_sdk/plugin_services_pb' +-require 'vagrant/protobufs/proto/plugin/grpc_broker_pb' +-require 'vagrant/protobufs/proto/plugin/grpc_broker_services_pb' ++# require 'vagrant/protobufs/proto/vagrant_server/server_pb' ++# require 'vagrant/protobufs/proto/vagrant_server/server_services_pb' ++# require 'vagrant/protobufs/proto/ruby_vagrant/ruby-server_pb' ++# require 'vagrant/protobufs/proto/ruby_vagrant/ruby-server_services_pb' ++# require 'vagrant/protobufs/proto/vagrant_plugin_sdk/plugin_pb' ++# require 'vagrant/protobufs/proto/vagrant_plugin_sdk/plugin_services_pb' ++# require 'vagrant/protobufs/proto/plugin/grpc_broker_pb' ++# require 'vagrant/protobufs/proto/plugin/grpc_broker_services_pb' + + # Enable logging if it is requested. We do this before + # anything else so that we can setup the output before +diff '--color=auto' -Naur /var/lib/mock/fedora-rawhide-x86_64/root/builddir/build/BUILDROOT/vagrant-2.3.4-1.fc39.x86_64/usr/share/vagrant/gems/gems/vagrant-2.3.4/plugins/commands/serve/command.rb /var/lib/mock/vagrant-rebase/root/builddir/build/BUILDROOT/vagrant-2.3.4-1.fc39.x86_64/usr/share/vagrant/gems/gems/vagrant-2.3.4/plugins/commands/serve/command.rb +--- /var/lib/mock/fedora-rawhide-x86_64/root/builddir/build/BUILDROOT/vagrant-2.3.4-1.fc39.x86_64/usr/share/vagrant/gems/gems/vagrant-2.3.4/plugins/commands/serve/command.rb 2023-02-16 13:41:49.358357676 +0100 ++++ /var/lib/mock/vagrant-rebase/root/builddir/build/BUILDROOT/vagrant-2.3.4-1.fc39.x86_64/usr/share/vagrant/gems/gems/vagrant-2.3.4/plugins/commands/serve/command.rb 2023-03-17 16:57:02.859959067 +0100 +@@ -3,9 +3,9 @@ + module VagrantPlugins + module CommandServe + # Simple constant aliases to reduce namespace typing +- SDK = Hashicorp::Vagrant::Sdk +- SRV = Hashicorp::Vagrant +- Empty = ::Google::Protobuf::Empty ++ # SDK = Hashicorp::Vagrant::Sdk ++ # SRV = Hashicorp::Vagrant ++ Empty = [] + + autoload :Broker, Vagrant.source_root.join("plugins/commands/serve/broker").to_s + autoload :Client, Vagrant.source_root.join("plugins/commands/serve/client").to_s +diff '--color=auto' -Naur /var/lib/mock/fedora-rawhide-x86_64/root/builddir/build/BUILDROOT/vagrant-2.3.4-1.fc39.x86_64/usr/share/vagrant/gems/gems/vagrant-2.3.4/plugins/kernel_v2/config/vm.rb /var/lib/mock/vagrant-rebase/root/builddir/build/BUILDROOT/vagrant-2.3.4-1.fc39.x86_64/usr/share/vagrant/gems/gems/vagrant-2.3.4/plugins/kernel_v2/config/vm.rb +--- /var/lib/mock/fedora-rawhide-x86_64/root/builddir/build/BUILDROOT/vagrant-2.3.4-1.fc39.x86_64/usr/share/vagrant/gems/gems/vagrant-2.3.4/plugins/kernel_v2/config/vm.rb 2023-02-16 13:41:49.475357444 +0100 ++++ /var/lib/mock/vagrant-rebase/root/builddir/build/BUILDROOT/vagrant-2.3.4-1.fc39.x86_64/usr/share/vagrant/gems/gems/vagrant-2.3.4/plugins/kernel_v2/config/vm.rb 2023-03-17 16:48:26.940189713 +0100 +@@ -11,11 +11,11 @@ + require "vagrant/util/map_command_options" + require "vagrant/util/map_command_options" + +-$LOAD_PATH << Vagrant.source_root.join("lib/vagrant/protobufs/proto").to_s +- +-require "vagrant/protobufs/proto/protostructure_pb" +-require "vagrant/protobufs/proto/vagrant_plugin_sdk/plugin_pb" +-require "vagrant/protobufs/proto/vagrant_plugin_sdk/plugin_services_pb" ++# $LOAD_PATH << Vagrant.source_root.join("lib/vagrant/protobufs/proto").to_s ++# ++# require "vagrant/protobufs/proto/protostructure_pb" ++# require "vagrant/protobufs/proto/vagrant_plugin_sdk/plugin_pb" ++# require "vagrant/protobufs/proto/vagrant_plugin_sdk/plugin_services_pb" + + # Include mappers + require Vagrant.source_root.join("plugins/commands/serve/command").to_s diff --git a/vagrant.spec b/vagrant.spec index 834f964..75c286a 100644 --- a/vagrant.spec +++ b/vagrant.spec @@ -6,7 +6,7 @@ %bcond_without ed25519 Name: vagrant -Version: 2.3.0 +Version: 2.3.4 Release: 1%{?dist} Summary: Build and distribute virtualized development environments License: MIT @@ -25,6 +25,21 @@ Source4: macros.vagrant # Do not load runtime dependencies in %%check if vagrant is not loaded # https://github.com/hashicorp/vagrant/pull/10945 Patch1: vagrant-2.2.9-do-not-load-dependencies.patch +# Remove GRPC dependencies for Fedora. It seems that it will serve +# for communication with upcoming Golang backend, however +# it is only in tech-preview now and grpc is not simple to package. +# Let's remove it for now and revisit in the future. +Patch2: vagrant-2.3.4-remove_grpc.patch +# Ruby 3.2 compatibility for tests. +# Commits are cherry-picked instead of a whole PR as it also edits .github +# files that we do not care about. +# https://github.com/hashicorp/vagrant/pull/13043 +Patch3: vagrant-2.3.4-Environment-home-dir-is-also-not-accessible-if-EROFS-error-occurs.patch +Patch4: vagrant-2.3.4-Only-check-for-arguments-matching-test-string.patch +# Disable loading of direc_conversions.rb in other files. +# The file is removed as it requires protobuf components not yet +# packaged in Fedora. +Patch5: vagrant-2.3.4-Disable-loading-of-direct_conversions-file.patch # The load directive is supported since RPM 4.12, i.e. F21+. The build process # fails on older Fedoras. @@ -94,11 +109,6 @@ BuildRequires: help2man BuildRequires: %{_bindir}/ssh BuildArch: noarch -# vagrant-atomic was retired in F26, since it was merged into Vagrant. -# https://github.com/projectatomic/vagrant-atomic/issues/5 -# https://github.com/mitchellh/vagrant/pull/5847 -Obsoletes: vagrant-atomic <= 0.1.0-4 - # Since Vagrant itself is installed on the same place as its plugins # the vagrant_plugin macros can be reused in the spec file, but the plugin # name must be specified. @@ -131,12 +141,12 @@ sed -i '/^\s*command(:login) do$/,/\s*end$/ s/^/#/g' plugins/commands/login/plug # Expand required Ruby compatibility, otherwise RubyGems throws exceptions. # Relevant rhbz: https://bugzilla.redhat.com/show_bug.cgi?id=2053476#c0 # Relevant RubyGems issue: https://github.com/rubygems/rubygems/issues/4338 -sed -i -e '/required_ruby_version/ s/, "< 3.1"//' %{name}.gemspec +sed -i -e '/required_ruby_version/ s/, "< 3.2"//' %{name}.gemspec # We have older version in Fedora -%gemspec_remove_dep -s %{name}.gemspec -g net-sftp '~> 3.0' +%gemspec_remove_dep -s %{name}.gemspec -g net-sftp '~> 4.0' %gemspec_add_dep -s %{name}.gemspec -g net-sftp '>= 2.1.2' -%gemspec_remove_dep -s %{name}.gemspec -g net-scp '~> 3.0.0' +%gemspec_remove_dep -s %{name}.gemspec -g net-scp '~> 4.0' %gemspec_add_dep -s %{name}.gemspec -g net-scp '>= 1.2.0' # We have newer version in Fedora @@ -160,20 +170,17 @@ sed -i -e '/required_ruby_version/ s/, "< 3.1"//' %{name}.gemspec %gemspec_remove_dep -s %{name}.gemspec -g net-ssh %gemspec_add_dep -s %{name}.gemspec -g net-ssh ['>= 5.2.0', '< 7'] -# Remove optional dependencies +# Remove "optional" dependencies +# This seems like prelude for the in-development golang backend. +# Nothing runtime critical. %gemspec_remove_dep -s %{name}.gemspec -g googleapis-common-protos-types %gemspec_remove_dep -s %{name}.gemspec -g grpc %gemspec_remove_dep -s %{name}.gemspec -g rgl - # Load missing dependency Vagrant::Util::MapCommandOptions # https://github.com/hashicorp/vagrant/pull/11609 sed -i '/^\s*require..vagrant.util.experimental.\s*$/ a\require "vagrant/util/map_command_options"' \ plugins/kernel_v2/config/vm.rb -# Apply net-ssh patches apply regardless of net-ssh version -sed -i 's/^if Net::SSH::Version::STRING.*$/if true/' \ - lib/vagrant/patches/net-ssh.rb - %if %{without ed25519} # Remove optional dependencies %gemspec_remove_dep -s %{name}.gemspec -g bcrypt_pbkdf @@ -187,6 +194,20 @@ sed -i '/^ require .net\/ssh\/authentication\/ed25519.$/,/^ end$/ s/^/#/' \ %gemspec_add_dep -s %{name}.gemspec -g ed25519 ['>= 1.2.4', '< 1.4'] %endif +# Let's get rid of protobuf related components +%patch2 -p16 + +%gemspec_remove_file -s %{name}.gemspec Dir.glob('lib/vagrant/protobufs/**/*.*') +# This file contains monkey patching and compatibility for Protobuf serialization. +# We do not need that as we skip protobuf related parts completely. +%gemspec_remove_file -s %{name}.gemspec "plugins/commands/serve/util/direct_conversions.rb" +rm -rf plugins/commands/serve/util/direct_conversions.rb +# Patch out related requires in code. +%patch5 -p1 + +%patch3 -p1 + + %build gem build %{name}.gemspec @@ -251,6 +272,8 @@ help2man -N -s1 -o %{buildroot}%{_mandir}/man1/%{name}.1 \ %check # Do not load dependencies from gemspec cat %{PATCH1} | patch -p1 +# Ruby 3.2 compatibility fix +cat %{PATCH4} | patch -p1 sed -i '/^\s*context "when vagrant specification is not found" do$/,/^ end$/ s/^/#/' \ test/unit/vagrant/bundler_test.rb @@ -289,45 +312,26 @@ mv test/unit/vagrant/util/env_test.rb{,.disable} # in favor of vagrant_cloud rm -r test/unit/plugins/commands/cloud/ -# fake_ftp 0.3.0 compatibility. -# https://github.com/livinginthepast/fake_ftp/pull/56 -sed -i '/^\s*it "adds from FTP URL" do$/ a skip' test/unit/vagrant/action/builtin/box_add_test.rb - # Disable test that requires network sed -i '/^ it "generates a network name and configuration" do$/,/^ end/ s/^/#/' \ test/unit/plugins/providers/docker/action/prepare_networks_test.rb -# There are some Ruby 2.7 incompatibilities which might be fixed by: -# https://github.com/hashicorp/vagrant/pull/11459 -# but workarond the offending test case for now. -sed -i "/describe '#create' do/,/^ end$/ s/^/#/" \ - test/unit/plugins/providers/docker/driver_compose_test.rb -sed -i "/it 'removes the container' do/a\ skip 'Ruby 2.7 incompatibility'" \ - test/unit/plugins/providers/docker/driver_compose_test.rb - # Remove failing BSD-host tests, as we don't care about those. rm -rf test/unit/plugins/hosts/bsd -# Disable broken test for installing docker on host -# https://github.com/hashicorp/vagrant/issues/11606 -sed -i '/^\s*it "installs docker if not present" do$/ a\ skip "GH#11606"' \ - test/unit/plugins/provisioners/docker/installer_test.rb - -# Disable tests failing on class variable access from toplevel -# > Failure/Error: @@logger = nil -# https://github.com/hashicorp/vagrant/issues/12362 -mv test/unit/plugins/synced_folders/unix_mount_helpers_test.rb{,.disable} - -# Disable currently broken powershell tests, due to: -# https://github.com/hashicorp/vagrant/commit/5967a23fa097e89726d335dcf781ae43cb256bc1# -# https://github.com/hashicorp/vagrant/issues/12363 -mv test/unit/vagrant/util/powershell_test.rb{,.disable} - # Export the OS as an environment variable that Vagrant can access, so the # test suite is executed with same host it will be run (also avoids docker # installer_test issue). export VAGRANT_DETECTED_OS="$(uname -s 2>/dev/null)" +# Disable tests concerning protobuf +mv ./test/unit/plugins/commands/serve/service/guest_service_test.rb{,.disabled} +mv ./test/unit/plugins/commands/serve/service/host_service_test.rb{,.disabled} +mv ./test/unit/plugins/commands/serve/util/exception_transformer_test.rb{,.disabled} +mv ./test/unit/plugins/commands/serve/mappers_test.rb{,.disabled} +sed -i -e '/ it "uses a directory within the home directory by default" do/a\ + skip "Requires protobuf"' ./test/unit/vagrant/environment_test.rb + # Put gem load path on top of the load path, so they are loaded earlier then # their StdLib symlinks. %{!?buildtime_libdir:%global buildtime_libdir $(ruby -rrbconfig -e 'puts RbConfig::CONFIG["libdir"]')} @@ -350,35 +354,6 @@ export RUBYOPT rake -f tasks/test.rake test:unit \ | tee error.log -# Temporarily disable (3) tests failing on older childprocess -# 4) Vagrant::Util::Subprocess#running? should return false when subprocess has completed -# Failure/Error: expect(sp.running?).to be(false) -# expected false -# got true -# # ./test/unit/vagrant/util/subprocess_test.rb:123:in `block (4 levels) in ' -# # ./test/unit/vagrant/util/subprocess_test.rb:120:in `each' -# # ./test/unit/vagrant/util/subprocess_test.rb:120:in `block (3 levels) in ' -# # /usr/share/gems/gems/webmock-3.11.1/lib/webmock/rspec.rb:37:in `block (2 levels) in ' -# 5) Vagrant::Util::Subprocess#stop when subprocess has already completed should return false -# Failure/Error: expect(sp.stop).to be(false) -# expected false -# got true -# # ./test/unit/vagrant/util/subprocess_test.rb:152:in `block (5 levels) in ' -# # ./test/unit/vagrant/util/subprocess_test.rb:149:in `each' -# # ./test/unit/vagrant/util/subprocess_test.rb:149:in `block (4 levels) in ' -# # /usr/share/gems/gems/webmock-3.11.1/lib/webmock/rspec.rb:37:in `block (2 levels) in ' -# 6) Vagrant::Util::Subprocess#stop when subprocess is running should stop the process -# Failure/Error: expect(sp.running?).to be(false) -# expected false -# got true -# # ./test/unit/vagrant/util/subprocess_test.rb:172:in `block (5 levels) in ' -# # ./test/unit/vagrant/util/subprocess_test.rb:168:in `each' -# # ./test/unit/vagrant/util/subprocess_test.rb:168:in `block (4 levels) in ' -# # /usr/share/gems/gems/webmock-3.11.1/lib/webmock/rspec.rb:37:in `block (2 levels) in ' -# Note: failures will dissapear when rubygem-childprocess update PR is merged -# https://src.fedoraproject.org/rpms/rubygem-childprocess/pull-request/2/ -grep -E ', (3|0) failures, ' error.log || exit 1 - %if %{with help2man} # Check `--help` output, using which man page is created export GEM_PATH="%{gem_dir}:%{buildroot}/usr/share/vagrant/gems" @@ -455,6 +430,16 @@ end %dir %{dirname:%{vagrant_plugin_instdir}} %dir %{dirname:%{vagrant_plugin_spec}} +%exclude %{vagrant_plugin_instdir}/Makefile +%exclude %{vagrant_plugin_instdir}/Dockerfile +%exclude %{vagrant_plugin_instdir}/flake* +%exclude %{vagrant_plugin_instdir}/go.{mod,sum} +%exclude %{vagrant_plugin_instdir}/gen.go +%exclude %{vagrant_plugin_instdir}/binstubs/vagrant +%exclude %{vagrant_plugin_instdir}/nix/*.nix +%exclude %{vagrant_plugin_instdir}/shell.nix +%exclude %{vagrant_plugin_instdir}/vagrant-config.hcl + %{_bindir}/%{name} %dir %{vagrant_plugin_instdir} %license %{vagrant_plugin_instdir}/LICENSE @@ -501,8 +486,8 @@ end %{vagrant_plugin_instdir}/vagrant-spec.config.example.rb %changelog -* Thu Sep 29 2022 Pavel Valena - 2.3.0-1 -- Upgrade to Vagrant 2.3.0. +* Tue May 09 2023 Jarek Prokop - 2.3.4-1 +- Upgrade to Vagrant 2.3.4. * Thu Mar 16 2023 Pavel Valena - 2.2.19-10 - Handle URL properly From da2ecf8f8b192875783f9f374bbfc83ee612aa99 Mon Sep 17 00:00:00 2001 From: Zdenek Zambersky Date: Wed, 3 May 2023 21:56:43 +0200 Subject: [PATCH 74/83] Updated net-ssh version --- vagrant.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vagrant.spec b/vagrant.spec index 75c286a..f6469e1 100644 --- a/vagrant.spec +++ b/vagrant.spec @@ -56,7 +56,7 @@ Requires: (rubygem(i18n) >= 1.8 with rubygem(i18n) < 2.0) Requires: rubygem(json) Requires: (rubygem(listen) >= 3.2 with rubygem(listen) < 4) Requires: rubygem(log4r) >= 1.1.9 -Requires: (rubygem(net-ssh) >= 5.2.0 with rubygem(net-ssh) < 7) +Requires: (rubygem(net-ssh) >= 5.2.0 with rubygem(net-ssh) < 8) Requires: rubygem(net-scp) >= 1.2.0 Requires: rubygem(net-sftp) >= 2.1 Requires: rubygem(rest-client) >= 1.6.0 @@ -168,7 +168,7 @@ sed -i -e '/required_ruby_version/ s/, "< 3.2"//' %{name}.gemspec # Relax net-ssh dependency. We have newer net-ssh in Fedora %gemspec_remove_dep -s %{name}.gemspec -g net-ssh -%gemspec_add_dep -s %{name}.gemspec -g net-ssh ['>= 5.2.0', '< 7'] +%gemspec_add_dep -s %{name}.gemspec -g net-ssh ['>= 5.2.0', '< 8'] # Remove "optional" dependencies # This seems like prelude for the in-development golang backend. From 3d99b8052b527e37451fe954dcaaaf9c998402cb Mon Sep 17 00:00:00 2001 From: Zdenek Zambersky Date: Wed, 21 Jun 2023 18:09:37 +0200 Subject: [PATCH 75/83] Added missing dependency on rexml and mime-types --- vagrant.spec | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/vagrant.spec b/vagrant.spec index f6469e1..1936401 100644 --- a/vagrant.spec +++ b/vagrant.spec @@ -7,7 +7,7 @@ Name: vagrant Version: 2.3.4 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Build and distribute virtualized development environments License: MIT URL: http://vagrantup.com @@ -62,6 +62,8 @@ Requires: rubygem(net-sftp) >= 2.1 Requires: rubygem(rest-client) >= 1.6.0 Requires: rubygem(rubyzip) >= 1.1.7 Requires: rubygem(net-ftp) +Requires: rubygem(rexml) +Requires: rubygem(mime-types) Requires: bsdtar Requires: curl Requires: %{_bindir}/ps @@ -102,6 +104,8 @@ BuildRequires: rubygem(webrick) BuildRequires: rubygem(fake_ftp) BuildRequires: rubygem(rake) BuildRequires: rubygem(net-ftp) +BuildRequires: rubygem(rexml) +BuildRequires: rubygem(mime-types) BuildRequires: pkgconfig(bash-completion) %if %{with help2man} BuildRequires: help2man @@ -486,6 +490,9 @@ end %{vagrant_plugin_instdir}/vagrant-spec.config.example.rb %changelog +* Wed Jun 21 2023 Zdenek Zambersky - 2.3.4-2 +- Added missing dependency on rexml and mime-types + * Tue May 09 2023 Jarek Prokop - 2.3.4-1 - Upgrade to Vagrant 2.3.4. From 1965e286b6c151ca19c6413791a6c22fd5b866ef Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 22 Jul 2023 17:22:23 +0000 Subject: [PATCH 76/83] Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- vagrant.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vagrant.spec b/vagrant.spec index 1936401..60cc94b 100644 --- a/vagrant.spec +++ b/vagrant.spec @@ -7,7 +7,7 @@ Name: vagrant Version: 2.3.4 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Build and distribute virtualized development environments License: MIT URL: http://vagrantup.com @@ -490,6 +490,9 @@ end %{vagrant_plugin_instdir}/vagrant-spec.config.example.rb %changelog +* Sat Jul 22 2023 Fedora Release Engineering +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + * Wed Jun 21 2023 Zdenek Zambersky - 2.3.4-2 - Added missing dependency on rexml and mime-types From beac2b546acdabb35680b4ef2421aaa8bdc55d04 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 27 Jan 2024 07:25:23 +0000 Subject: [PATCH 77/83] Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild --- vagrant.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vagrant.spec b/vagrant.spec index 60cc94b..37e68ff 100644 --- a/vagrant.spec +++ b/vagrant.spec @@ -7,7 +7,7 @@ Name: vagrant Version: 2.3.4 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Build and distribute virtualized development environments License: MIT URL: http://vagrantup.com @@ -490,6 +490,9 @@ end %{vagrant_plugin_instdir}/vagrant-spec.config.example.rb %changelog +* Sat Jan 27 2024 Fedora Release Engineering +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + * Sat Jul 22 2023 Fedora Release Engineering - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild From 2a16199df0093b5775e94a32c3cae890907fd0c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ondruch?= Date: Wed, 7 Feb 2024 11:14:23 +0100 Subject: [PATCH 78/83] Drop superfluous rest-client dependency. The dependency was dropped in Vagrant 2.2.11 already: https://github.com/hashicorp/vagrant/commit/3ec8d44cf9abaf825bffaf7674829f5006d978f0 https://github.com/hashicorp/vagrant/pull/11916 --- vagrant.spec | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/vagrant.spec b/vagrant.spec index 37e68ff..9b7edce 100644 --- a/vagrant.spec +++ b/vagrant.spec @@ -7,7 +7,7 @@ Name: vagrant Version: 2.3.4 -Release: 4%{?dist} +Release: 5%{?dist} Summary: Build and distribute virtualized development environments License: MIT URL: http://vagrantup.com @@ -59,7 +59,6 @@ Requires: rubygem(log4r) >= 1.1.9 Requires: (rubygem(net-ssh) >= 5.2.0 with rubygem(net-ssh) < 8) Requires: rubygem(net-scp) >= 1.2.0 Requires: rubygem(net-sftp) >= 2.1 -Requires: rubygem(rest-client) >= 1.6.0 Requires: rubygem(rubyzip) >= 1.1.7 Requires: rubygem(net-ftp) Requires: rubygem(rexml) @@ -96,7 +95,6 @@ BuildRequires: rubygem(erubi) BuildRequires: rubygem(rspec) BuildRequires: rubygem(rspec-its) BuildRequires: rubygem(net-sftp) -BuildRequires: rubygem(rest-client) BuildRequires: rubygem(rubyzip) BuildRequires: rubygem(thor) BuildRequires: rubygem(webmock) @@ -490,6 +488,9 @@ end %{vagrant_plugin_instdir}/vagrant-spec.config.example.rb %changelog +* Wed Feb 07 2024 Vít Ondruch - 2.3.4-5 +- Drop superfluous rest-client dependency. + * Sat Jan 27 2024 Fedora Release Engineering - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild From 7dc964d6011521a704cfeb78d886ab8c0391875b Mon Sep 17 00:00:00 2001 From: Software Management Team Date: Thu, 30 May 2024 12:47:07 +0200 Subject: [PATCH 79/83] Eliminate use of obsolete %patchN syntax (#2283636) --- vagrant.spec | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vagrant.spec b/vagrant.spec index 9b7edce..7415350 100644 --- a/vagrant.spec +++ b/vagrant.spec @@ -197,7 +197,7 @@ sed -i '/^ require .net\/ssh\/authentication\/ed25519.$/,/^ end$/ s/^/#/' \ %endif # Let's get rid of protobuf related components -%patch2 -p16 +%patch 2 -p16 %gemspec_remove_file -s %{name}.gemspec Dir.glob('lib/vagrant/protobufs/**/*.*') # This file contains monkey patching and compatibility for Protobuf serialization. @@ -205,9 +205,9 @@ sed -i '/^ require .net\/ssh\/authentication\/ed25519.$/,/^ end$/ s/^/#/' \ %gemspec_remove_file -s %{name}.gemspec "plugins/commands/serve/util/direct_conversions.rb" rm -rf plugins/commands/serve/util/direct_conversions.rb # Patch out related requires in code. -%patch5 -p1 +%patch 5 -p1 -%patch3 -p1 +%patch 3 -p1 %build From 5f0fa4cc2bebcc8fc3b5fb9033b67c7efca9195f Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 20 Jul 2024 08:31:17 +0000 Subject: [PATCH 80/83] Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild --- vagrant.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vagrant.spec b/vagrant.spec index 7415350..6f5c5a0 100644 --- a/vagrant.spec +++ b/vagrant.spec @@ -7,7 +7,7 @@ Name: vagrant Version: 2.3.4 -Release: 5%{?dist} +Release: 6%{?dist} Summary: Build and distribute virtualized development environments License: MIT URL: http://vagrantup.com @@ -488,6 +488,9 @@ end %{vagrant_plugin_instdir}/vagrant-spec.config.example.rb %changelog +* Sat Jul 20 2024 Fedora Release Engineering +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + * Wed Feb 07 2024 Vít Ondruch - 2.3.4-5 - Drop superfluous rest-client dependency. From 28f6e257f9df947e327d693daab09c42aefb0249 Mon Sep 17 00:00:00 2001 From: Jarek Prokop Date: Thu, 16 Jan 2025 14:16:03 +0100 Subject: [PATCH 81/83] Fix default URL used for pulling boxes. The default URL to pull vagrant boxes changed. Fixing it allows the boxes to be pulled again. Resolves: rhbz#2337302 --- ...efault-vagrant-URL-for-pulling-boxes.patch | 22 +++++++++++++++++++ vagrant.spec | 12 +++++++++- 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 vagrant-2.3.4-Fix-the-default-vagrant-URL-for-pulling-boxes.patch diff --git a/vagrant-2.3.4-Fix-the-default-vagrant-URL-for-pulling-boxes.patch b/vagrant-2.3.4-Fix-the-default-vagrant-URL-for-pulling-boxes.patch new file mode 100644 index 0000000..c181831 --- /dev/null +++ b/vagrant-2.3.4-Fix-the-default-vagrant-URL-for-pulling-boxes.patch @@ -0,0 +1,22 @@ +From 27440fdd8cebf57882e3672376d409b139cc1e86 Mon Sep 17 00:00:00 2001 +From: Jarek Prokop +Date: Thu, 16 Jan 2025 13:36:05 +0100 +Subject: [PATCH] Fix the default vagrant URL for pulling boxes. + +--- + lib/vagrant/shared_helpers.rb | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/vagrant/shared_helpers.rb b/lib/vagrant/shared_helpers.rb +index b07c89a48..3c57cad6d 100644 +--- a/lib/vagrant/shared_helpers.rb ++++ b/lib/vagrant/shared_helpers.rb +@@ -10,7 +10,7 @@ module Vagrant + # of Vagrant that may require remote access. + # + # @return [String] +- DEFAULT_SERVER_URL = "https://vagrantcloud.com".freeze ++ DEFAULT_SERVER_URL = "https://vagrantcloud.com/api/v2/vagrant".freeze + + # Max number of seconds to wait for joining an active thread. + # diff --git a/vagrant.spec b/vagrant.spec index 6f5c5a0..3d8cdea 100644 --- a/vagrant.spec +++ b/vagrant.spec @@ -7,7 +7,7 @@ Name: vagrant Version: 2.3.4 -Release: 6%{?dist} +Release: 7%{?dist} Summary: Build and distribute virtualized development environments License: MIT URL: http://vagrantup.com @@ -40,6 +40,10 @@ Patch4: vagrant-2.3.4-Only-check-for-arguments-matching-test-string.patch # The file is removed as it requires protobuf components not yet # packaged in Fedora. Patch5: vagrant-2.3.4-Disable-loading-of-direct_conversions-file.patch +# Default URL for pulling boxes seems to have changed. +# This fix allows vagrant to pull boxes again. +# See: https://bugzilla.redhat.com/show_bug.cgi?id=2337302 +Patch6: vagrant-2.3.4-Fix-the-default-vagrant-URL-for-pulling-boxes.patch # The load directive is supported since RPM 4.12, i.e. F21+. The build process # fails on older Fedoras. @@ -209,6 +213,8 @@ rm -rf plugins/commands/serve/util/direct_conversions.rb %patch 3 -p1 +%patch 6 -p1 + %build gem build %{name}.gemspec @@ -488,6 +494,10 @@ end %{vagrant_plugin_instdir}/vagrant-spec.config.example.rb %changelog +* Thu Jan 16 2025 Jarek Prokop - 2.3.4-7 +- Fix default URL used for pulling boxes. + Resolves: rhbz#2337302 + * Sat Jul 20 2024 Fedora Release Engineering - Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild From 098ed181ad80620c814dce95699f05ea107b8096 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 25 Jul 2025 19:56:03 +0000 Subject: [PATCH 82/83] Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild --- vagrant.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vagrant.spec b/vagrant.spec index 3d8cdea..ef07b0c 100644 --- a/vagrant.spec +++ b/vagrant.spec @@ -7,7 +7,7 @@ Name: vagrant Version: 2.3.4 -Release: 7%{?dist} +Release: 8%{?dist} Summary: Build and distribute virtualized development environments License: MIT URL: http://vagrantup.com @@ -494,6 +494,9 @@ end %{vagrant_plugin_instdir}/vagrant-spec.config.example.rb %changelog +* Fri Jul 25 2025 Fedora Release Engineering +- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild + * Thu Jan 16 2025 Jarek Prokop - 2.3.4-7 - Fix default URL used for pulling boxes. Resolves: rhbz#2337302 From dd512fa319e8f2504180e13d638a7f0f7262e4a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ondruch?= Date: Mon, 22 Dec 2025 12:51:06 +0100 Subject: [PATCH 83/83] Relax `rubygem(rubyzip)` dependency This is in preparation for getting rubyzip 3.0+ into Fedora. --- vagrant.spec | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/vagrant.spec b/vagrant.spec index ef07b0c..224083e 100644 --- a/vagrant.spec +++ b/vagrant.spec @@ -7,7 +7,7 @@ Name: vagrant Version: 2.3.4 -Release: 8%{?dist} +Release: 9%{?dist} Summary: Build and distribute virtualized development environments License: MIT URL: http://vagrantup.com @@ -158,6 +158,8 @@ sed -i -e '/required_ruby_version/ s/, "< 3.2"//' %{name}.gemspec # We have newer version in Fedora %gemspec_remove_dep -s %{name}.gemspec -g listen %gemspec_add_dep -s %{name}.gemspec -g listen '>= 3.5.1' +%gemspec_remove_dep -s %{name}.gemspec -g rubyzip '~> 2.0' +%gemspec_add_dep -s %{name}.gemspec -g rubyzip '>= 2.0.0' # Remove Windows specific dependencies %gemspec_remove_dep -s %{name}.gemspec -g wdm @@ -494,6 +496,9 @@ end %{vagrant_plugin_instdir}/vagrant-spec.config.example.rb %changelog +* Mon Dec 22 2025 Vít Ondruch - 2.3.4-9 +- Relax `rubygem(rubyzip)` dependency + * Fri Jul 25 2025 Fedora Release Engineering - Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild