r10399 - /man-cgi/extractor/manpage-extractor.pl
Author: jfs
Date: Wed May 21 18:03:06 2014
New Revision: 10399
URL: http://svn.debian.org/wsvn/?sc=1&rev=10399
Log:
Change the way the temporary filename is obtained, for some reason, it has
stopped working in glink since December the 2nd last year (but worked the month
before, november the 6th) - some change in libtest-tempdir-perl ?
Also:
- checks that there is a temporary filename before proceeding
- add debug output to diagnose temporary file generation issues
Modified:
man-cgi/extractor/manpage-extractor.pl
Modified: man-cgi/extractor/manpage-extractor.pl
URL: http://svn.debian.org/wsvn/man-cgi/extractor/manpage-extractor.pl?rev=10399&op=diff
==============================================================================
--- man-cgi/extractor/manpage-extractor.pl (original)
+++ man-cgi/extractor/manpage-extractor.pl Wed May 21 18:03:06 2014
@@ -215,12 +215,17 @@
my $result = 1;
# Temporary file for dpkg
- my ($tempfileh, $tempfile) = new File::Temp ( Template => "DPKG-DEB.XXXXXX", DIR => "$WORKDIR", SUFFIX => ".tmp" ) or die "Cannot create temporary file: $!" ;
+ my $tempfileh = new File::Temp ( Template => "DPKG-DEB.XXXXXX", DIR => "$WORKDIR", SUFFIX => ".tmp" ) or die "Cannot create temporary file: $!" ;
+ my $tempfile = $tempfileh->filename;
+
+ die "Cannot obtain a temporary file name" if ! defined($tempfile);
# Call dpkg-deb to obtain the package contents
# TODO: notice that this is _NOT_ secure there are multiple entry
# points for command injection, rewrite this in Perl?
+ print STDERR "DEBUG: Setting temporary file to $tempfile\n" if $debug;
my $command="dpkg-deb --fsys-tarfile $package >$tempfile";
+ print STDERR "DEBUG: Running command '$command'\n" if $debug;
system "$command";
if ( $? != 0 ) {
if ($? == -1) {
Reply to: