Author: ivanovic
Date: Sun Jul 24 12:28:37 2011
New Revision: 50376
URL: http://svn.gna.org/viewcvs/wesnoth?rev=50376&view=rev
Log:
applied patch #2663 by alarantalara: Make wesnoth-optipng work on systems with
BSD stat
Modified:
trunk/changelog
trunk/utils/wesnoth-optipng
Modified: trunk/changelog
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/changelog?rev=50376&r1=50375&r2=50376&view=diff
==============================================================================
--- trunk/changelog (original)
+++ trunk/changelog Sun Jul 24 12:28:37 2011
@@ -38,6 +38,7 @@
* 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:
Modified: trunk/utils/wesnoth-optipng
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/utils/wesnoth-optipng?rev=50376&r1=50375&r2=50376&view=diff
==============================================================================
--- trunk/utils/wesnoth-optipng (original)
+++ trunk/utils/wesnoth-optipng Sun Jul 24 12:28:37 2011
@@ -37,9 +37,14 @@
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 #######
@@ -111,8 +116,8 @@
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}))
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits