# HG changeset patch # User Aleksej Bobylev # Date 1528235596 -10800 # Node ID c69daec36de2b8386b6cf22497abe0435a3f029e # Parent 2233dc83fc9ed9ada51048a30800da4df1daead7 modules/compressor: compress_gif(): fix optimized files permissions (don't use mktemp, because it set the rw------- permissions in /tmp) diff -r 2233dc83fc9e -r c69daec36de2 modules/compressor --- a/modules/compressor Wed Jun 06 00:32:43 2018 +0300 +++ b/modules/compressor Wed Jun 06 00:53:16 2018 +0300 @@ -398,14 +398,13 @@ if which gifsicle >/dev/null; then the_log="$(mktemp)" - j="$(mktemp)" for i in $(IFS=$'\n' find $install -type f -name '*.gif'); do unset IFS # use intermediate file, if all well ($?=0), then substitute the original - if gifsicle -O3 "$i" -o "$j" >> "$the_log" 2>&1; then - mv "$j" "$i" + if gifsicle -O3 "$i" -o "$i.$$" >> "$the_log" 2>&1; then + mv "$i.$$" "$i" else - rm "$j" + rm "$i.$$" fi done else