[frozen-bubble] 01/04: add patch to remove call to POSIX::tmpnam (Closes: #866321)

dod at debian.org dod at debian.org
Sat Jul 1 16:34:12 UTC 2017


This is an automated email from the git hooks/post-receive script.

dod pushed a commit to branch master
in repository frozen-bubble.

commit dfcaeba3e6185a3ede8c99fb675d49fa0998db15
Author: Dominique Dumont <dod at debian.org>
Date:   Sat Jul 1 18:14:01 2017 +0200

    add patch to remove call to POSIX::tmpnam (Closes: #866321)
---
 debian/patches/no-posix-tmpnam-call | 54 +++++++++++++++++++++++++++++++++++++
 debian/patches/series               |  1 +
 2 files changed, 55 insertions(+)

diff --git a/debian/patches/no-posix-tmpnam-call b/debian/patches/no-posix-tmpnam-call
new file mode 100644
index 0000000..c873277
--- /dev/null
+++ b/debian/patches/no-posix-tmpnam-call
@@ -0,0 +1,54 @@
+Description: Remove call to deprecated POSIX::tmpnam
+ This patch replaces the call to POSIX::tmpnam with a call to File::Temp. This call is deprecated and will break with perl 26.
+ .
+ File::Temp object handles file cleanup when the object is destroyed, so the call to unlink($filename) is no longer needed.
+ .
+ While I was at it, I've replaced a call to POSIX::_exit with good old die, so frozen-bubble no longer depends on POSIX.
+Bug-Debian: https://bugs.debian.org/866321
+Forwarded: https://github.com/kthakore/frozen-bubble/pull/66
+Author: dod
+--- a/bin/frozen-bubble
++++ b/bin/frozen-bubble
+@@ -51,11 +51,11 @@
+ use Getopt::Long;
+ use Data::Dumper;
+ use Locale::Maketext::Simple;
+-use POSIX();
+ use Math::Trig;
+ use IO::File;
+ use Time::HiRes qw(gettimeofday);
+ use Compress::Bzip2;
++use File::Temp;
+ 
+ use SDL;
+ use SDL::Rect;
+@@ -3718,8 +3718,7 @@
+                         return [ { host => 'localhost', port => 1511 } ];
+                     } else {
+                         unless (exec $fb_server, '-L', '-d', '-n', substr("lan-$mynick", 0, 12), '-z') {
+-                            print STDERR "Could not create server limited to lan game: $!\n";
+-                            POSIX::_exit(1);
++                            die "Could not create server limited to lan game: $!\n";
+                         }
+                     }
+                 }
+@@ -6020,9 +6019,8 @@
+         $replayfile = Games::FrozenBubble::Net::http_download($replayfile);
+         $replayfile or return;
+         if ($filename =~ /\.bz2$/) {
+-            my $fh;
+-            do { $filename = POSIX::tmpnam() }
+-              until $fh = IO::File->new($filename, O_WRONLY|O_CREAT|O_EXCL);
++            my $fh = File::Temp->new();
++            $filename = $fh->filename;
+             print $fh $replayfile;
+             $fh->close;
+             local *F;
+@@ -6036,7 +6034,6 @@
+             while($bz->bzreadline($line) > 0){ $replayfile .= $line; }
+             
+             $bz->bzclose();
+-            unlink ($filename);
+          }
+     } else {
+         if ($replayfile =~ /\.bz2$/) {
diff --git a/debian/patches/series b/debian/patches/series
index 53df046..8897548 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -7,3 +7,4 @@ kick-out-accelerometers
 hardening-server
 pt_po
 fix-translations.patch
+no-posix-tmpnam-call

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/frozen-bubble.git



More information about the Pkg-perl-cvs-commits mailing list