Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 Aug 2011 08:58:41 GMT
From:      Kenji Rikitake <kenji.rikitake@acm.org>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/159903: japanese/a2ps: a2ps-j generates warning errors for obsolete Perl libraries
Message-ID:  <201108190858.p7J8wftj002474@red.freebsd.org>
Resent-Message-ID: <201108190900.p7J90RYK070738@freefall.freebsd.org>

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

>Number:         159903
>Category:       ports
>Synopsis:       japanese/a2ps: a2ps-j generates warning errors for obsolete Perl libraries
>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:   Fri Aug 19 09:00:27 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator:     Kenji Rikitake
>Release:        FreeBSD 8.2-RELEASE
>Organization:
>Environment:
FreeBSD reseaux.priv.k2r.org 8.2-RELEASE FreeBSD 8.2-RELEASE #24: Tue Apr 19 12:32:23 JST 2011     root@reseaux.priv.k2r.org:/usr/obj/usr/src/sys/RESEAUX  i386

>Description:
a2ps-j generates the following warning message on Perl 5.14.1:

Legacy library flush.pl will be removed from the Perl core distribution in the next major release. Please install it from the CPAN distribution Perl4::CoreLibs. It is being used at /usr/local/bin/a2ps-j, line 212.
Legacy library ctime.pl will be removed from the Perl core distribution in the next major release. Please install it from the CPAN distribution Perl4::CoreLibs. It is being used at /usr/local/bin/a2ps-j, line 480.
>How-To-Repeat:
Invoking a2ps-j will always generate the error message to stderr.
>Fix:
Patch attached to get rid of flush.pl and ctime.pl.

Note: ctime.pl behaves differently when TZ is not set, but the library is only used in PostScript %%creationdate value and will not affect the validity of the generated PostScript file. See also Simple.pm of PostScript::Simple (print/p5-PostScript-Simple).



Patch attached with submission follows:

--- a2ps-j.orig	2011-08-19 16:37:34.000000000 +0900
+++ a2ps-j	2011-08-19 17:42:00.000000000 +0900
@@ -209,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 '';
@@ -477,10 +483,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 <<"---";
@@ -526,7 +535,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 {
@@ -549,7 +559,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;


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



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