Accepting request 1199088 from devel:languages:ruby

Forwarded request #1199087 from darix

- Update to 0.0.5
  reenable conflicts support but only generate conflicts for
  "non-default" gems. the default gems are not actually installed
  into the gem path but their files reside in the normal ruby
  library search path.

- Update to 0.0.4
  disable conflicts for now

OBS-URL: https://build.opensuse.org/request/show/1199088
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/ruby-bundled-gems-rpmhelper?expand=0&rev=2
This commit is contained in:
Ana Guerrero 2024-09-06 15:17:40 +00:00 committed by Git OBS Bridge
commit bf3ab43a32
4 changed files with 53 additions and 13 deletions

View File

@ -1,3 +1,24 @@
-------------------------------------------------------------------
Thu Sep 5 22:40:08 UTC 2024 - Marcus Rueckert <mrueckert@suse.de>
- Update to 0.0.5
reenable conflicts support but only generate conflicts for
"non-default" gems. the default gems are not actually installed
into the gem path but their files reside in the normal ruby
library search path.
-------------------------------------------------------------------
Thu Sep 5 17:55:29 UTC 2024 - Marcus Rueckert <mrueckert@suse.de>
- Update to 0.0.4
disable conflicts for now
-------------------------------------------------------------------
Thu Sep 5 13:13:36 UTC 2024 - Marcus Rueckert <mrueckert@suse.de>
- Update to 0.0.3
add support to add conflicts for the bundled gems
-------------------------------------------------------------------
Fri Feb 8 02:57:39 UTC 2019 - Marcus Rueckert <mrueckert@suse.de>

View File

@ -1,7 +1,7 @@
#
# spec file for package rpm-ruby-bundled-gems
# spec file for package ruby-bundled-gems-rpmhelper
#
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -17,7 +17,7 @@
Name: ruby-bundled-gems-rpmhelper
Version: 0.0.2
Version: 0.0.4
Release: 0
Summary: A little helper to add provides for intree gems during a ruby build
License: MIT

View File

@ -1,2 +1,3 @@
%__ruby_bundled_gems_provides %{_rpmconfigdir}/ruby_bundled_gems.pl
%__ruby_bundled_gems_conflicts %{_rpmconfigdir}/ruby_bundled_gems.pl conflicts
%__ruby_bundled_gems_provides %{_rpmconfigdir}/ruby_bundled_gems.pl provides
%__ruby_bundled_gems_path /usr/lib.*/ruby/gems/.*/specifications/.*\.gemspec$

View File

@ -31,28 +31,46 @@ sub get_version_str($$) {
return ($gem_version);
}
sub handle_line($$$$$) {
my ($line, $ruby_abi, $ruby_abi_version, $gem_name, $gem_version ) = @_;
sub handle_line($$$$$$) {
my ($line, $ruby_abi, $ruby_abi_version, $gem_name, $gem_version, $mode) = @_;
my $release_ref = get_release($gem_version);
my @release = @$release_ref;
my $gem_version_str = get_version_str($gem_version, $release_ref);
my @gem_sub_version;
print ("rubygem($gem_name) = $gem_version_str\n");
print ("rubygem($ruby_abi:$ruby_abi_version:$gem_name) = $gem_version_str\n");
if ("provides" eq $mode) {
print ("rubygem($gem_name) = $gem_version_str\n");
for my $element (@release) {
push(@gem_sub_version, $element);
my $gem_sub_version_str = join('.', @gem_sub_version);
print ("rubygem($ruby_abi:$ruby_abi_version:$gem_name:$gem_sub_version_str) = $gem_version_str\n");
for my $element (@release) {
push(@gem_sub_version, $element);
my $gem_sub_version_str = join('.', @gem_sub_version);
print ("rubygem($ruby_abi:$ruby_abi_version:$gem_name:$gem_sub_version_str) = $gem_version_str\n");
}
}
}
my ($mode) = @ARGV;
if (not defined $mode) {
die "Need to know if you want provides or conflicts\n";
}
my @modes = {conflicts => 1, provides => 1};
if (not $modes[$mode]) {
die "No idea what to do with '$mode'\n";
}
print(STDERR "Running $0 in $mode\n");
my $fh = *STDIN;
while ( ! eof($fh) ) {
defined( my $line = readline $fh ) or die "readline failed: $!";
if ($line =~ /\/usr\/lib\d*\/ruby\/gems\/(?<ruby_abi_version>[^\/]+)\/specifications(\/default)?\/(?<gem_name>.+)-(?<gem_version>\d+\.[^-]+)\.gemspec\n\z/) {
handle_line($line, 'ruby', $+{ruby_abi_version}, $+{gem_name}, $+{gem_version});
if ($line =~ /(?<base_path>\/usr\/lib\d*\/ruby\/gems\/(?<ruby_abi_version>[^\/]+))\/specifications(?<has_default>\/default)?\/(?<gem_name>.+)-(?<gem_version>\d+\.[^-]+)\.gemspec\n\z/) {
## we only need need to conflict when we actually have conflicting files
if ( ("provides" eq $mode ) || ( not(defined($+{has_default})) && "conflicts" eq $mode) ) {
handle_line($line, 'ruby', $+{ruby_abi_version}, $+{gem_name}, $+{gem_version}, $mode);
}
};
}