Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 25 Aug 2011 16:42:07 +0900
From:      Takefu <takefu@airport.fm>
To:        freebsd-gnats-submit@freebsd.org, ports@FreeBSD.org
Subject:   [PATCH] japanese/jcode.pl Fix defined(%hash) is deprecated
Message-ID:  <4E55FCCF.70401@airport.fm>
In-Reply-To: <201108250706.p7P76Uun077737@unbound.local.ae-osaka.co.jp>
References:  <201108250706.p7P76Uun077737@unbound.local.ae-osaka.co.jp>

next in thread | previous in thread | raw e-mail | index | archive | help
>Submitter-Id:	current-users
>Originator:	Takefu
>Organization:	FOX Amateur Radio Club
>Confidential:	no
>Synopsis:	[PATCH] japanese/jcode.pl Fix defined(%hash) is deprecated
>Severity:	non-critical
>Priority:	low
>Category:	ports
>Class:		change-request
>Release:	FreeBSD 8.2 amd64
>Description:
  lang/perl5.12 or lang/perl5.14 problems occur in combination.
  z2h_euc z2h_sjis and was out of the way to improve call and message.

# fined(%hash) is deprecated at /usr/local/lib/perl5/site_perl/5.12.1/jcode.pl line 684.
# 	(Maybe you should just omit the defined()?)
# defined(%hash) is deprecated at /usr/local/lib/perl5/site_perl/5.12.1/jcode.pl line 693.
# 	(Maybe you should just omit the defined()?)

  see PR#149544

>How-To-Repeat:
#!/usr/local/bin/perl
require "jcode.pl";
$data = "";
jcode::z2h_sjis(\$data);
exit;

>Fix:
--- ja-jcode.pl.patch begins here ---
diff -ruN /usr/ports/japanese/jcode.pl/Makefile japanese/jcode.pl/Makefile
--- /usr/ports/japanese/jcode.pl/Makefile	2011-05-30 10:51:40.000000000 +0900
+++ japanese/jcode.pl/Makefile	2011-08-24 15:10:04.000000000 +0900
@@ -7,26 +7,27 @@

 PORTNAME=	jcode.pl
 PORTVERSION=	2.13
+PORTREVISION=	1
 CATEGORIES=	japanese perl5
 MASTER_SITES=	ftp://ftp.iij.ad.jp/pub/IIJ/dist/utashiro/perl/ \
-		ftp://ftp.sra.co.jp/pub/lang/perl/sra-scripts/ \
-		http://srekcah.org/jcode/
-EXTRACT_SUFX=	# none
+		ftp://ftp.sra.co.jp/pub/lang/perl/sra-scripts/
+EXTRACT_SUFX=

 MAINTAINER=	ports@FreeBSD.org
 COMMENT=	Perl library for Japanese character code conversion

+CONFLICTS=	ja-p5-jcode.pl-[0-9]*
+
 USE_PERL5_RUN=		yes
 NO_WRKSUBDIR=		yes
 NO_BUILD=		yes
 EXTRACT_CMD=		${CP}
 EXTRACT_BEFORE_ARGS=
-EXTRACT_AFTER_ARGS=	.
-
-PLIST_FILES=	%%SITE_PERL%%/${PORTNAME}
+EXTRACT_AFTER_ARGS=	${WRKDIR}
+PLIST_FILES=		${SITE_PERL_REL}/${PORTNAME}

 do-install:
-	${MKDIR} ${PREFIX}/${SITE_PERL_REL}/
+	${MKDIR} ${PREFIX}/${SITE_PERL_REL}
 	${INSTALL_DATA} ${WRKDIR}/${DISTNAME} ${PREFIX}/${SITE_PERL_REL}/${PORTNAME}

 .include <bsd.port.mk>
diff -ruN /usr/ports/japanese/jcode.pl/files/patch-aa japanese/jcode.pl/files/patch-aa
--- /usr/ports/japanese/jcode.pl/files/patch-aa	1970-01-01 09:00:00.000000000 +0900
+++ japanese/jcode.pl/files/patch-aa	2010-10-08 12:19:58.000000000 +0900
@@ -0,0 +1,20 @@
+--- jcode.pl-2.13.orig	2010-07-28 14:46:52.000000000 +0900
++++ jcode.pl-2.13	2010-07-28 14:51:52.000000000 +0900
+@@ -681,7 +681,7 @@
+
+ sub z2h_euc {
+     local(*s, $n) = @_;
+-    &init_z2h_euc unless defined %z2h_euc;
++    &init_z2h_euc unless %z2h_euc;
+     $s =~ s/($re_euc_c|$re_euc_kana)/
+ 	$z2h_euc{$1} ? ($n++, $z2h_euc{$1}) : $1
+     /geo;
+@@ -690,7 +690,7 @@
+
+ sub z2h_sjis {
+     local(*s, $n) = @_;
+-    &init_z2h_sjis unless defined %z2h_sjis;
++    &init_z2h_sjis unless %z2h_sjis;
+     $s =~ s/($re_sjis_c)/$z2h_sjis{$1} ? ($n++, $z2h_sjis{$1}) : $1/geo;
+     $n;
+ }
---  ja-jcode.pl.patch ends here ---



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