From flz@ash.xbsd.org  Fri May 20 14:57:02 2011
Return-Path: <flz@ash.xbsd.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4F76E1065673;
	Fri, 20 May 2011 14:57:02 +0000 (UTC)
	(envelope-from flz@ash.xbsd.org)
Received: from mail07.mail.esat.net (mail07.mail.esat.net [193.120.142.50])
	by mx1.freebsd.org (Postfix) with ESMTP id EDA5F8FC16;
	Fri, 20 May 2011 14:57:01 +0000 (UTC)
Received: from ash.xbsd.org [193.120.123.154] 
	by mail07.mail.esat.net with esmtp 
	id 1QNR8O-000629-Bp; Fri, 20 May 2011 15:57:00 +0100
Received: from ash.xbsd.org (localhost [127.0.0.1])
	by ash.xbsd.org (8.14.4/8.14.4) with ESMTP id p4KEq7Rb056426;
	Fri, 20 May 2011 14:52:07 GMT
	(envelope-from flz@ash.xbsd.org)
Received: (from flz@localhost)
	by ash.xbsd.org (8.14.4/8.14.4/Submit) id p4KEq7rm056425;
	Fri, 20 May 2011 15:52:07 +0100 (IST)
	(envelope-from flz)
Message-Id: <201105201452.p4KEq7rm056425@ash.xbsd.org>
Date: Fri, 20 May 2011 15:52:07 +0100 (IST)
From: Florent Thoumie <flz@freebsd.org>
Reply-To: Florent Thoumie <flz@freebsd.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc: bapt@freebsd.org
Subject: japanese/font-alias: use shell instead of perl for pkg-(de)install
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         157212
>Category:       ports
>Synopsis:       japanese/font-alias: use shell instead of perl for pkg-(de)install
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Fri May 20 15:00:21 UTC 2011
>Closed-Date:    Mon Aug 15 07:07:52 UTC 2011
>Last-Modified:  Mon Aug 15 07:10:07 UTC 2011
>Originator:     Florent Thoumie
>Release:        FreeBSD 8.2-RELEASE amd64
>Organization:
Xbsd.org
>Environment:
System: FreeBSD ash.xbsd.org 8.2-RELEASE FreeBSD 8.2-RELEASE #0: Thu Feb 17 02:41:51 UTC 2011 root@mason.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC amd64


	
>Description:
	
>How-To-Repeat:
	
>Fix:

	

--- ja-alias-fonts.diff begins here ---
Index: Makefile
===================================================================
RCS file: /home/pcvs/ports/japanese/alias-fonts/Makefile,v
retrieving revision 1.20
diff -u -r1.20 Makefile
--- Makefile	31 May 2009 09:19:09 -0000	1.20
+++ Makefile	20 May 2011 14:55:26 -0000
@@ -7,7 +7,7 @@
 
 PORTNAME=	alias-fonts
 PORTVERSION=	1.0
-PORTREVISION=	4
+PORTREVISION=	5
 CATEGORIES=	japanese x11-fonts
 DISTFILES=	# empty
 
@@ -27,12 +27,11 @@
 		mkfontscale:${PORTSDIR}/x11-fonts/mkfontscale
 
 NO_BUILD=	yes
-USE_PERL5=	yes
 
 FONTSDIR=	${LOCALBASE}/lib/X11/fonts/local
 
 do-install:
 	@${SETENV} PKG_PREFIX=${PREFIX} \
-		${PERL} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
+		${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
 
 .include <bsd.port.mk>
Index: pkg-deinstall
===================================================================
RCS file: /home/pcvs/ports/japanese/alias-fonts/pkg-deinstall,v
retrieving revision 1.3
diff -u -r1.3 pkg-deinstall
--- pkg-deinstall	9 Apr 2002 09:05:22 -0000	1.3
+++ pkg-deinstall	20 May 2011 14:55:26 -0000
@@ -1,24 +1,25 @@
-#!/usr/bin/perl
+#!/bin/sh
 # $FreeBSD: ports/japanese/alias-fonts/pkg-deinstall,v 1.3 2002/04/09 09:05:22 sada Exp $
 
-$prefix = $ENV{'PKG_PREFIX'};
-$dir = "$prefix/lib/X11/fonts/local";
-$to =  "$dir/fonts.alias";
-$from = "$to.orig";
-rename($to, $from) || die("Can't rename: $!");
-open(IN, $from) || die("Can't open $from: $!");
-open(OUT, ">$to") || die("Can't open $to: $!");
-while (<IN>) {
-	chop;
-	if (/^\s*!/ || /^\s*$/) {
-		print OUT "$_\n";
-	}
-	else {
-		@line = split(/\s+/, $_);
-		@elm = split(/-+/, $line[0]);
-		if ($elm[1] ne 'alias') {
-			print OUT "$_\n";
-		}
-	}
-}
-#system("$prefix/bin/xset fp rehash");
+dir="${PKG_PREFIX}/lib/X11/fonts/local";
+to="$dir/fonts.alias";
+from="$to.orig";
+
+if ! mv $to $from; then
+  echo "Couldn't rename $to."
+  exit 1
+fi
+
+IFS="
+"
+
+while read line; do
+  trimmed=${line# *}
+  case $trimmed in
+    !*|"") echo $line;;
+    -alias-*) echo $line;;
+    *) ;;
+  esac
+done < $from > $to
+
+rm $from
Index: pkg-install
===================================================================
RCS file: /home/pcvs/ports/japanese/alias-fonts/pkg-install,v
retrieving revision 1.6
diff -u -r1.6 pkg-install
--- pkg-install	19 Jan 2003 05:45:46 -0000	1.6
+++ pkg-install	20 May 2011 14:55:26 -0000
@@ -1,29 +1,32 @@
-#!/usr/bin/perl
+#!/bin/sh
 # $FreeBSD: ports/japanese/alias-fonts/pkg-install,v 1.6 2003/01/19 05:45:46 sada Exp $
 
-$prefix = $ENV{'PKG_PREFIX'};
-$dir = "$prefix/lib/X11/fonts/local";
-$to =  "$dir/fonts.alias";
-$from = "$to.orig";
-$option = $ARGV[1];
-exit 0 if $option ne 'POST-INSTALL';
-rename($to, $from) || die("Can't rename: $!");
-open(IN, $from) || die("Can't open $from: $!");
-open(OUT, ">$to") || die("Can't open $to: $!");
-while (<IN>) {
-	chop;
-	if (/^\s*!/ || /^\s*$/) {
-		print OUT "$_\n";
-	}
-	else {
-		@line = split(/\s+/, $_);
-		@elm = split(/-+/, $line[0]);
-		if ($elm[1] ne 'alias') { 
-			print OUT "$_\n";
-		}
-	}
-}
-for (split(/\n/, <<"END"))
+if [ $1 != "POST-INSTALL" ]; then
+  exit 0
+fi
+
+dir="${PKG_PREFIX}/lib/X11/fonts/local";
+to="$dir/fonts.alias";
+from="$to.orig";
+
+if ! mv $to $from; then
+  echo "Couldn't rename $to."
+  exit 1
+fi
+
+IFS="
+"
+
+while read line; do
+  trimmed=${line# *}
+  case $trimmed in
+    !*|"") echo $line;;
+    -alias-*) echo $line;;
+    *) ;;
+  esac
+done < $from > $to
+
+cat <<EOF >> $to
 -alias-fixed-medium-r-normal--24-234-75-75-c-120-iso8859-1 -sony-fixed-medium-r-normal--24-230-75-75-c-120-iso8859-1
 -alias-fixed-medium-r-normal--20-190-75-75-c-200-iso8859-1 -kappa-fixed-medium-r-normal--20-190-75-75-c-100-iso8859-1
 -alias-fixed-medium-i-normal--20-190-75-75-c-200-iso8859-1 -kappa-fixed-medium-i-normal--20-190-75-75-c-100-iso8859-1
@@ -138,7 +141,4 @@
 -alias-fixed-bold-i-normal--16-150-75-75-c-160-jisx0213.2000-1 -misc-fixed-bold-i-normal--16-150-75-75-c-160-jisx0213.2000-1
 -alias-mincho-bold-r-normal--20-190-75-75-c-200-jisx0213.2000-1 -kappa-mincho-bold-r-normal--20-190-75-75-c-200-jisx0213.2000-1
 -alias-mincho-bold-i-normal--20-190-75-75-c-200-jisx0213.2000-1 -kappa-mincho-bold-i-normal--20-190-75-75-c-200-jisx0213.2000-1
-END
-{
-	print OUT "$_\n";
-}
+EOF
--- ja-alias-fonts.diff ends here ---


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: tota 
State-Changed-When: Mon Aug 15 07:07:09 UTC 2011 
State-Changed-Why:  
Committed. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=157212 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/157212: commit references a PR
Date: Mon, 15 Aug 2011 07:04:10 +0000 (UTC)

 tota        2011-08-15 07:03:55 UTC
 
   FreeBSD ports repository
 
   Modified files:
     japanese/alias-fonts Makefile pkg-deinstall pkg-install 
   Log:
   - Use shell instead of perl for pkg-(de)install [1]
   - Make portlint happy
   
   PR:             ports/157212 [1]
   Submitted by:   flz [1]
   
   Revision  Changes    Path
   1.21      +3 -3      ports/japanese/alias-fonts/Makefile
   1.4       +24 -23    ports/japanese/alias-fonts/pkg-deinstall
   1.7       +29 -29    ports/japanese/alias-fonts/pkg-install
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
