From efff136526ef245c795a1f65be530d106f6ffd57b8bedc0dd17dd4c5de7e08a7 Mon Sep 17 00:00:00 2001 From: Johannes Kastl Date: Sat, 17 Nov 2018 19:28:51 +0000 Subject: [PATCH] Accepting request 649814 from home:ojkastl_buildservice:Branch_Virtualization_vagrant fix bash_completion warning on Factory; link directories from /usr/share/vagrant/ to /usr/lib64/ruby/gems/2.5.0/gems/x.y.z/, to avoid ruby errors due to patch 0007 OBS-URL: https://build.opensuse.org/request/show/649814 OBS-URL: https://build.opensuse.org/package/show/Virtualization:vagrant/vagrant?expand=0&rev=18 --- vagrant.changes | 11 +++++++++++ vagrant.spec | 22 ++++++++++++++++++---- 2 files changed, 29 insertions(+), 4 deletions(-) diff --git a/vagrant.changes b/vagrant.changes index 0d0796e..fd2e48a 100644 --- a/vagrant.changes +++ b/vagrant.changes @@ -1,3 +1,14 @@ +------------------------------------------------------------------- +Fri Nov 9 20:24:19 UTC 2018 - Johannes Kastl + +- link directories from /usr/share/vagrant/ to /usr/lib64/ruby/gems/2.5.0/gems/x.y.z/, to avoid ruby errors due to patch 0007 + +------------------------------------------------------------------- +Fri Nov 9 20:19:31 UTC 2018 - Johannes Kastl + +- add Requires and BuildRequires for bash-completion to the vagrant-bash-completion subpackage +- move bash-completion file to %{_datadir}/bash-completion/completions/ to avoid warnings + ------------------------------------------------------------------- Fri Nov 9 14:35:42 UTC 2018 - Johannes Kastl diff --git a/vagrant.spec b/vagrant.spec index 12d191f..67deb79 100644 --- a/vagrant.spec +++ b/vagrant.spec @@ -174,8 +174,10 @@ Summary: Vagrant bash autocompletion Group: Development/Languages/Ruby Supplements: packageand(vagrant:bash) BuildRequires: bash +BuildRequires: bash-completion Requires: vagrant = %{version} Requires: bash +Requires: bash-completion BuildArch: noarch %description bash-completion @@ -186,10 +188,7 @@ Optional dependency offering bash completion for vagrant %patch2 -p1 %patch3 -p1 %patch4 -p1 -# apply patch on tumbleweed only -%if %suse_version >= 1550 %patch7 -p1 -%endif %patch9 -p1 # # @@ -258,6 +257,21 @@ sed -i '1 s/^.*$/#!\/bin\/bash/' %{buildroot}%{gem_base}/gems/%{mod_full_name}/. # change shebang in /etc/bash_completion.d/vagrant.sh sed -i '1d' %{buildroot}%{_sysconfdir}/bash_completion.d/%{mod_name}.sh +# move file to %{_datadir}/bash-completion/completions/ to avoid warnings +install -d 755 %{buildroot}%{_datadir}/bash-completion/completions/ +mv -v %{buildroot}%{_sysconfdir}/bash_completion.d/%{mod_name}.sh %{buildroot}%{_datadir}/bash-completion/completions/ + +%post +# link directories to avoid the following error: +# /usr/lib64/ruby/2.5.0/pathname.rb:444:in `open': No such file or directory @ dir_initialize - /usr/lib64/ruby/gems/2.5.0/gems/vagrant-2.1.2/plugins (Errno::ENOENT) +ln -s %{_datadir}/%{name}/keys %{gem_base}/gems/%{mod_full_name}/keys +ln -s %{_datadir}/%{name}/plugins %{gem_base}/gems/%{mod_full_name}/plugins +ln -s %{_datadir}/%{name}/templates %{gem_base}/gems/%{mod_full_name}/templates + +%postun +rm -f %{gem_base}/gems/%{mod_full_name}/keys +rm -f %{gem_base}/gems/%{mod_full_name}/plugins +rm -f %{gem_base}/gems/%{mod_full_name}/templates %files %defattr(-,root,root,-) @@ -283,6 +297,6 @@ sed -i '1d' %{buildroot}%{_sysconfdir}/bash_completion.d/%{mod_name}.sh %files bash-completion %defattr(-,root,root,-) -%config %{_sysconfdir}/bash_completion.d/%{mod_name}.sh +%{_datadir}/bash-completion/completions/%{mod_name}.sh %changelog