From: Don Armstrong Date: Sat, 17 Aug 2019 02:53:06 +0000 (-0700) Subject: all debian patches are now upstream X-Git-Tag: debian/20190601-1~1 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=0fe1a710a98fbad89a9d0ef58ba86b6c197224ee;p=perltidy.git all debian patches are now upstream --- diff --git a/debian/patches/die_on_unlink_failures b/debian/patches/die_on_unlink_failures deleted file mode 100644 index 7b4d3d99..00000000 --- a/debian/patches/die_on_unlink_failures +++ /dev/null @@ -1,32 +0,0 @@ -Description: die if perltidy.ERR and other temporary files cannot be unlinked -Origin: Upstream, Cherrypicked from 20170521. -Author: Don Armstrong , Steve Hancock -diff --git a/lib/Perl/Tidy.pm b/lib/Perl/Tidy.pm -index 2b0df0e..edcec6d 100644 ---- a/lib/Perl/Tidy.pm -+++ b/lib/Perl/Tidy.pm -@@ -3692,7 +3702,10 @@ sub do_syntax_check { - # now wish for luck... - my $msg = qx/perl $flags $quoted_stream_filename $error_redirection/; - -- unlink $stream_filename if ($is_tmpfile); -+ if ($is_tmpfile) { -+ unlink $stream_filename -+ or Perl::Tidy::Die("couldn't unlink stream $stream_filename: $!\n"); -+ } - return $stream_filename, $msg; - } - -@@ -4128,7 +4143,11 @@ sub new { - - # remove any old error output file if we might write a new one - unless ( $fh_warnings || ref($warning_file) ) { -- if ( -e $warning_file ) { unlink($warning_file) } -+ if ( -e $warning_file ) { -+ unlink($warning_file) -+ or Perl::Tidy::Die( -+ "couldn't unlink warning file $warning_file: $!\n"); -+ } - } - - my $logfile_gap = diff --git a/debian/patches/document_bst_better b/debian/patches/document_bst_better deleted file mode 100644 index be25173f..00000000 --- a/debian/patches/document_bst_better +++ /dev/null @@ -1,13 +0,0 @@ ---- a/bin/perltidy -+++ b/bin/perltidy -@@ -175,7 +175,9 @@ - - Name of the output file (only if a single input file is being - processed). If no output file is specified, and output is not --redirected to the standard output, the output will go to F. -+redirected to the standard output (see B<-st>), the output will go to -+F. [Note: - does not redirect to standard output. Use -+B<-st> instead.] - - =item B<-st>, B<--standard-output> - diff --git a/debian/patches/fix_insecure_tmpnam_usage_740670 b/debian/patches/fix_insecure_tmpnam_usage_740670 deleted file mode 100644 index 867909f1..00000000 --- a/debian/patches/fix_insecure_tmpnam_usage_740670 +++ /dev/null @@ -1,80 +0,0 @@ -Description: Replace insecure make_temporary_filename with File::Temp::tempfile -Forwarded: http://lists.example.com/2010/03/1234.html -Origin: vendor, http://bugs.debian.org/740670 -Author: Don Armstrong -Last-Update: 2010-03-29 ---- a/lib/Perl/Tidy.pm -+++ b/lib/Perl/Tidy.pm -@@ -76,6 +76,7 @@ - use IO::File; - use File::Basename; - use File::Copy; -+use File::Temp qw(tempfile); - - BEGIN { - ( $VERSION = q($Id: Tidy.pm,v 1.74 2013/09/22 13:56:49 perltidy Exp $) ) =~ s/^.*\s+(\d+)\/(\d+)\/(\d+).*$/$1$2$3/; # all one line for MakeMaker -@@ -235,35 +236,6 @@ - return undef; - } - --sub make_temporary_filename { -- -- # Make a temporary filename. -- # The POSIX tmpnam() function has been unreliable for non-unix systems -- # (at least for the win32 systems that I've tested), so use a pre-defined -- # name for them. A disadvantage of this is that two perltidy -- # runs in the same working directory may conflict. However, the chance of -- # that is small and manageable by the user, especially on systems for which -- # the POSIX tmpnam function doesn't work. -- my $name = "perltidy.TMP"; -- if ( $^O =~ /win32|dos/i || $^O eq 'VMS' || $^O eq 'MacOs' ) { -- return $name; -- } -- eval "use POSIX qw(tmpnam)"; -- if ($@) { return $name } -- use IO::File; -- -- # just make a couple of tries before giving up and using the default -- for ( 0 .. 3 ) { -- my $tmpname = tmpnam(); -- my $fh = IO::File->new( $tmpname, O_RDWR | O_CREAT | O_EXCL ); -- if ($fh) { -- $fh->close(); -- return ($tmpname); -- last; -- } -- } -- return ($name); --} - - # Here is a map of the flow of data from the input source to the output - # line sink: -@@ -1324,11 +1296,7 @@ - my ( $fh_stream, $fh_name ) = - Perl::Tidy::streamhandle( $stream, 'r' ); - if ($fh_stream) { -- my ( $fout, $tmpnam ); -- -- # TODO: fix the tmpnam routine to return an open filehandle -- $tmpnam = Perl::Tidy::make_temporary_filename(); -- $fout = IO::File->new( $tmpnam, 'w' ); -+ my ( $fout, $tmpnam ) = tempfile(); - - if ($fout) { - $fname = $tmpnam; -@@ -5159,14 +5127,7 @@ - # Pod::Html requires a real temporary filename - # If we are making a frame, we have a name available - # Otherwise, we have to fine one -- my $tmpfile; -- if ( $rOpts->{'frames'} ) { -- $tmpfile = $self->{_toc_filename}; -- } -- else { -- $tmpfile = Perl::Tidy::make_temporary_filename(); -- } -- my $fh_tmp = IO::File->new( $tmpfile, 'w' ); -+ my ($fh_tmp,$tmpfile) = tempfile(); - unless ($fh_tmp) { - Perl::Tidy::Warn - "unable to open temporary file $tmpfile; cannot use pod2html\n"; diff --git a/debian/patches/series b/debian/patches/series deleted file mode 100644 index 9b1049a4..00000000 --- a/debian/patches/series +++ /dev/null @@ -1 +0,0 @@ -document_bst_better