Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package rubygem-xmlhash for openSUSE:Factory checked in at 2022-04-04 19:26:58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/rubygem-xmlhash (Old) and /work/SRC/openSUSE:Factory/.rubygem-xmlhash.new.1900 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rubygem-xmlhash" Mon Apr 4 19:26:58 2022 rev:23 rq:966845 version:1.3.8 Changes: -------- --- /work/SRC/openSUSE:Factory/rubygem-xmlhash/rubygem-xmlhash.changes 2016-07-15 12:49:35.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.rubygem-xmlhash.new.1900/rubygem-xmlhash.changes 2022-04-04 19:27:45.363599192 +0200 @@ -1,0 +2,11 @@ +Mon Apr 4 14:24:17 UTC 2022 - Stephan Kulow <co...@suse.com> + +updated to version 1.3.8 + see installed History.txt + + === 1.3.8 / 2022-04-04 + + * Do not replace entities while parsing + + +------------------------------------------------------------------- Old: ---- xmlhash-1.3.7.gem New: ---- xmlhash-1.3.8.gem ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ rubygem-xmlhash.spec ++++++ --- /var/tmp/diff_new_pack.r3qcEW/_old 2022-04-04 19:27:45.795594238 +0200 +++ /var/tmp/diff_new_pack.r3qcEW/_new 2022-04-04 19:27:45.803594147 +0200 @@ -1,7 +1,7 @@ # # spec file for package rubygem-xmlhash # -# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -12,7 +12,7 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# Please submit bugfixes or comments via https://bugs.opensuse.org/ # @@ -24,16 +24,16 @@ # Name: rubygem-xmlhash -Version: 1.3.7 +Version: 1.3.8 Release: 0 %define mod_name xmlhash %define mod_full_name %{mod_name}-%{version} # MANUAL +BuildRequires: libxml2-devel BuildRequires: %{rubygem hoe} BuildRequires: %{rubygem pkg-config} BuildRequires: %{rubygem rake-compiler} BuildRequires: %{rubygem rake} -BuildRequires: libxml2-devel BuildRequires: libxslt-devel # /MANUAL BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -41,8 +41,8 @@ BuildRequires: %{rubygem gem2rpm} BuildRequires: %{rubygem rdoc > 3.10} BuildRequires: ruby-macros >= 5 -Url: https://github.com/coolo/xmlhash -Source: http://rubygems.org/gems/%{mod_full_name}.gem +URL: https://github.com/coolo/xmlhash +Source: https://rubygems.org/gems/%{mod_full_name}.gem Source1: gem2rpm.yml Summary: Xmlhash is a naive form of XML::Simple License: MIT ++++++ xmlhash-1.3.7.gem -> xmlhash-1.3.8.gem ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Gemfile new/Gemfile --- old/Gemfile 2012-06-22 16:42:15.000000000 +0200 +++ new/Gemfile 2022-04-04 16:21:05.000000000 +0200 @@ -4,3 +4,4 @@ gem 'rake-compiler' gem 'pkg-config' gem 'json' +gem 'minitest', '>= 5.0.0', group: :test diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/History.txt new/History.txt --- old/History.txt 2012-06-22 16:42:15.000000000 +0200 +++ new/History.txt 2022-04-04 16:21:05.000000000 +0200 @@ -1,3 +1,7 @@ +=== 1.3.8 / 2022-04-04 + +* Do not replace entities while parsing + === 1.3.7 / 2016-07-04 * Fix XML parsing: ignore comments and parse huge TXT nodes diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/README.txt new/README.txt --- old/README.txt 2012-06-22 16:42:15.000000000 +0200 +++ new/README.txt 2022-04-04 16:21:05.000000000 +0200 @@ -37,7 +37,7 @@ (The MIT License) -Copyright (c) 2012 Stephan Kulow +Copyright (c) 2012-2022 Stephan Kulow Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the Binary files old/checksums.yaml.gz and new/checksums.yaml.gz differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ext/xmlhash/extconf.rb new/ext/xmlhash/extconf.rb --- old/ext/xmlhash/extconf.rb 2012-06-22 16:42:15.000000000 +0200 +++ new/ext/xmlhash/extconf.rb 2022-04-04 16:21:05.000000000 +0200 @@ -4,4 +4,5 @@ abort "xml2 is missing. please install libxml2" end $CFLAGS << ' ' + PackageConfig.new('libxml-2.0').cflags +$CFLAGS += " -Werror " create_makefile('xmlhash/xmlhash') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ext/xmlhash/xmlhash.c new/ext/xmlhash/xmlhash.c --- old/ext/xmlhash/xmlhash.c 2012-06-22 16:42:15.000000000 +0200 +++ new/ext/xmlhash/xmlhash.c 2022-04-04 16:21:05.000000000 +0200 @@ -19,6 +19,7 @@ static VALUE m_current = Qnil; static VALUE m_stack = Qnil; static VALUE m_cstring = Qnil; +static VALUE m_mutex = Qnil; static VALUE m_result = Qnil; static VALUE m_xmlClass = Qnil; #ifdef HAVE_RUBY_ENCODING_H @@ -195,6 +196,8 @@ static VALUE parse_xml_hash(VALUE self, VALUE rb_xml) { + rb_mutex_lock(m_mutex); + char *data; xmlTextReaderPtr reader; int ret; @@ -212,7 +215,7 @@ memcpy(data, StringValuePtr(rb_xml), RSTRING_LEN(rb_xml)); reader = xmlReaderForMemory(data, RSTRING_LEN(rb_xml), - NULL, NULL, XML_PARSE_NOENT | XML_PARSE_NOERROR | XML_PARSE_NOWARNING | XML_PARSE_HUGE ); + NULL, NULL, XML_PARSE_NOERROR | XML_PARSE_NOWARNING | XML_PARSE_HUGE ); init_XmlhashParserData(); if (reader != NULL) { @@ -231,6 +234,7 @@ #ifdef HAVE_RUBY_ENCODING_H m_current_encoding = 0; #endif + rb_mutex_unlock(m_mutex); return m_result; } @@ -239,6 +243,8 @@ VALUE mXmlhash; LIBXML_TEST_VERSION + m_mutex = rb_mutex_new(); + rb_global_variable(&m_mutex); mXmlhash = rb_define_module("Xmlhash"); m_xmlClass = rb_define_class_under(mXmlhash, "XMLHash", rb_cHash); rb_define_singleton_method(mXmlhash, "parse_int", &parse_xml_hash, 1); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/xmlhash.rb new/lib/xmlhash.rb --- old/lib/xmlhash.rb 2012-06-22 16:42:15.000000000 +0200 +++ new/lib/xmlhash.rb 2022-04-04 16:21:05.000000000 +0200 @@ -1,7 +1,7 @@ require 'xmlhash/xmlhash' module Xmlhash - VERSION = '1.3.7' + VERSION = '1.3.8' class XMLHash < Hash @@ -65,8 +65,7 @@ end def self.parse(str) - @@mutex ||= Mutex.new - @@mutex.synchronize { parse_int(str) } + parse_int(str) end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/metadata new/metadata --- old/metadata 2016-07-04 17:13:20.000000000 +0200 +++ new/metadata 2022-04-04 16:21:05.000000000 +0200 @@ -1,14 +1,14 @@ --- !ruby/object:Gem::Specification name: xmlhash version: !ruby/object:Gem::Version - version: 1.3.7 + version: 1.3.8 platform: ruby authors: - Stephan Kulow -autorequire: +autorequire: bindir: bin cert_chain: [] -date: 2016-07-04 00:00:00.000000000 Z +date: 2022-04-04 00:00:00.000000000 Z dependencies: - !ruby/object:Gem::Dependency name: pkg-config @@ -25,47 +25,53 @@ - !ruby/object:Gem::Version version: '0' - !ruby/object:Gem::Dependency - name: rdoc + name: rake-compiler requirement: !ruby/object:Gem::Requirement requirements: - - - "~>" + - - ">=" - !ruby/object:Gem::Version - version: '4.0' + version: '0' type: :development prerelease: false version_requirements: !ruby/object:Gem::Requirement requirements: - - - "~>" + - - ">=" - !ruby/object:Gem::Version - version: '4.0' + version: '0' - !ruby/object:Gem::Dependency - name: rake-compiler + name: rdoc requirement: !ruby/object:Gem::Requirement requirements: - - ">=" - !ruby/object:Gem::Version - version: '0' + version: '4.0' + - - "<" + - !ruby/object:Gem::Version + version: '7' type: :development prerelease: false version_requirements: !ruby/object:Gem::Requirement requirements: - - ">=" - !ruby/object:Gem::Version - version: '0' + version: '4.0' + - - "<" + - !ruby/object:Gem::Version + version: '7' - !ruby/object:Gem::Dependency name: hoe requirement: !ruby/object:Gem::Requirement requirements: - - "~>" - !ruby/object:Gem::Version - version: '3.15' + version: '3.23' type: :development prerelease: false version_requirements: !ruby/object:Gem::Requirement requirements: - - "~>" - !ruby/object:Gem::Version - version: '3.15' + version: '3.23' description: |- A small C module that wraps libxml2's xmlreader to parse a XML string into a ruby hash @@ -93,8 +99,9 @@ homepage: https://github.com/coolo/xmlhash licenses: - MIT -metadata: {} -post_install_message: +metadata: + homepage_uri: https://github.com/coolo/xmlhash +post_install_message: rdoc_options: - "--main" - README.txt @@ -111,9 +118,8 @@ - !ruby/object:Gem::Version version: '0' requirements: [] -rubyforge_project: -rubygems_version: 2.4.5.1 -signing_key: +rubygems_version: 3.3.7 +signing_key: specification_version: 4 summary: A small C module that wraps libxml2's xmlreader to parse a XML string into a ruby hash diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/test/test_xmlhash.rb new/test/test_xmlhash.rb --- old/test/test_xmlhash.rb 2012-06-22 16:42:15.000000000 +0200 +++ new/test/test_xmlhash.rb 2022-04-04 16:21:05.000000000 +0200 @@ -1,53 +1,51 @@ # encoding: UTF-8 -require "test/unit" +require "minitest/autorun" require "xmlhash" require 'json' +require 'thread' -Xml = <<eos -<request id="93651"> - <action type="submit"> - <source project="server:dns" package="pdns" rev="65"/> - <target project="openSUSE:Factory" package="pdns"/> - </action> - <state name="revoked" who="coolo" when="2011-12-19T13:20:50"> - <comment/> - </state> - <review state="accepted" by_group="legal-auto" who="licensedigger" when="2011-11-25T15:09:55"> - <comment>Big comment</comment> - </review> - <review state="new" by_group="factory-auto"/> - <history name="review" who="coolo" when="2011-11-25T15:02:53"/> - <history name="declined" who="coolo" when="2011-11-25T16:17:30"> - <comment>please make sure to wait before these depencencies are in openSUSE:Factory: libopendbx-devel, libopendbx1, libopendbxplus1, opendbx-backend-pgsql</comment> - </history> - <description>update and factory fix (forwarded request 86230 from -miska-)</description> -</request> +Minitest::Test.make_my_diffs_pretty! + +Xml = <<~eos + <request id="93651"> + <action type="submit"> + <source project="server:dns" package="pdns" rev="65"/> + <target project="openSUSE:Factory" package="pdns"/> + </action> + <state name="revoked" who="coolo" when="2011-12-19T13:20:50"> + <comment/> + </state> + <review state="accepted" by_group="legal-auto" who="licensedigger" when="2011-11-25T15:09:55"> + <comment>Big comment</comment> + </review> + <review state="new" by_group="factory-auto"/> + <history name="review" who="coolo" when="2011-11-25T15:02:53"/> + <history name="declined" who="coolo" when="2011-11-25T16:17:30"> + <comment>please make sure to wait before these depencencies are in openSUSE:Factory: libopendbx-devel, libopendbx1, libopendbxplus1, opendbx-backend-pgsql</comment> + </history> + <description>update and factory fix (forwarded request 86230 from -miska-)</description> + </request> eos -Output = {"history" => - [{"name" => "review", "when" => "2011-11-25T15:02:53", "who" => "coolo"}, - {"comment" => "please make sure to wait before these depencencies are in openSUSE:Factory: libopendbx-devel, libopendbx1, libopendbxplus1, opendbx-backend-pgsql", - "name" => "declined", "when" => "2011-11-25T16:17:30", "who" => "coolo"} - ], - "review" => +Output = { "history" => + [{ "name" => "review", "when" => "2011-11-25T15:02:53", "who" => "coolo" }, + { "comment" => "please make sure to wait before these depencencies are in openSUSE:Factory: libopendbx-devel, libopendbx1, libopendbxplus1, opendbx-backend-pgsql", + "name" => "declined", "when" => "2011-11-25T16:17:30", "who" => "coolo" }], + "review" => [ - {"comment" => "Big comment", - "by_group" => "legal-auto", - "when" => "2011-11-25T15:09:55", - "who" => "licensedigger", - "state" => "accepted" - }, - {"by_group" => "factory-auto", - "state" => "new"} - ], "action" => {"type" => "submit", "target" => {"project" => "openSUSE:Factory", "package" => "pdns"}, "source" => {"rev" => "65", "project" => "server:dns", "package" => "pdns"}}, "id" => "93651", "description" => "update and factory fix (forwarded request 86230 from -miska-)", "state" => {"comment" => {}, "name" => "revoked", "when" => "2011-12-19T13:20:50", "who" => "coolo"}} - + { "comment" => "Big comment", + "by_group" => "legal-auto", + "when" => "2011-11-25T15:09:55", + "who" => "licensedigger", + "state" => "accepted" }, + { "by_group" => "factory-auto", + "state" => "new" } + ], "action" => { "type" => "submit", "target" => { "project" => "openSUSE:Factory", "package" => "pdns" }, "source" => { "rev" => "65", "project" => "server:dns", "package" => "pdns" } }, "id" => "93651", "description" => "update and factory fix (forwarded request 86230 from -miska-)", "state" => { "comment" => {}, "name" => "revoked", "when" => "2011-12-19T13:20:50", "who" => "coolo" } } -class TestXmlhash < Test::Unit::TestCase +class TestXmlhash < Minitest::Test def test_xml - - - 1000.times { + 1000.times { |i| ret = Xmlhash.parse(Xml) GC.start assert_equal ret, Output @@ -57,43 +55,45 @@ ret = Xmlhash.parse(Xml) assert_equal ret, Output } - end def test_threading - 10.times do - Thread.new do - 100.times do + counter = Array.new(10, 100) + threads = [] + 10.times do |t| + threads << Thread.new do + while counter[t] > 0 do ret = Xmlhash.parse(Xml) + counter[t] -= 1 assert_equal ret, Output end end end + threads.each { |thr| thr.join } end def test_entry - xml = <<eos -<?xml version='1.0' encoding='UTF-8'?> -<directory count="4"> - <entry name="Apache"/> - <entry name="Apache:APR_Pool_Debug"/> - <entry name="Apache:MirrorBrain"/> - <entry name="Apache:Modules"/> -</directory> -eos - - rubyoutput = {"count" => "4", - "entry" => - [{"name" => "Apache"}, - {"name" => "Apache:APR_Pool_Debug"}, - {"name" => "Apache:MirrorBrain"}, - {"name" => "Apache:Modules"}]} + xml = <<~eos + <?xml version='1.0' encoding='UTF-8'?> + <directory count="4"> + <entry name="Apache"/> + <entry name="Apache:APR_Pool_Debug"/> + <entry name="Apache:MirrorBrain"/> + <entry name="Apache:Modules"/> + </directory> + eos + + rubyoutput = { "count" => "4", + "entry" => + [{ "name" => "Apache" }, + { "name" => "Apache:APR_Pool_Debug" }, + { "name" => "Apache:MirrorBrain" }, + { "name" => "Apache:Modules" }] } ret = Xmlhash.parse(xml) assert_equal ret, rubyoutput assert_equal ret.elements("entry").first.value("name"), "Apache" - end def test_encoding @@ -104,21 +104,21 @@ xml = "<?xml version='1.0' encoding='UTF-8'?><name value='Adrian Schr??ter'/>" ret = Xmlhash.parse(xml) - assert_equal ret, {"value" => "Adrian Schr??ter"} + assert_equal ret, { "value" => "Adrian Schr??ter" } assert_equal ret.get("value"), "Adrian Schr??ter" end def test_cdata - xml = <<eos -<sourcediff key="7ebf6606bf56a9f952dda73f0d861738"> - <new name="myfile" md5="299d8fe34c516b078c3d367e3fb460b9" size="12"/> - <diff lines="1">DummyContent</diff> -</sourcediff> -eos + xml = <<~eos + <sourcediff key="7ebf6606bf56a9f952dda73f0d861738"> + <new name="myfile" md5="299d8fe34c516b078c3d367e3fb460b9" size="12"/> + <diff lines="1">DummyContent</diff> + </sourcediff> + eos ret = Xmlhash.parse(xml) - assert_equal ret['diff'], {"lines" => "1", "_content" => "DummyContent"} + assert_equal ret['diff'], { "lines" => "1", "_content" => "DummyContent" } end def test_empty @@ -130,7 +130,12 @@ def test_garbage # unfortunately it's rather challening testing nothing is printed to stderr ret = Xmlhash.parse("asdasdaskdladka") - assert_equal nil, ret + assert_nil ret + end + + def test_entities + ret = Xmlhash.parse("<ents><text><</text><text>></text></ents>") + assert_equal ret, {"text"=>["<", ">"]} end def test_utf8 @@ -161,6 +166,5 @@ xml.encode!('US-ASCII') xh = Xmlhash.parse(xml) assert_equal "UTF-8", xh['title'].encoding.to_s - end end