diff options
author | Diego Elio Pettenò <flameeyes@gentoo.org> | 2010-02-01 16:39:24 +0000 |
---|---|---|
committer | Diego Elio Pettenò <flameeyes@gentoo.org> | 2010-02-01 16:39:24 +0000 |
commit | 34e7494d583ecf0b385f542842e418d018e2f31d (patch) | |
tree | 1b3939a8b64cccf99f1e684bb9a7a2f49a547035 /dev-ruby/hpricot | |
parent | Stable on amd64 wrt bug #302733 (diff) | |
download | historical-34e7494d583ecf0b385f542842e418d018e2f31d.tar.gz historical-34e7494d583ecf0b385f542842e418d018e2f31d.tar.bz2 historical-34e7494d583ecf0b385f542842e418d018e2f31d.zip |
Add a patch to fix a big bug on JRuby.
Package-Manager: portage-2.2_rc62/cvs/Linux x86_64
Diffstat (limited to 'dev-ruby/hpricot')
-rw-r--r-- | dev-ruby/hpricot/ChangeLog | 8 | ||||
-rw-r--r-- | dev-ruby/hpricot/Manifest | 12 | ||||
-rw-r--r-- | dev-ruby/hpricot/files/hpricot-0.8.2-jruby.patch | 203 | ||||
-rw-r--r-- | dev-ruby/hpricot/hpricot-0.8.2-r1.ebuild | 44 |
4 files changed, 261 insertions, 6 deletions
diff --git a/dev-ruby/hpricot/ChangeLog b/dev-ruby/hpricot/ChangeLog index 98f8f0ff2fa6..e73fc4b3f8c2 100644 --- a/dev-ruby/hpricot/ChangeLog +++ b/dev-ruby/hpricot/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for dev-ruby/hpricot # Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/dev-ruby/hpricot/ChangeLog,v 1.19 2010/01/16 08:33:22 fauli Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-ruby/hpricot/ChangeLog,v 1.20 2010/02/01 16:39:24 flameeyes Exp $ + +*hpricot-0.8.2-r1 (01 Feb 2010) + + 01 Feb 2010; Diego E. Pettenò <flameeyes@gentoo.org> + +hpricot-0.8.2-r1.ebuild, +files/hpricot-0.8.2-jruby.patch: + Add a patch to fix a big bug on JRuby. 16 Jan 2010; Christian Faulhammer <fauli@gentoo.org> hpricot-0.8.2.ebuild: Transfer Prefix keywords diff --git a/dev-ruby/hpricot/Manifest b/dev-ruby/hpricot/Manifest index 58aca9b0f69f..bfc3510b5dff 100644 --- a/dev-ruby/hpricot/Manifest +++ b/dev-ruby/hpricot/Manifest @@ -1,18 +1,20 @@ -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 +AUX hpricot-0.8.2-jruby.patch 11246 RMD160 8677247d960c3554b576f5ca7fab8e3edc32d511 SHA1 fddf0a60298de43b159bc38e8a08f0223b4cc191 SHA256 a13a7fa2f42b44159af6b2e59a7b1e48c4b6c3bc267d46b6c6cfe6c5222e39fc DIST hpricot-0.6.gem 217088 RMD160 80f785afd1d25219b6769271201733a934b52450 SHA1 4be23c83200d8446f25d2441a5154f53d41a34f2 SHA256 8c40e3767d2e6b31c70b534c86c8f68c3648516b5b8e1f9515f6311088eff3c1 DIST hpricot-0.8.2.gem 264192 RMD160 62aa2baa642167ca04ed4cfe1822692984e35985 SHA1 f6f65d9c5c6e64acafbe23d0c6080c3c99007464 SHA256 dce03d440b119df494b24e883f4e73be925d74cc30545c8b82364ad9bca715aa DIST hpricot-0.8.tar.bz2 219106 RMD160 543ed6d9e9e13a7405fd4bec3d790c2bcdb92a7d SHA1 99fcc93f4f2abf8cf5a648c60a6ddd34153dddf4 SHA256 676e3f232bc7e4be71340189f040f1f268c532506d7e9b0ad9b769bccf443660 EBUILD hpricot-0.6.ebuild 541 RMD160 9746bf258354fa2f0e71a7e5ba4d09e3a52534a7 SHA1 f8401903afe2e22511aaaba690b0994eb72f2bff SHA256 1647acf5354d6f0cfbfc46c7966049bfd2e4079cee88e7bea4c1be6e9bd7dafe +EBUILD hpricot-0.8.2-r1.ebuild 1130 RMD160 8e6de5ca8b0c657de08c77be362b95f0acd26eb4 SHA1 d8f6184d889b9bd52eda866d0d74df1f5bb50e68 SHA256 5d4b3eff0f41c308ab88e99a51c49f50a8850f8ee912ab3ec6892bf6768d72a5 EBUILD hpricot-0.8.2.ebuild 1022 RMD160 96b0e22ffc98a86bad59d6d67701a07319448698 SHA1 8cf12f2ec1c53991ba7e9ade00f6a4f9d44973b3 SHA256 5535ad8f97e207a6d52019a778b482dc2fc371e6b3bcf3e753be78fc3b33c3cb EBUILD hpricot-0.8.ebuild 1536 RMD160 c6d5d024d73a8c27bffbb4c9dfa7d13f44065388 SHA1 3d96fce260cbc6d0db5997598c06ee19374eb03f SHA256 6fe0bfff5d04a8c026d2c4c7ed572adb0fd8517e5ee867f8ac65e0c87daa7b6c -MISC ChangeLog 2488 RMD160 9644ee7a7f18c037a2916cf58e858005744c0fb6 SHA1 7138ea94bce601bced80c2c885a3be73a2083071 SHA256 69c44a03eebdb8ac6f5d9ea431e089bf6c92a62dfc35360e10099332d6332cab +MISC ChangeLog 2685 RMD160 4649a799445f922d0524152c6d09a5008a65b3c5 SHA1 51c154b2a2f85ef693dd31083ac6672cf9723bd3 SHA256 6f326efe750bb4131dae8947fabf4abddaf9a9079e2f13d712e78f7596fb6dd6 MISC metadata.xml 158 RMD160 097f8145a9994f98be4971b43b23b9e5e8bccb66 SHA1 7ac646714b1ab83fda98f3ccdd8b48a31c148b27 SHA256 70b396ab3c7a63a81cb895b7728bd9eccdc9770afdb9919f2c54694b685f7032 -----BEGIN PGP SIGNATURE----- -Version: GnuPG v2.0.11 (GNU/Linux) +Version: GnuPG v2.0.14 (GNU/Linux) -iEYEARECAAYFAktRedgACgkQNQqtfCuFnePMdACfdKTfCe7KxU0txFK4lBtm85Ci -rokAnAn8oWT45AWG6enYGX69kIsmLQO2 -=rqI/ +iEYEARECAAYFAktnA8sACgkQAiZjviIA2XgGOgCghUZn4ZeRa1crPA6JH3IztwJx +NpYAniQqIJC/DYLVctWlr/l7nPPgR9SM +=Baao -----END PGP SIGNATURE----- diff --git a/dev-ruby/hpricot/files/hpricot-0.8.2-jruby.patch b/dev-ruby/hpricot/files/hpricot-0.8.2-jruby.patch new file mode 100644 index 000000000000..4c47951ec239 --- /dev/null +++ b/dev-ruby/hpricot/files/hpricot-0.8.2-jruby.patch @@ -0,0 +1,203 @@ +From 26708b9e80110c14a9d9fe7f974fc544f86b702a Mon Sep 17 00:00:00 2001 +From: Ola Bini <ola.bini@gmail.com> +Date: Mon, 1 Feb 2010 16:46:02 +0100 +Subject: [PATCH] Fix bug #11 - sort out some bad casts on JRuby + +--- + ext/hpricot_scan/HpricotScanService.java | 33 +++++++++++++++++++---------- + ext/hpricot_scan/hpricot_scan.java.rl | 33 +++++++++++++++++++---------- + 2 files changed, 42 insertions(+), 24 deletions(-) + +diff --git a/ext/hpricot_scan/HpricotScanService.java b/ext/hpricot_scan/HpricotScanService.java +index d921309..c5fe796 100644 +--- a/ext/hpricot_scan/HpricotScanService.java ++++ b/ext/hpricot_scan/HpricotScanService.java +@@ -139,62 +139,62 @@ public class HpricotScanService implements BasicLibraryService { + + // H_ATTR(target) + public static IRubyObject hpricot_ele_set_target(IRubyObject self, IRubyObject x) { +- ((RubyHash)H_ELE_GET(self, H_ELE_ATTR)).fastASet(self.getRuntime().newSymbol("target"), x); ++ H_ELE_GET_asHash(self, H_ELE_ATTR).fastASet(self.getRuntime().newSymbol("target"), x); + return self; + } + + public static IRubyObject hpricot_ele_get_target(IRubyObject self) { +- return ((RubyHash)H_ELE_GET(self, H_ELE_ATTR)).op_aref(self.getRuntime().getCurrentContext(), self.getRuntime().newSymbol("target")); ++ return H_ELE_GET_asHash(self, H_ELE_ATTR).op_aref(self.getRuntime().getCurrentContext(), self.getRuntime().newSymbol("target")); + } + + // H_ATTR(encoding) + public static IRubyObject hpricot_ele_set_encoding(IRubyObject self, IRubyObject x) { +- ((RubyHash)H_ELE_GET(self, H_ELE_ATTR)).fastASet(self.getRuntime().newSymbol("encoding"), x); ++ ((RubyHash)H_ELE_GET_asHash(self, H_ELE_ATTR)).fastASet(self.getRuntime().newSymbol("encoding"), x); + return self; + } + + public static IRubyObject hpricot_ele_get_encoding(IRubyObject self) { +- return ((RubyHash)H_ELE_GET(self, H_ELE_ATTR)).op_aref(self.getRuntime().getCurrentContext(), self.getRuntime().newSymbol("encoding")); ++ return ((RubyHash)H_ELE_GET_asHash(self, H_ELE_ATTR)).op_aref(self.getRuntime().getCurrentContext(), self.getRuntime().newSymbol("encoding")); + } + + // H_ATTR(version) + public static IRubyObject hpricot_ele_set_version(IRubyObject self, IRubyObject x) { +- ((RubyHash)H_ELE_GET(self, H_ELE_ATTR)).fastASet(self.getRuntime().newSymbol("version"), x); ++ ((RubyHash)H_ELE_GET_asHash(self, H_ELE_ATTR)).fastASet(self.getRuntime().newSymbol("version"), x); + return self; + } + + public static IRubyObject hpricot_ele_get_version(IRubyObject self) { +- return ((RubyHash)H_ELE_GET(self, H_ELE_ATTR)).op_aref(self.getRuntime().getCurrentContext(), self.getRuntime().newSymbol("version")); ++ return ((RubyHash)H_ELE_GET_asHash(self, H_ELE_ATTR)).op_aref(self.getRuntime().getCurrentContext(), self.getRuntime().newSymbol("version")); + } + + // H_ATTR(standalone) + public static IRubyObject hpricot_ele_set_standalone(IRubyObject self, IRubyObject x) { +- ((RubyHash)H_ELE_GET(self, H_ELE_ATTR)).fastASet(self.getRuntime().newSymbol("standalone"), x); ++ ((RubyHash)H_ELE_GET_asHash(self, H_ELE_ATTR)).fastASet(self.getRuntime().newSymbol("standalone"), x); + return self; + } + + public static IRubyObject hpricot_ele_get_standalone(IRubyObject self) { +- return ((RubyHash)H_ELE_GET(self, H_ELE_ATTR)).op_aref(self.getRuntime().getCurrentContext(), self.getRuntime().newSymbol("standalone")); ++ return ((RubyHash)H_ELE_GET_asHash(self, H_ELE_ATTR)).op_aref(self.getRuntime().getCurrentContext(), self.getRuntime().newSymbol("standalone")); + } + + // H_ATTR(system_id) + public static IRubyObject hpricot_ele_set_system_id(IRubyObject self, IRubyObject x) { +- ((RubyHash)H_ELE_GET(self, H_ELE_ATTR)).fastASet(self.getRuntime().newSymbol("system_id"), x); ++ ((RubyHash)H_ELE_GET_asHash(self, H_ELE_ATTR)).fastASet(self.getRuntime().newSymbol("system_id"), x); + return self; + } + + public static IRubyObject hpricot_ele_get_system_id(IRubyObject self) { +- return ((RubyHash)H_ELE_GET(self, H_ELE_ATTR)).op_aref(self.getRuntime().getCurrentContext(), self.getRuntime().newSymbol("system_id")); ++ return ((RubyHash)H_ELE_GET_asHash(self, H_ELE_ATTR)).op_aref(self.getRuntime().getCurrentContext(), self.getRuntime().newSymbol("system_id")); + } + + // H_ATTR(public_id) + public static IRubyObject hpricot_ele_set_public_id(IRubyObject self, IRubyObject x) { +- ((RubyHash)H_ELE_GET(self, H_ELE_ATTR)).fastASet(self.getRuntime().newSymbol("public_id"), x); ++ ((RubyHash)H_ELE_GET_asHash(self, H_ELE_ATTR)).fastASet(self.getRuntime().newSymbol("public_id"), x); + return self; + } + + public static IRubyObject hpricot_ele_get_public_id(IRubyObject self) { +- return ((RubyHash)H_ELE_GET(self, H_ELE_ATTR)).op_aref(self.getRuntime().getCurrentContext(), self.getRuntime().newSymbol("public_id")); ++ return ((RubyHash)H_ELE_GET_asHash(self, H_ELE_ATTR)).op_aref(self.getRuntime().getCurrentContext(), self.getRuntime().newSymbol("public_id")); + } + + public static class Scanner { +@@ -1903,6 +1903,15 @@ case 5: + return ((IRubyObject[])recv.dataGetStruct())[n]; + } + ++ public static RubyHash H_ELE_GET_asHash(IRubyObject recv, int n) { ++ IRubyObject obj = ((IRubyObject[])recv.dataGetStruct())[n]; ++ if(obj.isNil()) { ++ obj = RubyHash.newHash(recv.getRuntime()); ++ ((IRubyObject[])recv.dataGetStruct())[n] = obj; ++ } ++ return (RubyHash)obj; ++ } ++ + public static IRubyObject H_ELE_SET(IRubyObject recv, int n, IRubyObject value) { + ((IRubyObject[])recv.dataGetStruct())[n] = value; + return value; +diff --git a/ext/hpricot_scan/hpricot_scan.java.rl b/ext/hpricot_scan/hpricot_scan.java.rl +index d1fb04b..1821761 100644 +--- a/ext/hpricot_scan/hpricot_scan.java.rl ++++ b/ext/hpricot_scan/hpricot_scan.java.rl +@@ -137,62 +137,62 @@ public class HpricotScanService implements BasicLibraryService { + + // H_ATTR(target) + public static IRubyObject hpricot_ele_set_target(IRubyObject self, IRubyObject x) { +- ((RubyHash)H_ELE_GET(self, H_ELE_ATTR)).fastASet(self.getRuntime().newSymbol("target"), x); ++ H_ELE_GET_asHash(self, H_ELE_ATTR).fastASet(self.getRuntime().newSymbol("target"), x); + return self; + } + + public static IRubyObject hpricot_ele_get_target(IRubyObject self) { +- return ((RubyHash)H_ELE_GET(self, H_ELE_ATTR)).op_aref(self.getRuntime().getCurrentContext(), self.getRuntime().newSymbol("target")); ++ return H_ELE_GET_asHash(self, H_ELE_ATTR).op_aref(self.getRuntime().getCurrentContext(), self.getRuntime().newSymbol("target")); + } + + // H_ATTR(encoding) + public static IRubyObject hpricot_ele_set_encoding(IRubyObject self, IRubyObject x) { +- ((RubyHash)H_ELE_GET(self, H_ELE_ATTR)).fastASet(self.getRuntime().newSymbol("encoding"), x); ++ ((RubyHash)H_ELE_GET_asHash(self, H_ELE_ATTR)).fastASet(self.getRuntime().newSymbol("encoding"), x); + return self; + } + + public static IRubyObject hpricot_ele_get_encoding(IRubyObject self) { +- return ((RubyHash)H_ELE_GET(self, H_ELE_ATTR)).op_aref(self.getRuntime().getCurrentContext(), self.getRuntime().newSymbol("encoding")); ++ return ((RubyHash)H_ELE_GET_asHash(self, H_ELE_ATTR)).op_aref(self.getRuntime().getCurrentContext(), self.getRuntime().newSymbol("encoding")); + } + + // H_ATTR(version) + public static IRubyObject hpricot_ele_set_version(IRubyObject self, IRubyObject x) { +- ((RubyHash)H_ELE_GET(self, H_ELE_ATTR)).fastASet(self.getRuntime().newSymbol("version"), x); ++ ((RubyHash)H_ELE_GET_asHash(self, H_ELE_ATTR)).fastASet(self.getRuntime().newSymbol("version"), x); + return self; + } + + public static IRubyObject hpricot_ele_get_version(IRubyObject self) { +- return ((RubyHash)H_ELE_GET(self, H_ELE_ATTR)).op_aref(self.getRuntime().getCurrentContext(), self.getRuntime().newSymbol("version")); ++ return ((RubyHash)H_ELE_GET_asHash(self, H_ELE_ATTR)).op_aref(self.getRuntime().getCurrentContext(), self.getRuntime().newSymbol("version")); + } + + // H_ATTR(standalone) + public static IRubyObject hpricot_ele_set_standalone(IRubyObject self, IRubyObject x) { +- ((RubyHash)H_ELE_GET(self, H_ELE_ATTR)).fastASet(self.getRuntime().newSymbol("standalone"), x); ++ ((RubyHash)H_ELE_GET_asHash(self, H_ELE_ATTR)).fastASet(self.getRuntime().newSymbol("standalone"), x); + return self; + } + + public static IRubyObject hpricot_ele_get_standalone(IRubyObject self) { +- return ((RubyHash)H_ELE_GET(self, H_ELE_ATTR)).op_aref(self.getRuntime().getCurrentContext(), self.getRuntime().newSymbol("standalone")); ++ return ((RubyHash)H_ELE_GET_asHash(self, H_ELE_ATTR)).op_aref(self.getRuntime().getCurrentContext(), self.getRuntime().newSymbol("standalone")); + } + + // H_ATTR(system_id) + public static IRubyObject hpricot_ele_set_system_id(IRubyObject self, IRubyObject x) { +- ((RubyHash)H_ELE_GET(self, H_ELE_ATTR)).fastASet(self.getRuntime().newSymbol("system_id"), x); ++ ((RubyHash)H_ELE_GET_asHash(self, H_ELE_ATTR)).fastASet(self.getRuntime().newSymbol("system_id"), x); + return self; + } + + public static IRubyObject hpricot_ele_get_system_id(IRubyObject self) { +- return ((RubyHash)H_ELE_GET(self, H_ELE_ATTR)).op_aref(self.getRuntime().getCurrentContext(), self.getRuntime().newSymbol("system_id")); ++ return ((RubyHash)H_ELE_GET_asHash(self, H_ELE_ATTR)).op_aref(self.getRuntime().getCurrentContext(), self.getRuntime().newSymbol("system_id")); + } + + // H_ATTR(public_id) + public static IRubyObject hpricot_ele_set_public_id(IRubyObject self, IRubyObject x) { +- ((RubyHash)H_ELE_GET(self, H_ELE_ATTR)).fastASet(self.getRuntime().newSymbol("public_id"), x); ++ ((RubyHash)H_ELE_GET_asHash(self, H_ELE_ATTR)).fastASet(self.getRuntime().newSymbol("public_id"), x); + return self; + } + + public static IRubyObject hpricot_ele_get_public_id(IRubyObject self) { +- return ((RubyHash)H_ELE_GET(self, H_ELE_ATTR)).op_aref(self.getRuntime().getCurrentContext(), self.getRuntime().newSymbol("public_id")); ++ return ((RubyHash)H_ELE_GET_asHash(self, H_ELE_ATTR)).op_aref(self.getRuntime().getCurrentContext(), self.getRuntime().newSymbol("public_id")); + } + + public static class Scanner { +@@ -965,6 +965,15 @@ public class HpricotScanService implements BasicLibraryService { + return ((IRubyObject[])recv.dataGetStruct())[n]; + } + ++ public static RubyHash H_ELE_GET_asHash(IRubyObject recv, int n) { ++ IRubyObject obj = ((IRubyObject[])recv.dataGetStruct())[n]; ++ if(obj.isNil()) { ++ obj = RubyHash.newHash(recv.getRuntime()); ++ ((IRubyObject[])recv.dataGetStruct())[n] = obj; ++ } ++ return (RubyHash)obj; ++ } ++ + public static IRubyObject H_ELE_SET(IRubyObject recv, int n, IRubyObject value) { + ((IRubyObject[])recv.dataGetStruct())[n] = value; + return value; +-- +1.6.6.1 + diff --git a/dev-ruby/hpricot/hpricot-0.8.2-r1.ebuild b/dev-ruby/hpricot/hpricot-0.8.2-r1.ebuild new file mode 100644 index 000000000000..0d4263736fcc --- /dev/null +++ b/dev-ruby/hpricot/hpricot-0.8.2-r1.ebuild @@ -0,0 +1,44 @@ +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-ruby/hpricot/hpricot-0.8.2-r1.ebuild,v 1.1 2010/02/01 16:39:24 flameeyes Exp $ + +EAPI=2 + +USE_RUBY="ruby18 ruby19 jruby" + +RUBY_FAKEGEM_DOCDIR="doc" +RUBY_FAKEGEM_EXTRADOC="CHANGELOG README" + +inherit ruby-fakegem eutils + +DESCRIPTION="A fast and liberal HTML parser for Ruby." +HOMEPAGE="http://wiki.github.com/why/hpricot" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="~amd64 ~ppc ~ppc64 ~x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos ~x86-solaris" +IUSE="" + +# Probably needs the same jdk as JRuby but I'm not sure how to express +# that just yet. +DEPEND="dev-util/ragel + ruby_targets_jruby? ( >=virtual/jdk-1.5 )" + +ruby_add_bdepend dev-ruby/rake +ruby_add_bdepend test virtual/ruby-test-unit + +all_ruby_prepare() { + # Fix issue #11 from upstream + epatch "${FILESDIR}"/${P}-jruby.patch +} + +each_ruby_compile() { + case $(basename ${RUBY}) in + jruby) + ${RUBY} -S rake compile_java || die "rake compile failed" + ;; + *) + ${RUBY} -S rake compile || die "rake compile failed" + ;; + esac +} |