Changeset 86539


Ignore:
Timestamp:
Oct 28, 2011, 5:58:53 AM (8 years ago)
Author:
takanori@…
Message:

a2ps-j: shouldn't use obsolete perl libraries (ctime.pl and flush.pl)

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

Location:
trunk/dports/print/a2ps-j
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/dports/print/a2ps-j/Portfile

    r85947 r86539  
    55name            a2ps-j
    66version         1.45
    7 revision        2
     7revision        3
    88categories      print textproc japanese
    99maintainers     takanori openmaintainer
  • trunk/dports/print/a2ps-j/files/patch-a2ps-j.diff

    r73487 r86539  
    1 --- a2ps-j.orig 2010-06-25 04:54:48.000000000 +0900
    2 +++ a2ps-j      2010-11-15 18:01:02.000000000 +0900
     1--- a2ps-j.orig 2011-10-04 11:43:16.000000000 +0900
     2+++ a2ps-j      2011-10-28 14:33:49.000000000 +0900
    33@@ -1,4 +1,4 @@
    44-#!/usr/local/bin/perl
     
    77 ;# a2ps: ascii to ps
    88 ;#
    9 @@ -192,7 +192,6 @@
     9@@ -192,7 +192,8 @@
    1010 
    1111 if ($debug == 2) {
    1212     require('dumpvar.pl');
    1313-    local($#) = '%.6g';
     14+##  Perl 5.10.1 says $# is no longer supported
     15+##  local($#) = '%.6g';
    1416     &dumpvar('main',
    1517             'width', 'height', 'lmargin', 'smargin', 'font_size',
    1618             'sheet_height', 'sheet_width', 'char_width', 'skip_column',
    17 @@ -410,7 +409,6 @@
     19@@ -208,8 +209,14 @@
     20     $file = shift;
     21     if ($file && !-r $file) { warn "$file: $!\n"; next; }
     22     if ($jisconvert) {
     23-       require 'flush.pl';
     24-       &flush(STDOUT);
     25+       # flush.pl obsolete (originally in Perl 4)
     26+       # replaced with equivalent code of &flush(STDOUT)
     27+       local($old_stdout) = select(STDOUT);
     28+       $| = 1;
     29+       print "";
     30+       $| = 0;
     31+       select($old_stdout);
     32+       # end of equivalent code
     33        open(F, "-|") || &jis($file);
     34     } else {
     35        $file = '-' if $file eq '';
     36@@ -410,7 +417,6 @@
    1837     unless ($selfconvert) {
    1938        shift while @_ > 0 && $_[0] eq '';
     
    2342     if (($file = shift) ne '') {
    2443        open(STDIN, $file) || die "$file: $!\n";
     44@@ -476,10 +482,13 @@
     45 }
     46 
     47
     48 sub print_header {
     49-    require('ctime.pl');
     50     return if $header_is_printed++;
     51 
     52-    chop(local($date) = &ctime(time));
     53+    # ctime.pl obsolete (originally in Perl 4)
     54+    # ctime.pl behaves differently when TZ is not set,
     55+    # but the behavior will not affect the PostScript file details
     56+    local($date) = scalar localtime;
     57+
     58     local($orientation) = $portrait ? "Portrait" : "Landscape";
     59 
     60     print <<"---";
     61@@ -525,7 +534,8 @@
     62     printf("/lines %d def\n", $linesperpage);
     63     printf("/columns %d def\n", $columnsperline);
     64     $sublabel = $default_sublabel unless defined $sublabel;
     65-    print "/date (", &date($sublabel, time), ") def\n";
     66+    # function name changed to a2ps_date to avoid confusion
     67+    print "/date (", &a2ps_date($sublabel, time), ") def\n";
     68     if ($ascii_mag) {
     69        printf("/doasciimag true def /asciimagsize %f def\n", $ascii_mag);
     70     } else {
     71@@ -548,7 +558,8 @@
     72     print "%%EndProlog\n\n";
     73 }
     74 
     75-sub date {
     76+# function name changed to a2ps_date to avoid confusion
     77+sub a2ps_date {
     78     local($_, $time) = @_;
     79     local($sec, $min, $hour, $mday, $mon, $year, $wday) = localtime($time);
     80     $year += 1900;
Note: See TracChangeset for help on using the changeset viewer.