summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJarek Prokop <jprokop@redhat.com>2023-02-09 13:49:51 +0100
committerJarek Prokop <jprokop@redhat.com>2023-02-09 13:49:51 +0100
commitaec27f7f57d300ebe81c4a6abc88addd1fef5f03 (patch)
tree1b6826c6a402cdb514075adbdc66e94d0c087867
parentaf8e25217eb29e2beb689b849f0c8e1e39b596af (diff)
downloadspdx_rubygems-aec27f7f57d300ebe81c4a6abc88addd1fef5f03.tar.gz
spdx_rubygems-aec27f7f57d300ebe81c4a6abc88addd1fef5f03.tar.xz
spdx_rubygems-aec27f7f57d300ebe81c4a6abc88addd1fef5f03.zip
2023-02-09
-rw-r--r--fedora2spdx.rb36
-rw-r--r--rubygems_fedora_gem2rpm_matches.csv5
-rw-r--r--rubygems_fedora_spdx_state.csv9
-rw-r--r--rubygems_fedora_valid_no_action.csv5
-rw-r--r--rubygems_fedora_valid_spdx.csv6
-rw-r--r--rubygems_try_convert_conjunctions.csv6
6 files changed, 57 insertions, 10 deletions
diff --git a/fedora2spdx.rb b/fedora2spdx.rb
index c41a8ef..df39403 100644
--- a/fedora2spdx.rb
+++ b/fedora2spdx.rb
@@ -60,7 +60,7 @@ class ThreadWorker
def execute(command, pwd: nil, ret_exit: false)
options = {}
options[:chdir] = pwd if pwd
- $stderr.puts "Executing: #{command}"
+ $stderr.puts "Executing: #{command} in #{pwd}"
sleep 0.5
stdout, stderr, status = Open3.capture3(command, options)
@@ -105,7 +105,9 @@ ThreadWorker.new(csv) do |slice|
end.gather_pool
# Sigh... they have tar as rubygem source...
-EXCLUDED_SOURCES = %w[rubygem-morph-cli rubygem-krb5-auth rubygem-asciidoctor rubygem-rgen rubygem-net-irc].freeze
+EXCLUDED_SOURCES = %w[rubygem-krb5-auth rubygem-rgen rubygem-net-irc].freeze
+
+TAR_SOURCES = %w[rubygem-morph-cli rubygem-asciidoctor].freeze
orphaned = []
@@ -125,7 +127,7 @@ ThreadWorker.new(csv) do |slice|
next unless dir.empty?
- next if EXCLUDED_SOURCES.include? name
+ next if (EXCLUDED_SOURCES + TAR_SOURCES).include? name
raise "#{dir} ; too much stuff" if dir.size > 1
@@ -142,6 +144,32 @@ ThreadWorker.new(csv) do |slice|
end
end.gather_pool.reject(&:nil?)
+# Prepare special sources...
+TAR_SOURCES.each do |src|
+ name = src
+
+ counter = 0
+ begin
+ ThreadWorker.execute("fedpkg sources", pwd: name)
+ rescue ThreadWorker::CommandError => e
+ counter += 1
+ retry if counter <= 5
+ raise e
+ end
+
+ ThreadWorker.execute("tar -axzf *.tar.gz", pwd: name) unless Dir["#{name}/*.tar.gz"].empty? || Dir["#{name}/*.tar.gz"].first&.match?(/(spec|test|feature|cucumber)/)
+ ThreadWorker.execute("tar -axf *.tar.xz", pwd: name) unless Dir["#{name}/*.tar.xz"].empty? || Dir["#{name}/*.tar.xz"].first&.match?(/(spec|test|feature|cucumber)/)
+
+ next if Dir["#{name}/*/*.gemspec"].empty?
+ next if File.read(Dir["#{name}/*/*.gemspec"].first).match "THIS FILE WAS AUTOGENERATED, DO NOT EDIT"
+
+ ThreadWorker
+ .execute("gem build *.gemspec", pwd: Dir["#{name}/*"].filter { |f| File.directory? f }.first)
+
+ FileUtils.cp(Dir["#{name}/*/*.gem"].first, "#{name}/")
+end
+
+
res = if File.exist?("gem2rpm.cache")
File.read("gem2rpm.cache").split("\n")
else
@@ -266,7 +294,7 @@ license_check = ->(fedora_license) {
end
}
-ret = ThreadWorker.new(res)do |slice|
+ret = ThreadWorker.new(res) do |slice|
slice.map do |arr|
gem2rpm_name = arr[0]
gem2rpm_ver = arr[1]
diff --git a/rubygems_fedora_gem2rpm_matches.csv b/rubygems_fedora_gem2rpm_matches.csv
index 3d329a8..87c70ed 100644
--- a/rubygems_fedora_gem2rpm_matches.csv
+++ b/rubygems_fedora_gem2rpm_matches.csv
@@ -17,6 +17,7 @@ true;0;acts_as_list;MIT;MIT
true;0;addressable;Apache-2.0;Apache-2.0
true;0;afm;MIT;MIT
true;0;algorithms;MIT;MIT
+true;0;asciidoctor;MIT;MIT
true;0;asciidoctor-pdf;MIT;MIT
true;0;async_sinatra;MIT;MIT
true;0;backports;MIT;MIT
@@ -149,6 +150,7 @@ true;0;minitest-profile;MIT;MIT
true;0;minitest-stub-const;MIT;MIT
true;0;mizuho;MIT;MIT
true;0;mongoid;MIT;MIT
+true;0;morph-cli;MIT;MIT
true;0;multi_json;MIT;MIT
true;0;multi_test;MIT;MIT
true;0;multi_xml;MIT;MIT
@@ -183,6 +185,7 @@ true;0;pry;MIT;MIT
true;0;pry-byebug;MIT;MIT
true;0;puma;BSD-3-Clause;BSD-3-Clause
true;0;pundit;MIT;MIT
+true;0;puppet-resource_api;Apache-2.0;Apache-2.0
true;0;rack-cache;MIT;MIT
true;0;rack-cors;MIT;MIT
true;0;rack-protection;MIT;MIT
@@ -201,6 +204,7 @@ true;0;rb-inotify;MIT;MIT
true;0;rbvmomi;MIT;MIT
true;0;red-colors;MIT;MIT
true;0;redis;MIT;MIT
+true;0;redis-client;MIT;MIT
true;0;ref;MIT;MIT
true;0;regexp_parser;MIT;MIT
true;0;regexp_property_values;MIT;MIT
@@ -233,6 +237,7 @@ true;0;sassc;MIT;MIT
true;0;scrub_rb;MIT;MIT
true;0;sd_notify;MIT;MIT
true;0;semantic;MIT;MIT
+true;0;semantic_puppet;Apache-2.0;Apache-2.0
true;0;sequel;MIT;MIT
true;0;shellany;MIT;MIT
true;0;shoulda;MIT;MIT
diff --git a/rubygems_fedora_spdx_state.csv b/rubygems_fedora_spdx_state.csv
index 6770897..2755444 100644
--- a/rubygems_fedora_spdx_state.csv
+++ b/rubygems_fedora_spdx_state.csv
@@ -21,6 +21,7 @@ true;0;algorithms;MIT;MIT
false;0;ammeter;MIT;
false;0;apipie-rails;MIT AND Apache-2.0;
false;0;appraisal;MIT;
+true;0;asciidoctor;MIT;MIT
true;0;asciidoctor-pdf;MIT;MIT
true;0;async_sinatra;MIT;MIT
false;0;awesome_print;MIT;
@@ -171,11 +172,11 @@ true;0;minitest;MIT;MIT
true;0;minitest-around;MIT;MIT
true;0;minitest-profile;MIT;MIT
true;0;minitest-stub-const;MIT;MIT
-false;0;minitest;MIT;
true;0;mizuho;MIT;MIT
false;0;mkrf;MIT;
true;0;mongoid;MIT;MIT
false;0;moped;MIT;
+true;0;morph-cli;MIT;MIT
true;0;multi_json;MIT;MIT
true;0;multi_test;MIT;MIT
true;0;multi_xml;MIT;MIT
@@ -216,6 +217,7 @@ false;0;public_suffix;MIT AND MPL-2.0;MIT
true;0;puma;BSD-3-Clause;BSD-3-Clause
true;0;pundit;MIT;MIT
false;0;puppet-lint;MIT;
+true;0;puppet-resource_api;Apache-2.0;Apache-2.0
false;0;rack-accept;MIT;
true;0;rack-cache;MIT;MIT
true;0;rack-cors;MIT;MIT
@@ -236,6 +238,7 @@ true;0;rb-inotify;MIT;MIT
true;0;rbvmomi;MIT;MIT
true;0;red-colors;MIT;MIT
true;0;redis;MIT;MIT
+true;0;redis-client;MIT;MIT
true;0;ref;MIT;MIT
true;0;regexp_parser;MIT;MIT
true;0;regexp_property_values;MIT;MIT
@@ -271,6 +274,7 @@ true;0;sassc;MIT;MIT
true;0;scrub_rb;MIT;MIT
true;0;sd_notify;MIT;MIT
true;0;semantic;MIT;MIT
+true;0;semantic_puppet;Apache-2.0;Apache-2.0
true;0;sequel;MIT;MIT
false;0;settingslogic;MIT;
true;0;shellany;MIT;MIT
@@ -365,7 +369,6 @@ false;1;gio2;LGPLv2;LGPL-2.1+
false;1;glib2;LGPLv2;LGPL-2.1+
false;1;gobject-introspection;LGPLv2+;LGPL-2.1+
false;1;goocanvas;LGPLv2;LGPLv2.1 or later
-false;1;goocanvas;LGPLv2;
false;1;gstreamer;LGPLv2;LGPL-2.1+
false;1;gtk2;LGPLv2;LGPL-2.1+
false;1;gtk3;LGPLv2+;LGPL-2.1+
@@ -421,7 +424,6 @@ false;1;prawn-icon;Ruby or GPLv2 or GPLv3;RUBY and GPL-2 and GPL-3
false;1;prawn-table;Ruby or GPLv2 or GPLv3;RUBY and GPL-2 and GPL-3
false;1;prawn-templates;Ruby or GPLv2 or GPLv3;Nonstandard and GPL-2.0 and GPL-3.0
false;1;protobuf;MIT and BSD;MIT
-false;1;puppet-resource_api;ASL 2.0;Apache-2.0
false;1;rabbit;GPLv2+ and CC-BY;GPLv2+
false;1;racc;BSD;Ruby and BSD-2-Clause
false;1;rack;MIT and BSD;MIT
@@ -442,7 +444,6 @@ false;1;sass-twitter-bootstrap;ASL 2.0;
false;1;sassc-rails;MIT and OFL;MIT
false;1;scanf;BSD;BSD-2-Clause
false;1;selenium-webdriver;ASL 2.0;Apache-2.0
-false;1;semantic_puppet;ASL 2.0;Apache-2.0
false;1;serialport;GPLv2;GPL-2
false;1;sinatra-rabbit;ASL 2.0;
false;1;sqlite3;BSD;BSD-3-Clause
diff --git a/rubygems_fedora_valid_no_action.csv b/rubygems_fedora_valid_no_action.csv
index 79f1e2c..3e52b54 100644
--- a/rubygems_fedora_valid_no_action.csv
+++ b/rubygems_fedora_valid_no_action.csv
@@ -17,6 +17,7 @@ true;0;acts_as_list;MIT;MIT
true;0;addressable;Apache-2.0;Apache-2.0
true;0;afm;MIT;MIT
true;0;algorithms;MIT;MIT
+true;0;asciidoctor;MIT;MIT
true;0;asciidoctor-pdf;MIT;MIT
true;0;async_sinatra;MIT;MIT
true;0;backports;MIT;MIT
@@ -149,6 +150,7 @@ true;0;minitest-profile;MIT;MIT
true;0;minitest-stub-const;MIT;MIT
true;0;mizuho;MIT;MIT
true;0;mongoid;MIT;MIT
+true;0;morph-cli;MIT;MIT
true;0;multi_json;MIT;MIT
true;0;multi_test;MIT;MIT
true;0;multi_xml;MIT;MIT
@@ -183,6 +185,7 @@ true;0;pry;MIT;MIT
true;0;pry-byebug;MIT;MIT
true;0;puma;BSD-3-Clause;BSD-3-Clause
true;0;pundit;MIT;MIT
+true;0;puppet-resource_api;Apache-2.0;Apache-2.0
true;0;rack-cache;MIT;MIT
true;0;rack-cors;MIT;MIT
true;0;rack-protection;MIT;MIT
@@ -201,6 +204,7 @@ true;0;rb-inotify;MIT;MIT
true;0;rbvmomi;MIT;MIT
true;0;red-colors;MIT;MIT
true;0;redis;MIT;MIT
+true;0;redis-client;MIT;MIT
true;0;ref;MIT;MIT
true;0;regexp_parser;MIT;MIT
true;0;regexp_property_values;MIT;MIT
@@ -233,6 +237,7 @@ true;0;sassc;MIT;MIT
true;0;scrub_rb;MIT;MIT
true;0;sd_notify;MIT;MIT
true;0;semantic;MIT;MIT
+true;0;semantic_puppet;Apache-2.0;Apache-2.0
true;0;sequel;MIT;MIT
true;0;shellany;MIT;MIT
true;0;shoulda;MIT;MIT
diff --git a/rubygems_fedora_valid_spdx.csv b/rubygems_fedora_valid_spdx.csv
index 0eeef07..a33c2bf 100644
--- a/rubygems_fedora_valid_spdx.csv
+++ b/rubygems_fedora_valid_spdx.csv
@@ -20,6 +20,7 @@ true;0;algorithms;MIT;MIT
false;0;ammeter;MIT;
false;0;apipie-rails;MIT AND Apache-2.0;
false;0;appraisal;MIT;
+true;0;asciidoctor;MIT;MIT
true;0;asciidoctor-pdf;MIT;MIT
true;0;async_sinatra;MIT;MIT
false;0;awesome_print;MIT;
@@ -170,11 +171,11 @@ true;0;minitest;MIT;MIT
true;0;minitest-around;MIT;MIT
true;0;minitest-profile;MIT;MIT
true;0;minitest-stub-const;MIT;MIT
-false;0;minitest;MIT;
true;0;mizuho;MIT;MIT
false;0;mkrf;MIT;
true;0;mongoid;MIT;MIT
false;0;moped;MIT;
+true;0;morph-cli;MIT;MIT
true;0;multi_json;MIT;MIT
true;0;multi_test;MIT;MIT
true;0;multi_xml;MIT;MIT
@@ -215,6 +216,7 @@ false;0;public_suffix;MIT AND MPL-2.0;MIT
true;0;puma;BSD-3-Clause;BSD-3-Clause
true;0;pundit;MIT;MIT
false;0;puppet-lint;MIT;
+true;0;puppet-resource_api;Apache-2.0;Apache-2.0
false;0;rack-accept;MIT;
true;0;rack-cache;MIT;MIT
true;0;rack-cors;MIT;MIT
@@ -235,6 +237,7 @@ true;0;rb-inotify;MIT;MIT
true;0;rbvmomi;MIT;MIT
true;0;red-colors;MIT;MIT
true;0;redis;MIT;MIT
+true;0;redis-client;MIT;MIT
true;0;ref;MIT;MIT
true;0;regexp_parser;MIT;MIT
true;0;regexp_property_values;MIT;MIT
@@ -270,6 +273,7 @@ true;0;sassc;MIT;MIT
true;0;scrub_rb;MIT;MIT
true;0;sd_notify;MIT;MIT
true;0;semantic;MIT;MIT
+true;0;semantic_puppet;Apache-2.0;Apache-2.0
true;0;sequel;MIT;MIT
false;0;settingslogic;MIT;
true;0;shellany;MIT;MIT
diff --git a/rubygems_try_convert_conjunctions.csv b/rubygems_try_convert_conjunctions.csv
index b2dd70f..b7e9833 100644
--- a/rubygems_try_convert_conjunctions.csv
+++ b/rubygems_try_convert_conjunctions.csv
@@ -20,6 +20,7 @@ true;0;algorithms;MIT;MIT
false;0;ammeter;MIT;
false;0;apipie-rails;MIT AND Apache-2.0;
false;0;appraisal;MIT;
+true;0;asciidoctor;MIT;MIT
true;0;asciidoctor-pdf;MIT;MIT
true;0;async_sinatra;MIT;MIT
false;0;awesome_print;MIT;
@@ -171,11 +172,11 @@ true;0;minitest;MIT;MIT
true;0;minitest-around;MIT;MIT
true;0;minitest-profile;MIT;MIT
true;0;minitest-stub-const;MIT;MIT
-false;0;minitest;MIT;
true;0;mizuho;MIT;MIT
false;0;mkrf;MIT;
true;0;mongoid;MIT;MIT
false;0;moped;MIT;
+true;0;morph-cli;MIT;MIT
true;0;multi_json;MIT;MIT
true;0;multi_test;MIT;MIT
true;0;multi_xml;MIT;MIT
@@ -217,6 +218,7 @@ false;0;public_suffix;MIT AND MPL-2.0;MIT
true;0;puma;BSD-3-Clause;BSD-3-Clause
true;0;pundit;MIT;MIT
false;0;puppet-lint;MIT;
+true;0;puppet-resource_api;Apache-2.0;Apache-2.0
false;0;rack-accept;MIT;
true;0;rack-cache;MIT;MIT
true;0;rack-cors;MIT;MIT
@@ -238,6 +240,7 @@ true;0;rbvmomi;MIT;MIT
true;0;red-colors;MIT;MIT
false;0;redcarpet;MIT AND ISC;MIT
true;0;redis;MIT;MIT
+true;0;redis-client;MIT;MIT
true;0;ref;MIT;MIT
true;0;regexp_parser;MIT;MIT
true;0;regexp_property_values;MIT;MIT
@@ -273,6 +276,7 @@ true;0;sassc;MIT;MIT
true;0;scrub_rb;MIT;MIT
true;0;sd_notify;MIT;MIT
true;0;semantic;MIT;MIT
+true;0;semantic_puppet;Apache-2.0;Apache-2.0
true;0;sequel;MIT;MIT
false;0;settingslogic;MIT;
true;0;shellany;MIT;MIT