From 7e8d943eaf4c639db144286b520e4f77d981a45e Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: May 12 2020 01:02:49 +0000 Subject: Update to Vagrant 2.2.9. Added support for podman via docker podman-docker wrapper (https://github.com/hashicorp/vagrant/pull/11356). --- 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