mirror of
https://github.com/Stichting-MINIX-Research-Foundation/pkgsrc-ng.git
synced 2025-08-03 09:48:00 -04:00
74 lines
2.3 KiB
Plaintext
74 lines
2.3 KiB
Plaintext
$NetBSD: patch-ab,v 1.1 2013/01/22 10:18:42 mef Exp $
|
||
|
||
(1) Eliminate old-fashioned call for flush.pl and ctime.pl
|
||
(2) Eliminate non-supported '$#'
|
||
(3) Rename date to be more specific name a2ps_date
|
||
This patch is derived from
|
||
http://trac.macports.com/changeset/86539
|
||
|
||
--- a2ps.pl-1.45~ 2013-01-22 09:52:48.000000000 +0900
|
||
+++ a2ps.pl-1.45 2013-01-22 10:00:30.000000000 +0900
|
||
@@ -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',
|
||
@@ -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 '';
|
||
@@ -476,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 <<"---";
|
||
@@ -523,7 +533,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 {
|
||
@@ -546,7 +557,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;
|