[Date Prev][Date Next][Thread Prev][Thread Next][Thread Index]

[XaraXtreme-commits] Commit Complete



Commit by  : alex
Repository : xara
Revision   : 889
Date       : Wed Apr 26 10:31:13 BST 2006

Changed paths:
   M /Trunk/XaraLX/Scripts/build-resources.sh

Make Scripts/build-resources.sh only compile new resources when necessary


Diff:
Index: Trunk/XaraLX/Scripts/build-resources.sh
===================================================================
--- Trunk/XaraLX/Scripts/build-resources.sh	(revision 888)
+++ Trunk/XaraLX/Scripts/build-resources.sh	(revision 889)
@@ -5,7 +5,7 @@
 TOPDIR=`pwd`
 
 # We should set this to 0
-NEWRES=1
+NEWRES=0
 # A checksum routine - it doesn't much matter what it is
 CHECKSUM=md5sum
 ZIP=zip
@@ -18,18 +18,24 @@
 if ( test ! -d xrc ) ; then mkdir xrc; fi;
 if ! [ -e xrc/xrc.d ] ; then touch xrc/xrc.d ; sleep 1 ; fi
 ( find $TOPDIR/wxOil/xrc/$XARALANGUAGE -maxdepth 1 -name '*.xrc' ; find $TOPDIR/wxOil/xrc -maxdepth 1 -name '*.png' -or -name '*.ico' -or -name '*.cur' -or -name '*.bmp' -or -name '*.res' -or -name '*.xar' ) | perl -e 'while(<>) {chomp; s/
//; push @F, $_}; printf "xrc/dialogs.xrc xrc/strings.xrc xrc/strings.lst xrc/xaralx.po: xrc/xrc.stamp %s
",join (" ",sort @F);' > xrc/xrc.d.$$ ;
-if ( ! ( cmp -s xrc/xrc.d.$$ xrc/xrc.d) ) ; then touch xrc/xrc.stamp ; mv xrc/xrc.d.$$ xrc/xrc.d ; echo Found new resources 1>&2 ; else rm -f xrc/xrc.d.$$; fi ;
+if ( ! ( cmp -s xrc/xrc.d.$$ xrc/xrc.d) ) ; then touch xrc/xrc.stamp ; mv xrc/xrc.d.$$ xrc/xrc.d ; echo Found new resources 1>&2 ; NEWRES=1; else rm -f xrc/xrc.d.$$; fi ;
 if ! [ -e xrc/xrc.stamp ] ; then touch xrc/xrc.stamp ; fi
 
 # we should here go through all the files in xrc.d and check their dates
 
+XRCDIALOGS=`perl -ane 'foreach $f (@F) { push @G,$f if $f=~/${XARALANGUAGE}\/.+\.xrc$/ && $f!~/-strings\.xrc$/};print join(" ",@G)."
";' < xrc/xrc.d`
+XRCSTRINGS=`perl -ane 'foreach $f (@F) { push @G,$f if $f=~/${XARALANGUAGE}\/.+\.xrc$/ };print join(" ",@G)."
";' < xrc/xrc.d`
+XRCBITMAPS=`perl -ane 'foreach $f (@F) { push @G,$f if $f=~/\.(png|ico|cur|bmp|res|xar)$/};print join(" ",@G)."
";' < xrc/xrc.d`
+XRCALL=`perl -ane 'foreach $f (@F) { push @G,$f if $f=~/${XARALANGUAGE}\/.+$/ };print join(" ",@G)."
";' < xrc/xrc.d`
+
+if test "$NEWRES" -eq 0 ; then
+	NEWRES=`echo $XRCALL xrc/xrc.stamp | perl -ane '$x=0;$m=(stat("resources.cpp"))[9];foreach $f (@F) {if ((stat($f))[9]>$m) {$x=1;break;}};print "$x
";'`
+fi
+
 if test "$NEWRES" -eq 1 ; then
 	echo "Rebuilding resources" 1>&2
 	rm -f xrc/xrc.check xrc/resources.xrs xrc/dialogs.xrc xrc/strings.xrc xrc/strings.lst 1>&2 2>/dev/null;
 
-	XRCDIALOGS=`perl -ane 'foreach $f (@F) { push @G,$f if $f=~/${XARALANGUAGE}\/.+\.xrc$/ && $f!~/-strings\.xrc$/};print join(" ",@G)."
";' < xrc/xrc.d`
-	XRCSTRINGS=`perl -ane 'foreach $f (@F) { push @G,$f if $f=~/${XARALANGUAGE}\/.+\.xrc$/ };print join(" ",@G)."
";' < xrc/xrc.d`
-	XRCBITMAPS=`perl -ane 'foreach $f (@F) { push @G,$f if $f=~/\.(png|ico|cur|bmp|res|xar)$/};print join(" ",@G)."
";' < xrc/xrc.d`
 
 	echo "Combining dialog & string resources" 1>&2 && \
 	touch xrc/strings.xrc && \n

Xara