Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 Nov 2009 13:28:11 GMT
From:      Christopher Key <cjk32@cam.ac.uk>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/140662: Changes in p5-Class-XSAccessor-1.05, 1 break squeezeboxserver
Message-ID:  <200911181328.nAIDSB2S026887@chacal.wzl33>
Resent-Message-ID: <200911181330.nAIDU25L095042@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         140662
>Category:       ports
>Synopsis:       Changes in p5-Class-XSAccessor-1.05,1 break squeezeboxserver
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Nov 18 13:30:01 UTC 2009
>Closed-Date:
>Last-Modified:
>Originator:     Christopher Key
>Release:        FreeBSD 7.2-RELEASE amd64
>Organization:
>Environment:
System: FreeBSD chacal.wzl33 7.2-RELEASE FreeBSD 7.2-RELEASE #7: Thu May 7 20:03:07 BST 2009 root@chacal.wzl33:/usr/obj/usr/src/sys/CHACAL amd64


	
>Description:
	SqueezeboxServer server makes use of Class::XSAccessor::Array if version >= 1.04 is found.  Recently, p5-Class-XSAccessor was updated to 1.05,1, meaning that SqueezeboxServer now attempts to use it.  However, the internals have changed between versions 1.04 and 1.05, which breaks squeezeboxserver.  The attached patch detects which version of Class::XSAccessor is used, and proceeds appropriately.  It is possibly overkill, as version 1.04 has never been available via the ports tree, and thus assuming 1.05 semantics would probably be safe.  However, some people may have version 1.04 installed from somewhere else, e.g. direct from CPAN, so probably best to be safe.

>How-To-Repeat:
	Update to p5-Class-XSAccessor-1.05,1, then attempt to start squeezeboxserver

>Fix:

	

--- patch-class-xsaccessor-1.05 begins here ---
Index: Slim/Utils/Accessor.pm
===================================================================
--- Slim/Utils/Accessor.pm	(revision 29102)
+++ Slim/Utils/Accessor.pm	(working copy)
@@ -98,9 +98,15 @@
 		if ($type eq 'rw') {
 			
 			if ( hasXS() ) {
-				Class::XSAccessor::Array::_generate_method(
-					$class,	$field,	$n, 0, 0, 'accessor',
-				);
+				if ($Class::XSAccessor::Array::VERSION ge '1.05') {
+					Class::XSAccessor::Array::_generate_method(
+						$class,	$field,	$n, {}, 'accessor',
+					);
+				} else {
+					Class::XSAccessor::Array::_generate_method(
+						$class,	$field,	$n, 0, 0, 'accessor',
+					);
+				}
 			}
 			else {
 				$accessor = sub {
@@ -112,9 +118,15 @@
 		} elsif ($type eq 'ro') {
 			
 			if ( hasXS() ) {
-				Class::XSAccessor::Array::_generate_method(
-					$class,	$field,	$n, 0, 0, 'getter',
-				);
+				if ($Class::XSAccessor::Array::VERSION ge '1.05') {
+					Class::XSAccessor::Array::_generate_method(
+						$class,	$field,	$n, {}, 'getter',
+					);
+				} else {
+					Class::XSAccessor::Array::_generate_method(
+						$class,	$field,	$n, 0, 0, 'getter',
+					);
+				}
 			}
 			else {
 				$accessor = sub {
--- patch-class-xsaccessor-1.05 ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200911181328.nAIDSB2S026887>