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

[XaraXtreme-commits] Commit Complete



Commit by  : alex
Repository : xara
Revision   : 1203
Date       : Sun May 28 19:33:12 BST 2006

Changed paths:
   M /Trunk/XaraLX/Scripts/build-resources.pl
   M /Trunk/XaraLX/wxOil/Makefile.am

Handle quoted resources in a vaguely useful way
Stop on build errors when building resources


Diff:
Index: Trunk/XaraLX/Scripts/build-resources.pl
===================================================================
--- Trunk/XaraLX/Scripts/build-resources.pl	(revision 1202)
+++ Trunk/XaraLX/Scripts/build-resources.pl	(revision 1203)
@@ -259,6 +259,7 @@
 if (!$newer && !$force)
 {
     print STDERR "Nothing new
";
+    ok();
     exit (0);
 }
 
@@ -303,7 +304,11 @@
     }
 }
 
-exit(0) unless $buildresources;
+if (!$buildresources)
+{
+    ok();
+    exit(0);
+}
 
 print STDERR "Rebuilding resources - new checksum $checksum
";
 unlink ("$outputdir/xrc/$xaralanguage/xrc.check");
@@ -353,7 +358,11 @@
     $j=~s/\r\n/\n/g;
     # strings.lst is still XML escaped. We want to remove the XML escaping here - we add C escaping to BOTH
     # later
-    # We should use proper XML unquoting here - AMB to fix
+    # We should use proper XML unquoting here - AMB to fix - could use HTML::Entities if it's around
+    # Handle quoted numbers
+    my $c;
+    $j=~s/(&\#(\d+);?)/$2 < 256 ? chr($2) : $1/eg;
+    $j=~s/(&\#[xX]([0-9a-fA-F]+);?)/$c = hex($2); $c < 256 ? chr($c) : $1/eg;
     $j=~s/&lt;/\</g;
     $j=~s/&gt;/\>/g;
     $j=~s/&quot;/\"/g;
@@ -384,4 +393,11 @@
 # OK we've finished so move the checksum into the right place
 rename ("$outputdir/xrc/$xaralanguage/xrc.check", "$outputdir/xrc/xrc.check");
 
+ok();
 exit(0);
+
+# Print an OK to STDOUT
+sub ok
+{
+    print "OK
";
+}
Index: Trunk/XaraLX/wxOil/Makefile.am
===================================================================
--- Trunk/XaraLX/wxOil/Makefile.am	(revision 1202)
+++ Trunk/XaraLX/wxOil/Makefile.am	(revision 1203)
@@ -41,4 +41,4 @@
 
 XARALANGUAGE = @XARALANGUAGE@
 
-RESOURCEDUMMY := ${shell $(TOPDIR)/Scripts/build-resources.pl -t $(TOPDIR) -o . --version $(VERSION) -x $(XARALANGUAGE) -u $(USER) }
+RESOURCEDUMMY := ${if ${strip ${shell $(TOPDIR)/Scripts/build-resources.pl -t $(TOPDIR) -o . --version $(VERSION) -x $(XARALANGUAGE) -u $(USER) } }, ,${error "Resource build failed"}}


Xara