Control: tag 740782 + patch
Control: tag 866317 + patch

On Wed, 28 Jun 2017 23:10:58 +0300, Niko Tyni wrote:

> In addition to the $[ deprecation (#740782), this package also relies
> on other deprecated Perl features. These will become fatal in
> Perl 5.26, currently in experimental.
> 
>  % html2ps /dev/null >/dev/null
>  Use of assignment to $[ is deprecated at /usr/bin/html2ps line 3409.
>  Unescaped left brace in regex is deprecated, passed through in regex; marked 
> by <-- HERE in m//DH { <-- HERE / at /usr/bin/html2ps line 3834.
>  Unescaped left brace in regex is deprecated, passed through in regex; marked 
> by <-- HERE in m/\\patterns{ <-- HERE .*/ at /usr/bin/html2ps line 4085.
>  Calling POSIX::tmpnam() is deprecated at /usr/bin/html2ps line 497.

I'm attaching a patch for these issues. With it, I don't get any more
warnings or errors which are perl related.

(The usage of File::Temp's POSIX features is not really elegant but
it's minimal-invasive and I don't really grok what the code does with
the tempfile/dir ...)

Reviews welcome.


Cheers,
gregor

-- 
 .''`.  https://info.comodo.priv.at/ - Debian Developer https://www.debian.org
 : :' : OpenPGP fingerprint D1E1 316E 93A7 60A8 104D  85FA BB3A 6801 8649 AA06
 `. `'  Member of VIBE!AT & SPI, fellow of the Free Software Foundation Europe
   `-   NP: The Doors: Lover Her Madly
diff -Nru html2ps-1.0b7/debian/changelog html2ps-1.0b7/debian/changelog
--- html2ps-1.0b7/debian/changelog	2011-08-14 20:42:57.000000000 +0200
+++ html2ps-1.0b7/debian/changelog	2017-07-15 00:29:53.000000000 +0200
@@ -1,3 +1,13 @@
+html2ps (1.0b7-1.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix "relies on deprecated Perl syntax/features, breaks with 5.26" and
+    "Use of assignment to $[ is deprecated":
+    add patch perl-deprecations.patch
+    (Closes: #866317, #740782)
+
+ -- gregor herrmann <gre...@debian.org>  Sat, 15 Jul 2017 00:29:53 +0200
+
 html2ps (1.0b7-1) unstable; urgency=low
 
   * New maintainer. (Closes: #407652)
diff -Nru html2ps-1.0b7/debian/patches/perl-deprecations.patch html2ps-1.0b7/debian/patches/perl-deprecations.patch
--- html2ps-1.0b7/debian/patches/perl-deprecations.patch	1970-01-01 01:00:00.000000000 +0100
+++ html2ps-1.0b7/debian/patches/perl-deprecations.patch	2017-07-15 00:29:53.000000000 +0200
@@ -0,0 +1,55 @@
+Description: fix various deprecations which became fatal in perl 5.26
+ - escape { in regexps
+ - replace POSIX::tmpnam() with File::Temp's backward compatibility equivalent
+ - additionally drop assignment to $[
+Origin: vendor
+Bug-Debian: https://bugs.debian.org/866317
+ https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=740782
+Author: gregor herrmann <gre...@debian.org>
+Last-Update: 2017-07-15
+
+--- a/html2ps
++++ b/html2ps
+@@ -355,6 +355,7 @@
+ 
+ use POSIX;
+ $posix = 1;
++use File::Temp qw/ :POSIX /;
+ 
+ %extend=('quote',1, 'font',1, 'colour',1, 'hyphenation',1);
+ %fal=("serif","times", "sans_serif","helvetica", "monospace","courier");
+@@ -494,7 +495,7 @@
+  if($opt_D && !$package{'Ghostscript'});
+ die "Ghostscript is required to generate cross references\n"
+  if($opt_R && !$package{'Ghostscript'});
+-$tmpname=$posix?POSIX::tmpnam():"h2p_$$";
++$tmpname=$posix?tmpnam():"h2p_$$";
+ sysopen TMP, $tmpname, O_RDWR|O_CREAT|O_EXCL, 0600 or die "$!";
+ close TMP;
+ ($scr=$tmpname)=~/\w+$/;
+@@ -3406,7 +3407,6 @@
+   local($optlist)=@_;
+   local(@args,$_,$opt,$opts,$rest,$olist,$plist,$found,@popts);
+   local($errs)=0;
+-  local($[)=0;
+   @args=split( /\|/, $optlist );
+   for $opt (@args) {
+     if(substr($opt,-1,1) ne ':') {$olist.=$opt}
+@@ -3831,7 +3831,7 @@
+       $temp=$'=~/\/P\d+_?\d* \{/?$`:$rest;
+       ($eps{$pid})=$temp=~/([\w\W]*)} D/;
+     }
+-    if(/\/DH {/) {
++    if(/\/DH \{/) {
+       $'=~/%EndDH/;
+       $ph="/DH {$`";
+     }
+@@ -4082,7 +4082,7 @@
+   }
+   if(open(HYPH,"<$hyfile")) {
+     &dbg("Reading hyphenation patterns from $hyfile\n") if($opt_d);
+-    <HYPH>=~/\\patterns{.*/;
++    <HYPH>=~/\\patterns\{.*/;
+     close HYPH;
+     $def=$`;
+     ($patterns=$')=~s/\^\^($X$X)/chr hex $1/eg;
diff -Nru html2ps-1.0b7/debian/patches/series html2ps-1.0b7/debian/patches/series
--- html2ps-1.0b7/debian/patches/series	2011-08-06 21:09:19.000000000 +0200
+++ html2ps-1.0b7/debian/patches/series	2017-07-15 00:29:53.000000000 +0200
@@ -12,3 +12,4 @@
 fix_ps.patch
 checker_warning.patch
 upstream_changelog.patch
+perl-deprecations.patch

Attachment: signature.asc
Description: Digital Signature

Reply via email to