Package: shrinksafe
Version: 1.6.1-1
Severity: normal
Tags: patch
User: [email protected]
Usertags: origin-ubuntu oneiric ubuntu-patch
Now that rhino 1.7R3 is in unstable and latest Ubuntu devel shrinksafe
won't build or execute due to API changes.
I've not submitted this back upstream but please feel free todo so.
*** /tmp/tmpH1iYdA
In Ubuntu, the attached patch was applied to achieve the following:
* Fix FTBFS - incompatble with rhino >= 1.7R3 (LP: #831366):
- d/control: Remove Build-Conflicts-Indep and update Build-Depends:
rhino (>= 1.7R3)
- d/patches/rhino-17r3-compat.patch: Compatibility patch for rhino
>= 1.7R3.
Thanks for considering the patch.
-- System Information:
Debian Release: wheezy/sid
APT prefers oneiric-updates
APT policy: (500, 'oneiric-updates'), (500, 'oneiric-security'), (500,
'oneiric')
Architecture: amd64 (x86_64)
Kernel: Linux 3.0.0-11-generic (SMP w/8 CPU cores)
Locale: LANG=C, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
=== modified file 'debian/control'
--- debian/control 2010-11-11 14:55:35 +0000
+++ debian/control 2011-09-19 15:31:46 +0000
@@ -1,10 +1,10 @@
Source: shrinksafe
Section: devel
Priority: optional
-Maintainer: Jason Morawski <[email protected]>
+Maintainer: Ubuntu Developers <[email protected]>
+XSBC-Original-Maintainer: Jason Morawski <[email protected]>
Build-Depends: debhelper (>= 8), javahelper (>= 0.31)
-Build-Depends-Indep: default-jdk, rhino (>= 1.7R1)
-Build-Conflicts-Indep: rhino (>= 1.7R3)
+Build-Depends-Indep: default-jdk, rhino (>= 1.7R3)
Standards-Version: 3.9.1
Homepage: http://shrinksafe.dojotoolkit.org
=== added directory 'debian/patches'
=== added file 'debian/patches/rhino-17r3-compat.patch'
--- debian/patches/rhino-17r3-compat.patch 1970-01-01 00:00:00 +0000
+++ debian/patches/rhino-17r3-compat.patch 2011-09-21 08:40:16 +0000
@@ -0,0 +1,92 @@
+Description: Compatibility patch for Rhino 1.7R3.
+Author: James Page <[email protected]>
+Forwarded: no
+
+Index: shrinksafe/src/org/dojotoolkit/shrinksafe/Compressor.java
+===================================================================
+--- shrinksafe.orig/src/org/dojotoolkit/shrinksafe/Compressor.java 2011-09-19 16:38:06.063956882 +0100
++++ shrinksafe/src/org/dojotoolkit/shrinksafe/Compressor.java 2011-09-21 09:40:14.415913553 +0100
+@@ -35,11 +35,13 @@
+
+ import org.mozilla.javascript.CompilerEnvirons;
+ import org.mozilla.javascript.Decompiler;
+-import org.mozilla.javascript.FunctionNode;
++import org.mozilla.javascript.ast.FunctionNode;
+ import org.mozilla.javascript.Interpreter;
+ import org.mozilla.javascript.Kit;
+ import org.mozilla.javascript.Parser;
+-import org.mozilla.javascript.ScriptOrFnNode;
++import org.mozilla.javascript.IRFactory;
++import org.mozilla.javascript.ast.ScriptNode;
++import org.mozilla.javascript.ast.AstRoot;
+ import org.mozilla.javascript.ScriptRuntime;
+ import org.mozilla.javascript.Token;
+ import org.mozilla.javascript.UintMap;
+@@ -64,7 +66,7 @@
+ private static String compress(String encodedSource,
+ int flags,
+ UintMap properties,
+- ScriptOrFnNode parseTree,
++ ScriptNode parseTree,
+ boolean escapeUnicode,
+ String stripConsole,
+ TokenMapper tm,
+@@ -983,11 +985,13 @@
+ CompilerEnvirons compilerEnv = new CompilerEnvirons();
+
+ Parser parser = new Parser(compilerEnv, compilerEnv.getErrorReporter());
+-
+- ScriptOrFnNode tree = parser.parse(source, null, lineno);
+- String encodedSource = parser.getEncodedSource();
+- if (encodedSource.length() == 0) { return ""; }
+-
++ IRFactory irFactory = new IRFactory(compilerEnv, compilerEnv.getErrorReporter());
++
++ AstRoot parsedTree = parser.parse(source, null, lineno);
++ ScriptNode tree = irFactory.transformTree(parsedTree);
++ String encodedSource = tree.getEncodedSource();
++ if ( encodedSource.length() == 0 ) { return ""; }
++
+ Interpreter compiler = new Interpreter();
+ compiler.compile(compilerEnv, tree, encodedSource, false);
+ UintMap properties = new UintMap(1);
+Index: shrinksafe/src/org/dojotoolkit/shrinksafe/TokenMapper.java
+===================================================================
+--- shrinksafe.orig/src/org/dojotoolkit/shrinksafe/TokenMapper.java 2011-09-19 16:37:59.693992810 +0100
++++ shrinksafe/src/org/dojotoolkit/shrinksafe/TokenMapper.java 2011-09-19 16:43:19.082272339 +0100
+@@ -32,7 +32,7 @@
+ import java.util.List;
+ import java.util.Map;
+
+-import org.mozilla.javascript.ScriptOrFnNode;
++import org.mozilla.javascript.ast.ScriptNode;
+ import org.mozilla.javascript.ScriptRuntime;
+ import org.mozilla.javascript.Token;
+
+@@ -58,7 +58,7 @@
+
+ private int lastTokenCount = 0;
+
+- public TokenMapper(ScriptOrFnNode parseTree) {
++ public TokenMapper(ScriptNode parseTree) {
+ collectFunctionMappings(parseTree);
+ }
+
+@@ -170,7 +170,7 @@
+ * Mapping for each function node and corresponding parameters &
+ * variables names
+ */
+- private void collectFunctionMappings(ScriptOrFnNode parseTree) {
++ private void collectFunctionMappings(ScriptNode parseTree) {
+ int level = -1;
+ collectFuncNodes(parseTree, level, null);
+ }
+@@ -185,7 +185,7 @@
+ * @param level
+ * scoping level
+ */
+- private void collectFuncNodes(ScriptOrFnNode parseTree, int level, ScriptOrFnNode parent) {
++ private void collectFuncNodes(ScriptNode parseTree, int level, ScriptNode parent) {
+ level++;
+
+ DebugData debugData = new DebugData();
=== added file 'debian/patches/series'
--- debian/patches/series 1970-01-01 00:00:00 +0000
+++ debian/patches/series 2011-09-19 15:37:40 +0000
@@ -0,0 +1 @@
+rhino-17r3-compat.patch