applied patch #2663 by alarantalara: Make wesnoth-optipng work on systems with BSD stat

This commit is contained in:
Nils Kneuper 2011-07-24 10:28:37 +00:00
parent 34685bc67b
commit 642c3cf602
2 changed files with 8 additions and 2 deletions

View file

@ -38,6 +38,7 @@ Version 1.9.7+svn:
* Support for gamepads/joysticks
* Fixed bug #18117, saved games with Qatif-al-nar became corrupted
* Fixed bug #18120, where Khalifate units were not getting the default ALMA
* Patch #2663: Make wesnoth-optipng work on systems with BSD stat
Version 1.9.7:
* Graphics:

View file

@ -37,11 +37,16 @@ total_savings_filecount=0
new_file_list="new_file_list.tmp"
old_file_list="old_file_list.tmp"
broken_file_list="broken_file_list.tmp"
stat_args="-c %s"
if [ -e "/proc/cpuinfo" ] && [ `grep processor /proc/cpuinfo | wc -l` -gt 1 ]; then
max_number_threads=`grep processor /proc/cpuinfo | wc -l`
fi
if [ `man stat | grep 'BSD' | wc -l` -gt 0 ]; then
stat_args="-f %z"
fi
####### PROCEDURES #######
report_absent_tool()
@ -111,8 +116,8 @@ get_statistics_and_delete_temp_files()
rm -f ${1}.new
elif [ -e ${1} ] && [ -e ${1}.new ]; then
# Compare output size with original and print per-file statistics
local old_png_size=`stat -c %s ${1} 2> /dev/null`
local new_png_size=`stat -c %s ${1}.new 2> /dev/null`
local old_png_size=`stat ${stat_args} ${1} 2> /dev/null`
local new_png_size=`stat ${stat_args} ${1}.new 2> /dev/null`
if [ "$old_png_size" -gt "$new_png_size" ]; then
local png_savings_size=$((${old_png_size}-${new_png_size}))