rhino-1.7R4-2.fc19.noarch dropped -main flag which made the build fail in rawhide (F19).

We can't use the same command for rhino-1.7R3-6 (F18) and rhino-1.7R4-2 (F19). This patch adds check if rhino supports '-require' option. If so it calls rhino with it if not it calls rhino with -main option.

https://fedorahosted.org/freeipa/ticket/3501
--
Petr Vobornik
From 792cd392ae2ec13c4d74afb9ef7f1262b9e06c1f Mon Sep 17 00:00:00 2001
From: Petr Vobornik <pvobo...@redhat.com>
Date: Mon, 11 Mar 2013 14:15:46 +0100
Subject: [PATCH] Fixed Web UI build error caused by rhino changes in F19

rhino-1.7R4-2.fc19.noarch dropped -main flag which made the build fail in rawhide (F19).

We can't use the same command for rhino-1.7R3-6 (F18) and rhino-1.7R4-2 (F19).
This patch adds check if rhino supports '-require' option. If so it calls rhino with it if not it calls rhino with -main option.

https://fedorahosted.org/freeipa/ticket/3501
---
 install/ui/util/uglifyjs/uglify | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/install/ui/util/uglifyjs/uglify b/install/ui/util/uglifyjs/uglify
index 50dfb51d512b03a7eb72170d29ea701411934f92..7d25b38df19e465227f29b8b70ccf7ca140f725a 100755
--- a/install/ui/util/uglifyjs/uglify
+++ b/install/ui/util/uglifyjs/uglify
@@ -23,4 +23,10 @@
 
 DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
 
-rhino -main $DIR/uglify-js.js $DIR/ug.js $1 $2 -v
\ No newline at end of file
+# rhino-1.7R4 doesn't have -main option to enable CommonJS support. It was
+# replaced by -require option.
+if [ `rhino --help | grep -e -require | wc -l` -gt 0 ] ; then
+    rhino -require $DIR/uglify-js.js $@
+else
+    rhino -main $DIR/uglify-js.js $DIR/ug.js $@
+fi
\ No newline at end of file
-- 
1.8.1.4

_______________________________________________
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Reply via email to