[86539] trunk/dports/print/a2ps-j

takanori at macports.org takanori at macports.org
Thu Oct 27 22:58:53 PDT 2011


Revision: 86539
          http://trac.macports.org/changeset/86539
Author:   takanori at macports.org
Date:     2011-10-27 22:58:53 -0700 (Thu, 27 Oct 2011)
Log Message:
-----------
a2ps-j: shouldn't use obsolete perl libraries (ctype.pl and flush.pl)

Patch obtained from: FreeBSD
http://www.FreeBSD.org/cgi/query-pr.cgi?pr=ports/159903

Modified Paths:
--------------
    trunk/dports/print/a2ps-j/Portfile
    trunk/dports/print/a2ps-j/files/patch-a2ps-j.diff

Modified: trunk/dports/print/a2ps-j/Portfile
===================================================================
--- trunk/dports/print/a2ps-j/Portfile	2011-10-28 03:34:49 UTC (rev 86538)
+++ trunk/dports/print/a2ps-j/Portfile	2011-10-28 05:58:53 UTC (rev 86539)
@@ -4,7 +4,7 @@
 
 name            a2ps-j
 version         1.45
-revision        2
+revision        3
 categories      print textproc japanese
 maintainers     takanori openmaintainer
 description     Text file to PostScript converter (with Japanese support)

Modified: trunk/dports/print/a2ps-j/files/patch-a2ps-j.diff
===================================================================
--- trunk/dports/print/a2ps-j/files/patch-a2ps-j.diff	2011-10-28 03:34:49 UTC (rev 86538)
+++ trunk/dports/print/a2ps-j/files/patch-a2ps-j.diff	2011-10-28 05:58:53 UTC (rev 86539)
@@ -1,20 +1,39 @@
---- a2ps-j.orig	2010-06-25 04:54:48.000000000 +0900
-+++ a2ps-j	2010-11-15 18:01:02.000000000 +0900
+--- a2ps-j.orig	2011-10-04 11:43:16.000000000 +0900
++++ a2ps-j	2011-10-28 14:33:49.000000000 +0900
 @@ -1,4 +1,4 @@
 -#!/usr/local/bin/perl
 +#!/usr/bin/env perl
  ;#
  ;# a2ps: ascii to ps
  ;#
-@@ -192,7 +192,6 @@
+@@ -192,7 +192,8 @@
  
  if ($debug == 2) {
      require('dumpvar.pl');
 -    local($#) = '%.6g';
++##  Perl 5.10.1 says $# is no longer supported
++##  local($#) = '%.6g';
      &dumpvar('main',
  	     'width', 'height', 'lmargin', 'smargin', 'font_size',
  	     'sheet_height', 'sheet_width', 'char_width', 'skip_column',
-@@ -410,7 +409,6 @@
+@@ -208,8 +209,14 @@
+     $file = shift;
+     if ($file && !-r $file) { warn "$file: $!\n"; next; }
+     if ($jisconvert) {
+-	require 'flush.pl';
+-	&flush(STDOUT);
++	# flush.pl obsolete (originally in Perl 4)
++	# replaced with equivalent code of &flush(STDOUT)
++	local($old_stdout) = select(STDOUT);
++	$| = 1;
++	print "";
++	$| = 0;
++	select($old_stdout);
++	# end of equivalent code
+ 	open(F, "-|") || &jis($file);
+     } else {
+ 	$file = '-' if $file eq '';
+@@ -410,7 +417,6 @@
      unless ($selfconvert) {
  	shift while @_ > 0 && $_[0] eq '';
  	exec('nkf', '-b', '-j', @_);
@@ -22,3 +41,39 @@
      }
      if (($file = shift) ne '') {
  	open(STDIN, $file) || die "$file: $!\n";
+@@ -476,10 +482,13 @@
+ }
+ 
+ sub print_header {
+-    require('ctime.pl');
+     return if $header_is_printed++;
+ 
+-    chop(local($date) = &ctime(time));
++    # ctime.pl obsolete (originally in Perl 4)
++    # ctime.pl behaves differently when TZ is not set,
++    # but the behavior will not affect the PostScript file details
++    local($date) = scalar localtime;
++
+     local($orientation) = $portrait ? "Portrait" : "Landscape";
+ 
+     print <<"---";
+@@ -525,7 +534,8 @@
+     printf("/lines %d def\n", $linesperpage);
+     printf("/columns %d def\n", $columnsperline);
+     $sublabel = $default_sublabel unless defined $sublabel;
+-    print "/date (", &date($sublabel, time), ") def\n";
++    # function name changed to a2ps_date to avoid confusion
++    print "/date (", &a2ps_date($sublabel, time), ") def\n";
+     if ($ascii_mag) {
+ 	printf("/doasciimag true def /asciimagsize %f def\n", $ascii_mag);
+     } else {
+@@ -548,7 +558,8 @@
+     print "%%EndProlog\n\n";
+ }
+ 
+-sub date {
++# function name changed to a2ps_date to avoid confusion
++sub a2ps_date {
+     local($_, $time) = @_;
+     local($sec, $min, $hour, $mday, $mon, $year, $wday) = localtime($time);
+     $year += 1900;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20111027/e328e6e4/attachment.html>


More information about the macports-changes mailing list