Skip to content

Instantly share code, notes, and snippets.

@darix
Created August 7, 2017 09:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save darix/b5c5868b8730ae67c62a4f1c6de5125b to your computer and use it in GitHub Desktop.
Save darix/b5c5868b8730ae67c62a4f1c6de5125b to your computer and use it in GitHub Desktop.
Index: ruby2.4.changes
===================================================================
--- ruby2.4.changes (revision 3b04ef0fbc158517468ffdc717fe87f9)
+++ ruby2.4.changes (working copy)
@@ -1,3 +1,10 @@
+-------------------------------------------------------------------
+Mon Aug 7 09:46:16 UTC 2017 - mrueckert@suse.de
+
+- provide a ruby-default symbol and conflict with other providers
+ of that symbol so we can uninstall older default ruby versions
+ during zypper dup.
+
-------------------------------------------------------------------
Mon May 29 11:05:06 UTC 2017 - mrueckert@suse.de
Index: ruby2.4.spec
===================================================================
--- ruby2.4.spec (revision 3b04ef0fbc158517468ffdc717fe87f9)
+++ ruby2.4.spec (working copy)
@@ -49,6 +49,10 @@
%define rb_extversionedarchdir %{_libdir}/ruby/gems/%{rb_ver}/extensions/%{rb_arch_short}/%{rb_ver}
%define rb_extdocdir %{_libdir}/ruby/gems/%{rb_ver}/doc/extensions
%define rb_extarchdocdir %{_libdir}/ruby/gems/%{rb_ver}/doc/extensions/%{rb_arch_short}
+
+%if "%{rb_default_ruby_suffix}" == "%{rb_soname}"
+%define is_default_ruby 1
+%endif
# keep in sync with macro file!
#
@@ -91,7 +95,11 @@
%if 0%{?suse_version} > 1130
Conflicts: ruby(abi) = %{rb_ver}
%endif
-Provides: ruby22 = %{version}-%{release}
+Provides: ruby24 = %{version}-%{release}
+%if 0%{?is_default_ruby}
+Provides: ruby-default = %{version}-%{release}
+Conflicts: otherproviders(ruby-default)
+%endif
Requires: %{libname} = %{version}
Requires: %{name}-stdlib = %{version}
PreReq: update-alternatives
@@ -325,7 +333,7 @@
install -D -m 0644 %{S:2} %{buildroot}/etc/rpm/macros.suse-ruby2.4
mkdir -p %{buildroot}%{_sysconfdir}/alternatives
-%if "%{rb_default_ruby_suffix}" == "%{rb_soname}"
+%if 0%{?is_default_ruby}
install -D -m 0644 %{S:3} %{buildroot}/etc/rpm/macros.suse-ruby2.4-default
for bin in %{buildroot}%{_bindir}/{erb,gem,irb,ruby}%{rb_binary_suffix} ; do
# yes really hard links
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment