Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP2:Update
netpbm.3194
netpbm-tmpfile.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File netpbm-tmpfile.patch of Package netpbm.3194
Index: editor/pnmindex.csh =================================================================== --- editor/pnmindex.csh.orig +++ editor/pnmindex.csh @@ -85,7 +85,7 @@ if ( $#argv == 0 ) then goto usage endif -set tmpfile=/tmp/pi.tmp.$$ +set tmpfile=.pi.tmp.$$ rm -f $tmpfile set maxformat=PBM Index: generator/ppmrainbow =================================================================== --- generator/ppmrainbow.orig +++ generator/ppmrainbow @@ -25,6 +25,7 @@ exec perl -w -x -S -- "$0" "$@" #!/usr/bin/perl use strict; use Getopt::Long; +use File::Temp qw{tempfile tempdir}; my ($FALSE, $TRUE) = (0,1); @@ -71,31 +72,25 @@ if (!$norepeat) { push @colorlist, $ARGV[0]; } -my $ourtmp = "$tmpdir/ppmrainbow$$"; -mkdir($ourtmp, 0777) or - die("Unable to create directory for temporary files '$ourtmp"); - - +my $ourtmp = tempdir("ppmrainbow.XXXX", DIR => $tmpdir, CLEANUP => 1); my $widthRemaining; -my $n; my @outlist; -$n = 0; $widthRemaining = $Twid; @outlist = (); while (@colorlist >= 2) { - my $outfile = sprintf("%s/file.%03u.ppm", $ourtmp, $n); + (my $tmpfh, my $outfile) = tempfile("file.XXXXXXXX", DIR => "$ourtmp", SUFFIX => '.ppm'); push(@outlist, $outfile); my $w = int(($widthRemaining-1)/(@colorlist-1))+1; - my $rc = system("$verboseCommand pgmramp -lr $w $Thgt | " . - "pgmtoppm \"$colorlist[0]-$colorlist[1]\" >$outfile"); - if ($rc != 0) { + my $content = qx{$verboseCommand pgmramp -lr $w $Thgt | + pgmtoppm "$colorlist[0]-$colorlist[1]"}; + if (! "$content") { fatal("pgmramp|pgmtoppm failed."); } + print $tmpfh $content; $widthRemaining -= $w; - $n++; shift @colorlist; }
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor