Author: drazzib Date: 2011-07-04 21:34:43 +0000 (Mon, 04 Jul 2011) New Revision: 13838
Added: tags/yui-compressor/2.4.6+rhino17R2-1/ tags/yui-compressor/2.4.6+rhino17R2-1/debian/changelog tags/yui-compressor/2.4.6+rhino17R2-1/debian/control tags/yui-compressor/2.4.6+rhino17R2-1/debian/fetch-upstream tags/yui-compressor/2.4.6+rhino17R2-1/debian/patches/decompiler.patch tags/yui-compressor/2.4.6+rhino17R2-1/debian/patches/parser.patch tags/yui-compressor/2.4.6+rhino17R2-1/debian/patches/series tags/yui-compressor/2.4.6+rhino17R2-1/debian/patches/token.patch tags/yui-compressor/2.4.6+rhino17R2-1/debian/patches/tokenstream.patch tags/yui-compressor/2.4.6+rhino17R2-1/debian/patches/use-system-libraries.patch tags/yui-compressor/2.4.6+rhino17R2-1/debian/rules Removed: tags/yui-compressor/2.4.6+rhino17R2-1/debian/changelog tags/yui-compressor/2.4.6+rhino17R2-1/debian/control tags/yui-compressor/2.4.6+rhino17R2-1/debian/fetch-upstream tags/yui-compressor/2.4.6+rhino17R2-1/debian/patches/rhino17R3.diff tags/yui-compressor/2.4.6+rhino17R2-1/debian/patches/series tags/yui-compressor/2.4.6+rhino17R2-1/debian/patches/tokenstream.patch tags/yui-compressor/2.4.6+rhino17R2-1/debian/patches/use-system-libraries.patch tags/yui-compressor/2.4.6+rhino17R2-1/debian/rules Log: [svn-buildpackage] Tagging yui-compressor 2.4.6+rhino17R2-1 Deleted: tags/yui-compressor/2.4.6+rhino17R2-1/debian/changelog =================================================================== --- trunk/yui-compressor/debian/changelog 2011-07-02 05:20:23 UTC (rev 13829) +++ tags/yui-compressor/2.4.6+rhino17R2-1/debian/changelog 2011-07-04 21:34:43 UTC (rev 13838) @@ -1,61 +0,0 @@ -yui-compressor (2.4.6+rhino17R3-1) UNRELEASED; urgency=low - - * Re-add some part of embedded Rhino source code because - some code as not been merged into Rhino 1.7R3 release - (Closes: #630542). - - d/copyright: Readd copyright notice. - - d/fetch-upstream: Update script to download rhino source code. - - d/patches/tokenstream.patch: Updated for Rhino 1.7R3. - - -- Damien Raude-Morvan <[email protected]> Mon, 20 Jun 2011 22:29:41 +0200 - -yui-compressor (2.4.6+debian1-1) unstable; urgency=low - - * New source tarball without embedded Rhino source code: - - Update d/copyright since there is no more Rhino source code in this - tarball. - - d/patches/{parser,token,decompiler,tokenstream}.patch: Dropped. - * d/patches/fix_testsuite.diff: Fix test suite to use /usr/share/java/js.jar - * d/patches/rhino17R3.diff: Use Rhino AST API to plug-in this compressor. - - -- Damien Raude-Morvan <[email protected]> Sun, 12 Jun 2011 22:04:43 +0200 - -yui-compressor (2.4.6-1) unstable; urgency=low - - * New upstream release (Closes: #622856). - * Bump Standards-Version to 3.9.2 (no changes needed). - * Switch to 3.0 (quilt) source format. - * d/watch: Upstream has broken scanning. Disable uscan for now. - * d/copyright: Update copyright years and paste full licence text. - - -- Damien Raude-Morvan <[email protected]> Mon, 25 Apr 2011 11:50:28 +0200 - -yui-compressor (2.4.2-2) unstable; urgency=low - - * Add Depends on a Java runtime (Closes: #565645) - * Depends on libjargs-java instead of embedding it inside yui-compressor - (see use-system-libraries.patch) - * Update Vcs-* fields to reflect package name change - (yuicompressor -> yui-compressor) - * Create extended manpage from help output - - remove docbook debian/yui-compressor.1.xml - - remove Build-Depends on docbook2x - * Use java-wrappers for bin/yui-compressor launcher script - - -- Damien Raude-Morvan <[email protected]> Sun, 17 Jan 2010 19:51:06 +0100 - -yui-compressor (2.4.2-1) unstable; urgency=low - - [ Dominik Smatana ] - * Initial release (closes: #519938) - - [ Michael Gilbert ] - * Download the required rhino source files in the orig tarball - fetching script. - * Add patches for build file to use system rhino and jargs libraries. - * Apply yui-compressor patches to the included rhino source. - * Add a README.source to describe the patch system. - * Add a launcher shell script. - * Add a manpage for the shell script. - - -- Michael Gilbert <[email protected]> Thu, 07 Jan 2010 21:34:14 -0500 Copied: tags/yui-compressor/2.4.6+rhino17R2-1/debian/changelog (from rev 13837, trunk/yui-compressor/debian/changelog) =================================================================== --- tags/yui-compressor/2.4.6+rhino17R2-1/debian/changelog (rev 0) +++ tags/yui-compressor/2.4.6+rhino17R2-1/debian/changelog 2011-07-04 21:34:43 UTC (rev 13838) @@ -0,0 +1,60 @@ +yui-compressor (2.4.6+rhino17R2-1) unstable; urgency=low + + * Re-add some part of embedded Rhino source code: + (Closes: #630542). + - d/copyright: Readd copyright notice. + - d/control: Drop Depends and Build-Depends on rhino. + - d/fetch-upstream: Update script to download rhino source code. + + -- Damien Raude-Morvan <[email protected]> Mon, 04 Jul 2011 23:26:08 +0200 + +yui-compressor (2.4.6+debian1-1) unstable; urgency=low + + * New source tarball without embedded Rhino source code: + - Update d/copyright since there is no more Rhino source code in this + tarball. + - d/patches/{parser,token,decompiler,tokenstream}.patch: Dropped. + * d/patches/fix_testsuite.diff: Fix test suite to use /usr/share/java/js.jar + * d/patches/rhino17R3.diff: Use Rhino AST API to plug-in this compressor. + + -- Damien Raude-Morvan <[email protected]> Sun, 12 Jun 2011 22:04:43 +0200 + +yui-compressor (2.4.6-1) unstable; urgency=low + + * New upstream release (Closes: #622856). + * Bump Standards-Version to 3.9.2 (no changes needed). + * Switch to 3.0 (quilt) source format. + * d/watch: Upstream has broken scanning. Disable uscan for now. + * d/copyright: Update copyright years and paste full licence text. + + -- Damien Raude-Morvan <[email protected]> Mon, 25 Apr 2011 11:50:28 +0200 + +yui-compressor (2.4.2-2) unstable; urgency=low + + * Add Depends on a Java runtime (Closes: #565645) + * Depends on libjargs-java instead of embedding it inside yui-compressor + (see use-system-libraries.patch) + * Update Vcs-* fields to reflect package name change + (yuicompressor -> yui-compressor) + * Create extended manpage from help output + - remove docbook debian/yui-compressor.1.xml + - remove Build-Depends on docbook2x + * Use java-wrappers for bin/yui-compressor launcher script + + -- Damien Raude-Morvan <[email protected]> Sun, 17 Jan 2010 19:51:06 +0100 + +yui-compressor (2.4.2-1) unstable; urgency=low + + [ Dominik Smatana ] + * Initial release (closes: #519938) + + [ Michael Gilbert ] + * Download the required rhino source files in the orig tarball + fetching script. + * Add patches for build file to use system rhino and jargs libraries. + * Apply yui-compressor patches to the included rhino source. + * Add a README.source to describe the patch system. + * Add a launcher shell script. + * Add a manpage for the shell script. + + -- Michael Gilbert <[email protected]> Thu, 07 Jan 2010 21:34:14 -0500 Deleted: tags/yui-compressor/2.4.6+rhino17R2-1/debian/control =================================================================== --- trunk/yui-compressor/debian/control 2011-07-02 05:20:23 UTC (rev 13829) +++ tags/yui-compressor/2.4.6+rhino17R2-1/debian/control 2011-07-04 21:34:43 UTC (rev 13838) @@ -1,26 +0,0 @@ -Source: yui-compressor -Section: java -Priority: optional -Maintainer: Debian Java Maintainers <[email protected]> -Uploaders: Dominik Smatana <[email protected]>, Damien Raude-Morvan <[email protected]>, - Michael Gilbert <[email protected]> -Build-Depends: cdbs, debhelper (>= 7), default-jdk, ant -Build-Depends-Indep: libjargs-java, librhino-java (>= 1.7R3) -Homepage: http://yuilibrary.com/projects/yuicompressor/ -Vcs-Svn: svn://svn.debian.org/svn/pkg-java/trunk/yui-compressor/ -Vcs-Browser: http://svn.debian.org/wsvn/pkg-java/trunk/yui-compressor/ -Standards-Version: 3.9.2 - -Package: yui-compressor -Architecture: all -Depends: ${misc:Depends}, default-jre-headless | java5-runtime-headless, - libjargs-java, java-wrappers, librhino-java (>= 1.7R3) -Description: JavaScript/CSS minifier - The YUI Compressor is a JavaScript compressor which, in addition to removing - comments and white-spaces, obfuscates local variables using the smallest - possible variable name. This obfuscation is safe, even when using constructs - such as 'eval' or 'with' (although the compression is not optimal is those - cases) Compared to jsmin, the average savings is around 20%. - . - The YUI Compressor is also able to safely compress CSS files. The decision - on which compressor is being used is made on the file extension (js or css). Copied: tags/yui-compressor/2.4.6+rhino17R2-1/debian/control (from rev 13837, trunk/yui-compressor/debian/control) =================================================================== --- tags/yui-compressor/2.4.6+rhino17R2-1/debian/control (rev 0) +++ tags/yui-compressor/2.4.6+rhino17R2-1/debian/control 2011-07-04 21:34:43 UTC (rev 13838) @@ -0,0 +1,26 @@ +Source: yui-compressor +Section: java +Priority: optional +Maintainer: Debian Java Maintainers <[email protected]> +Uploaders: Dominik Smatana <[email protected]>, Damien Raude-Morvan <[email protected]>, + Michael Gilbert <[email protected]> +Build-Depends: cdbs, debhelper (>= 7), default-jdk, ant +Build-Depends-Indep: libjargs-java +Homepage: http://yuilibrary.com/projects/yuicompressor/ +Vcs-Svn: svn://svn.debian.org/svn/pkg-java/trunk/yui-compressor/ +Vcs-Browser: http://svn.debian.org/wsvn/pkg-java/trunk/yui-compressor/ +Standards-Version: 3.9.2 + +Package: yui-compressor +Architecture: all +Depends: ${misc:Depends}, default-jre-headless | java5-runtime-headless, + libjargs-java, java-wrappers +Description: JavaScript/CSS minifier + The YUI Compressor is a JavaScript compressor which, in addition to removing + comments and white-spaces, obfuscates local variables using the smallest + possible variable name. This obfuscation is safe, even when using constructs + such as 'eval' or 'with' (although the compression is not optimal is those + cases) Compared to jsmin, the average savings is around 20%. + . + The YUI Compressor is also able to safely compress CSS files. The decision + on which compressor is being used is made on the file extension (js or css). Deleted: tags/yui-compressor/2.4.6+rhino17R2-1/debian/fetch-upstream =================================================================== --- trunk/yui-compressor/debian/fetch-upstream 2011-07-02 05:20:23 UTC (rev 13829) +++ tags/yui-compressor/2.4.6+rhino17R2-1/debian/fetch-upstream 2011-07-04 21:34:43 UTC (rev 13838) @@ -1,38 +0,0 @@ -#!/bin/sh -set -e - -echo $# -if test "$#" != "3" ; then - echo "usage: $0 <upstream version number> <expected tarball version> <rhino package version>" - exit 1 -fi -version="$1" -orig_tarball_version="$2" -rhino_version="$3" -curdir="$PWD" - -# download -cd /tmp -wget -N http://yui.zenfs.com/releases/yuicompressor/yuicompressor-$version.zip -unzip -xq yuicompressor-$version.zip -rm yuicompressor-$version.zip - -# cleanup -rm -rf yuicompressor-$version/build -rm -rf yuicompressor-$version/lib -rm -rf yuicompressor-$version/src/org/mozilla/javascript/* - -# download rhino source -apt-get source rhino=$rhino_version -rhino_version="$(echo $rhino_version | cut -d - -f 1)" -#cp rhino-$rhino_version/src/org/mozilla/javascript/Decompiler.java yuicompressor-$version/src/org/mozilla/javascript -#cp rhino-$rhino_version/src/org/mozilla/javascript/Parser.java yuicompressor-$version/src/org/mozilla/javascript -#cp rhino-$rhino_version/src/org/mozilla/javascript/Token.java yuicompressor-$version/src/org/mozilla/javascript -cp rhino-$rhino_version/src/org/mozilla/javascript/TokenStream.java yuicompressor-$version/src/org/mozilla/javascript - -# repack -mv yuicompressor-$version yui-compressor-$version -tar czf yui-compressor_$orig_tarball_version.orig.tar.gz yui-compressor-$version -rm -rf yui-compressor-$version -mv yui-compressor_$orig_tarball_version.orig.tar.gz $curdir -echo "Done: successfully created yui-compressor_$version.orig.tar.gz." Copied: tags/yui-compressor/2.4.6+rhino17R2-1/debian/fetch-upstream (from rev 13837, trunk/yui-compressor/debian/fetch-upstream) =================================================================== --- tags/yui-compressor/2.4.6+rhino17R2-1/debian/fetch-upstream (rev 0) +++ tags/yui-compressor/2.4.6+rhino17R2-1/debian/fetch-upstream 2011-07-04 21:34:43 UTC (rev 13838) @@ -0,0 +1,38 @@ +#!/bin/sh +set -e + +echo $# +if test "$#" != "3" ; then + echo "usage: $0 <upstream version number> <expected tarball version> <rhino package version>" + exit 1 +fi +version="$1" +orig_tarball_version="$2" +rhino_version="$3" +curdir="$PWD" + +# download +cd /tmp +wget -N http://yui.zenfs.com/releases/yuicompressor/yuicompressor-$version.zip +unzip -xq yuicompressor-$version.zip +rm yuicompressor-$version.zip + +# cleanup +rm -rf yuicompressor-$version/build +rm -rf yuicompressor-$version/lib +rm -rf yuicompressor-$version/src/org/mozilla/javascript/* + +# download rhino source +debsnap --verbose rhino $rhino_version +rhino_tar_version="$(echo $rhino_version | cut -d - -f 1)" +rhino_dir_version="$(echo $rhino_tar_version | sed "s/\./_/")" +(cd source-rhino/; tar xvzf rhino_$rhino_tar_version.orig.tar.gz) +cp -r source-rhino/rhino$rhino_dir_version/src/org/mozilla/* yuicompressor-$version/src/org/mozilla/ + +# repack +mv yuicompressor-$version yui-compressor-$version +tar czf yui-compressor_$orig_tarball_version.orig.tar.gz yui-compressor-$version +rm -rf yui-compressor-$version +rm -rf source-rhino +mv yui-compressor_$orig_tarball_version.orig.tar.gz $curdir +echo "Done: successfully created yui-compressor_$version.orig.tar.gz." Copied: tags/yui-compressor/2.4.6+rhino17R2-1/debian/patches/decompiler.patch (from rev 13836, trunk/yui-compressor/debian/patches/decompiler.patch) =================================================================== --- tags/yui-compressor/2.4.6+rhino17R2-1/debian/patches/decompiler.patch (rev 0) +++ tags/yui-compressor/2.4.6+rhino17R2-1/debian/patches/decompiler.patch 2011-07-04 21:34:43 UTC (rev 13838) @@ -0,0 +1,23 @@ +YUI patch for the Rhino library's Decompiler.java +=================================================================== +--- a/src/org/mozilla/javascript/Decompiler.java.orig 2008-11-14 10:13:36.000000000 -0500 ++++ b/src/org/mozilla/javascript/Decompiler.java 2008-11-14 10:13:36.000000000 -0500 +@@ -166,6 +166,18 @@ + appendString('/' + regexp + '/' + flags); + } + ++ void addJScriptConditionalComment(String str) ++ { ++ addToken(Token.CONDCOMMENT); ++ appendString(str); ++ } ++ ++ void addPreservedComment(String str) ++ { ++ addToken(Token.KEEPCOMMENT); ++ appendString(str); ++ } ++ + void addNumber(double n) + { + addToken(Token.NUMBER); Copied: tags/yui-compressor/2.4.6+rhino17R2-1/debian/patches/parser.patch (from rev 13836, trunk/yui-compressor/debian/patches/parser.patch) =================================================================== --- tags/yui-compressor/2.4.6+rhino17R2-1/debian/patches/parser.patch (rev 0) +++ tags/yui-compressor/2.4.6+rhino17R2-1/debian/patches/parser.patch 2011-07-04 21:34:43 UTC (rev 13838) @@ -0,0 +1,37 @@ +YUI patch for the Rhino library's Parser.java +=================================================================== +--- a/src/org/mozilla/javascript/Parser.java ++++ b/src/org/mozilla/javascript/Parser.java +@@ -169,11 +169,30 @@ + { + int tt = currentFlaggedToken; + if (tt == Token.EOF) { +- tt = ts.getToken(); ++ ++ while ((tt = ts.getToken()) == Token.CONDCOMMENT || tt == Token.KEEPCOMMENT) { ++ if (tt == Token.CONDCOMMENT) { ++ /* Support for JScript conditional comments */ ++ decompiler.addJScriptConditionalComment(ts.getString()); ++ } else { ++ /* Support for preserved comments */ ++ decompiler.addPreservedComment(ts.getString()); ++ } ++ } ++ + if (tt == Token.EOL) { + do { + tt = ts.getToken(); +- } while (tt == Token.EOL); ++ ++ if (tt == Token.CONDCOMMENT) { ++ /* Support for JScript conditional comments */ ++ decompiler.addJScriptConditionalComment(ts.getString()); ++ } else if (tt == Token.KEEPCOMMENT) { ++ /* Support for preserved comments */ ++ decompiler.addPreservedComment(ts.getString()); ++ } ++ ++ } while (tt == Token.EOL || tt == Token.CONDCOMMENT || tt == Token.KEEPCOMMENT); + tt |= TI_AFTER_EOL; + } + currentFlaggedToken = tt; Deleted: tags/yui-compressor/2.4.6+rhino17R2-1/debian/patches/rhino17R3.diff =================================================================== --- trunk/yui-compressor/debian/patches/rhino17R3.diff 2011-07-02 05:20:23 UTC (rev 13829) +++ tags/yui-compressor/2.4.6+rhino17R2-1/debian/patches/rhino17R3.diff 2011-07-04 21:34:43 UTC (rev 13838) @@ -1,83 +0,0 @@ -Description: Port this parser to new Rhino 1.7R3 AST API. -Author: Damien Raude-Morvan <[email protected]> -Last-Update: 2011-06-12 -Forwarded: https://github.com/yui/yuicompressor/pull/9 ---- a/src/com/yahoo/platform/yui/compressor/JavaScriptCompressor.java -+++ b/src/com/yahoo/platform/yui/compressor/JavaScriptCompressor.java -@@ -9,6 +9,7 @@ - package com.yahoo.platform.yui.compressor; - - import org.mozilla.javascript.*; -+import org.mozilla.javascript.ast.*; - - import java.io.IOException; - import java.io.Reader; -@@ -309,8 +310,11 @@ - - CompilerEnvirons env = new CompilerEnvirons(); - Parser parser = new Parser(env, reporter); -- parser.parse(in, null, 1); -- String source = parser.getEncodedSource(); -+ AstRoot ast = parser.parse(in, null, 1); -+ IRFactory irf = new IRFactory(env, reporter); -+ ScriptNode tree = irf.transformTree(ast); -+ -+ String source = tree.getEncodedSource(); - - int offset = 0; - int length = source.length(); -@@ -321,8 +325,7 @@ - int tt = source.charAt(offset++); - switch (tt) { - -- case Token.CONDCOMMENT: -- case Token.KEEPCOMMENT: -+ case Token.COMMENT: - case Token.NAME: - case Token.REGEXP: - case Token.STRING: -@@ -833,12 +836,14 @@ - parensNesting--; - break; - -- case Token.CONDCOMMENT: -+ case Token.COMMENT: -+ //if (token.commentType == Token.CommentType.JSDOC) { - if (mode == BUILDING_SYMBOL_TREE) { - protectScopeFromObfuscation(currentScope); - warn("Using JScript conditional comments is not recommended." + (munge ? " Moreover, using JScript conditional comments reduces the level of compression!" : ""), true); - } - break; -+ //} - - case Token.NAME: - symbol = token.getValue(); -@@ -986,7 +991,7 @@ - parseCatch(); - break; - -- case Token.CONDCOMMENT: -+ case Token.COMMENT: - if (mode == BUILDING_SYMBOL_TREE) { - protectScopeFromObfuscation(scope); - warn("Using JScript conditional comments is not recommended." + (munge ? " Moreover, using JScript conditional comments reduces the level of compression." : ""), true); -@@ -1276,8 +1281,7 @@ - } - break; - -- case Token.CONDCOMMENT: -- case Token.KEEPCOMMENT: -+ case Token.COMMENT: - if (result.length() > 0 && result.charAt(result.length() - 1) != '\n') { - result.append("\n"); - } -@@ -1303,8 +1307,7 @@ - // end of one file may very likely cause a syntax error) - if (!preserveAllSemiColons && - result.length() > 0 && -- getToken(-1).getType() != Token.CONDCOMMENT && -- getToken(-1).getType() != Token.KEEPCOMMENT) { -+ getToken(-1).getType() != Token.COMMENT) { - if (result.charAt(result.length() - 1) == '\n') { - result.setCharAt(result.length() - 1, ';'); - } else { Deleted: tags/yui-compressor/2.4.6+rhino17R2-1/debian/patches/series =================================================================== --- trunk/yui-compressor/debian/patches/series 2011-07-02 05:20:23 UTC (rev 13829) +++ tags/yui-compressor/2.4.6+rhino17R2-1/debian/patches/series 2011-07-04 21:34:43 UTC (rev 13838) @@ -1,4 +0,0 @@ -rhino17R3.diff -fix_testsuite.diff -use-system-libraries.patch -tokenstream.patch Copied: tags/yui-compressor/2.4.6+rhino17R2-1/debian/patches/series (from rev 13836, trunk/yui-compressor/debian/patches/series) =================================================================== --- tags/yui-compressor/2.4.6+rhino17R2-1/debian/patches/series (rev 0) +++ tags/yui-compressor/2.4.6+rhino17R2-1/debian/patches/series 2011-07-04 21:34:43 UTC (rev 13838) @@ -0,0 +1,6 @@ +fix_testsuite.diff +use-system-libraries.patch +decompiler.patch +parser.patch +token.patch +tokenstream.patch Copied: tags/yui-compressor/2.4.6+rhino17R2-1/debian/patches/token.patch (from rev 13836, trunk/yui-compressor/debian/patches/token.patch) =================================================================== --- tags/yui-compressor/2.4.6+rhino17R2-1/debian/patches/token.patch (rev 0) +++ tags/yui-compressor/2.4.6+rhino17R2-1/debian/patches/token.patch 2011-07-04 21:34:43 UTC (rev 13838) @@ -0,0 +1,17 @@ +YUI patch for the Rhino library's Token.java +=================================================================== +--- a/src/org/mozilla/javascript/Token.java.orig 2009-12-25 00:39:07.000000000 -0500 ++++ b/src/org/mozilla/javascript/Token.java 2009-12-25 00:39:39.000000000 -0500 +@@ -258,7 +258,11 @@ + LETEXPR = 157, + WITHEXPR = 158, + DEBUGGER = 159, +- LAST_TOKEN = 159; ++ ++ CONDCOMMENT = 160, ++ KEEPCOMMENT = 161, ++ ++ LAST_TOKEN = 162; + + public static String name(int token) + { Deleted: tags/yui-compressor/2.4.6+rhino17R2-1/debian/patches/tokenstream.patch =================================================================== --- trunk/yui-compressor/debian/patches/tokenstream.patch 2011-07-02 05:20:23 UTC (rev 13829) +++ tags/yui-compressor/2.4.6+rhino17R2-1/debian/patches/tokenstream.patch 2011-07-04 21:34:43 UTC (rev 13838) @@ -1,176 +0,0 @@ -YUI patch for the Rhino library's TokenStream.java ---- a/src/org/mozilla/javascript/TokenStream.java -+++ b/src/org/mozilla/javascript/TokenStream.java -@@ -541,7 +541,7 @@ - stringBufferTop = 0; - - c = getChar(); -- strLoop: while (c != quoteChar) { -+ while (c != quoteChar) { - if (c == '\n' || c == EOF_CHAR) { - ungetChar(c); - tokenEnd = cursor; -@@ -551,89 +551,47 @@ - - if (c == '\\') { - // We've hit an escaped character -- int escapeVal; - - c = getChar(); -+ - switch (c) { -- case 'b': c = '\b'; break; -- case 'f': c = '\f'; break; -- case 'n': c = '\n'; break; -- case 'r': c = '\r'; break; -- case 't': c = '\t'; break; -- -- // \v a late addition to the ECMA spec, -- // it is not in Java, so use 0xb -- case 'v': c = 0xb; break; -- -- case 'u': -- // Get 4 hex digits; if the u escape is not -- // followed by 4 hex digits, use 'u' + the -- // literal character sequence that follows. -- int escapeStart = stringBufferTop; -- addToString('u'); -- escapeVal = 0; -- for (int i = 0; i != 4; ++i) { -- c = getChar(); -- escapeVal = Kit.xDigitToInt(c, escapeVal); -- if (escapeVal < 0) { -- continue strLoop; -- } -+ -+ case '\\': // backslash -+ case 'b': // backspace -+ case 'f': // form feed -+ case 'n': // line feed -+ case 'r': // carriage return -+ case 't': // horizontal tab -+ case 'v': // vertical tab -+ case 'd': // octal sequence -+ case 'u': // unicode sequence -+ case 'x': // hexadecimal sequence -+ // Only keep the '\' character for those -+ // characters that need to be escaped... -+ // Don't escape quoting characters... -+ addToString('\\'); - addToString(c); -- } -- // prepare for replace of stored 'u' sequence -- // by escape value -- stringBufferTop = escapeStart; -- c = escapeVal; -- break; -- case 'x': -- // Get 2 hex digits, defaulting to 'x'+literal -- // sequence, as above. -- c = getChar(); -- escapeVal = Kit.xDigitToInt(c, 0); -- if (escapeVal < 0) { -- addToString('x'); -- continue strLoop; -- } else { -- int c1 = c; -- c = getChar(); -- escapeVal = Kit.xDigitToInt(c, escapeVal); -- if (escapeVal < 0) { -- addToString('x'); -- addToString(c1); -- continue strLoop; -- } else { -- // got 2 hex digits -- c = escapeVal; -- } -- } -- break; -+ break; - -- case '\n': -- // Remove line terminator after escape to follow -- // SpiderMonkey and C/C++ -- c = getChar(); -- continue strLoop; -- -- default: -- if ('0' <= c && c < '8') { -- int val = c - '0'; -- c = getChar(); -- if ('0' <= c && c < '8') { -- val = 8 * val + c - '0'; -- c = getChar(); -- if ('0' <= c && c < '8' && val <= 037) { -- // c is 3rd char of octal sequence only -- // if the resulting val <= 0377 -- val = 8 * val + c - '0'; -- c = getChar(); -- } -+ case '\n': -+ // Remove line terminator after escape -+ break; -+ -+ default: -+ if (isDigit(c)) { -+ // Octal representation of a character. -+ // Preserve the escaping (see Y! bug #1637286) -+ addToString('\\'); - } -- ungetChar(c); -- c = val; -- } -+ addToString(c); -+ break; - } -+ -+ } else { -+ -+ addToString(c); - } -- addToString(c); -+ - c = getChar(); - } - -@@ -784,6 +742,7 @@ - // is it a /* or /** comment? - if (matchChar('*')) { - boolean lookForSlash = false; -+ StringBuffer sb = new StringBuffer(); - tokenBeg = cursor - 2; - if (matchChar('*')) { - lookForSlash = true; -@@ -797,12 +756,30 @@ - tokenEnd = cursor - 1; - parser.addError("msg.unterminated.comment"); - return Token.COMMENT; -- } else if (c == '*') { -+ } -+ sb.append((char) c); -+ if (c == '*') { - lookForSlash = true; - } else if (c == '/') { - if (lookForSlash) { - tokenEnd = cursor; -- return Token.COMMENT; -+ sb.delete(sb.length()-2, sb.length()); -+ String s1 = sb.toString(); -+ String s2 = s1.trim(); -+ if (s1.startsWith("!")) { -+ // Remove the leading '!' ** EDIT actually don't remove it: -+ // http://yuilibrary.com/projects/yuicompressor/ticket/2528008 -+ // this.string = s1.substring(1); -+ this.string = s1; -+ return Token.COMMENT; -+ } else if (s2.startsWith("@cc_on") || -+ s2.startsWith("@if") || -+ s2.startsWith("@elif") || -+ s2.startsWith("@else") || -+ s2.startsWith("@end")) { -+ this.string = s1; -+ return Token.COMMENT; -+ } - } - } else { - lookForSlash = false; Copied: tags/yui-compressor/2.4.6+rhino17R2-1/debian/patches/tokenstream.patch (from rev 13836, trunk/yui-compressor/debian/patches/tokenstream.patch) =================================================================== --- tags/yui-compressor/2.4.6+rhino17R2-1/debian/patches/tokenstream.patch (rev 0) +++ tags/yui-compressor/2.4.6+rhino17R2-1/debian/patches/tokenstream.patch 2011-07-04 21:34:43 UTC (rev 13838) @@ -0,0 +1,174 @@ +YUI patch for the Rhino library's TokenStream.java +=================================================================== +--- a/src/org/mozilla/javascript/TokenStream.java ++++ b/src/org/mozilla/javascript/TokenStream.java +@@ -526,7 +526,7 @@ + stringBufferTop = 0; + + c = getChar(); +- strLoop: while (c != quoteChar) { ++ while (c != quoteChar) { + if (c == '\n' || c == EOF_CHAR) { + ungetChar(c); + parser.addError("msg.unterminated.string.lit"); +@@ -535,89 +535,47 @@ + + if (c == '\\') { + // We've hit an escaped character +- int escapeVal; + + c = getChar(); ++ + switch (c) { +- case 'b': c = '\b'; break; +- case 'f': c = '\f'; break; +- case 'n': c = '\n'; break; +- case 'r': c = '\r'; break; +- case 't': c = '\t'; break; +- +- // \v a late addition to the ECMA spec, +- // it is not in Java, so use 0xb +- case 'v': c = 0xb; break; +- +- case 'u': +- // Get 4 hex digits; if the u escape is not +- // followed by 4 hex digits, use 'u' + the +- // literal character sequence that follows. +- int escapeStart = stringBufferTop; +- addToString('u'); +- escapeVal = 0; +- for (int i = 0; i != 4; ++i) { +- c = getChar(); +- escapeVal = Kit.xDigitToInt(c, escapeVal); +- if (escapeVal < 0) { +- continue strLoop; +- } ++ ++ case '\\': // backslash ++ case 'b': // backspace ++ case 'f': // form feed ++ case 'n': // line feed ++ case 'r': // carriage return ++ case 't': // horizontal tab ++ case 'v': // vertical tab ++ case 'd': // octal sequence ++ case 'u': // unicode sequence ++ case 'x': // hexadecimal sequence ++ // Only keep the '\' character for those ++ // characters that need to be escaped... ++ // Don't escape quoting characters... ++ addToString('\\'); + addToString(c); +- } +- // prepare for replace of stored 'u' sequence +- // by escape value +- stringBufferTop = escapeStart; +- c = escapeVal; +- break; +- case 'x': +- // Get 2 hex digits, defaulting to 'x'+literal +- // sequence, as above. +- c = getChar(); +- escapeVal = Kit.xDigitToInt(c, 0); +- if (escapeVal < 0) { +- addToString('x'); +- continue strLoop; +- } else { +- int c1 = c; +- c = getChar(); +- escapeVal = Kit.xDigitToInt(c, escapeVal); +- if (escapeVal < 0) { +- addToString('x'); +- addToString(c1); +- continue strLoop; +- } else { +- // got 2 hex digits +- c = escapeVal; +- } +- } +- break; ++ break; + +- case '\n': +- // Remove line terminator after escape to follow +- // SpiderMonkey and C/C++ +- c = getChar(); +- continue strLoop; +- +- default: +- if ('0' <= c && c < '8') { +- int val = c - '0'; +- c = getChar(); +- if ('0' <= c && c < '8') { +- val = 8 * val + c - '0'; +- c = getChar(); +- if ('0' <= c && c < '8' && val <= 037) { +- // c is 3rd char of octal sequence only +- // if the resulting val <= 0377 +- val = 8 * val + c - '0'; +- c = getChar(); +- } ++ case '\n': ++ // Remove line terminator after escape ++ break; ++ ++ default: ++ if (isDigit(c)) { ++ // Octal representation of a character. ++ // Preserve the escaping (see Y! bug #1637286) ++ addToString('\\'); + } +- ungetChar(c); +- c = val; +- } ++ addToString(c); ++ break; + } ++ ++ } else { ++ ++ addToString(c); + } +- addToString(c); ++ + c = getChar(); + } + +@@ -760,16 +718,35 @@ + } + if (matchChar('*')) { + boolean lookForSlash = false; ++ StringBuffer sb = new StringBuffer(); + for (;;) { + c = getChar(); + if (c == EOF_CHAR) { + parser.addError("msg.unterminated.comment"); + return Token.ERROR; +- } else if (c == '*') { ++ } ++ sb.append((char) c); ++ if (c == '*') { + lookForSlash = true; + } else if (c == '/') { + if (lookForSlash) { +- continue retry; ++ sb.delete(sb.length()-2, sb.length()); ++ String s1 = sb.toString(); ++ String s2 = s1.trim(); ++ if (s1.startsWith("!")) { ++ // Remove the leading '!' ++ this.string = s1.substring(1); ++ return Token.KEEPCOMMENT; ++ } else if (s2.startsWith("@cc_on") || ++ s2.startsWith("@if") || ++ s2.startsWith("@elif") || ++ s2.startsWith("@else") || ++ s2.startsWith("@end")) { ++ this.string = s1; ++ return Token.CONDCOMMENT; ++ } else { ++ continue retry; ++ } + } + } else { + lookForSlash = false; Deleted: tags/yui-compressor/2.4.6+rhino17R2-1/debian/patches/use-system-libraries.patch =================================================================== --- trunk/yui-compressor/debian/patches/use-system-libraries.patch 2011-07-02 05:20:23 UTC (rev 13829) +++ tags/yui-compressor/2.4.6+rhino17R2-1/debian/patches/use-system-libraries.patch 2011-07-04 21:34:43 UTC (rev 13838) @@ -1,38 +0,0 @@ -Description: - - use Debian's jargs ard rhino libraries during build - - don't embed jargs inside yui-compressor jar -Author: Michael Gilbert <[email protected]> -Author: Damien Raude-Morvan <[email protected]> -Last-Update: 2010-01-17 ---- a/build.xml -+++ b/build.xml -@@ -20,10 +20,10 @@ - includes="**/*.java" - deprecation="off" - debug="on" -- source="1.4"> -+ source="1.5"> - <classpath> -- <pathelement location="${lib.dir}/jargs-1.0.jar"/> -- <pathelement location="${lib.dir}/rhino-1.6R7.jar"/> -+ <pathelement location="/usr/share/java/jargs.jar"/> -+ <pathelement location="/usr/share/java/js.jar"/> - </classpath> - </javac> - </target> -@@ -32,13 +32,13 @@ - <mkdir dir="${build.dir}/jar"/> - <!-- The order is important here. Rhino MUST be unjarred first! - (some of our own classes will override the Rhino classes) --> -- <unjar src="${lib.dir}/jargs-1.0.jar" dest="${build.dir}/jar"/> -- <unjar src="${lib.dir}/rhino-1.6R7.jar" dest="${build.dir}/jar"/> -+ <unjar src="/usr/share/java/js.jar" dest="${build.dir}/jar"/> - <copy todir="${build.dir}/jar"> - <fileset dir="${build.dir}/classes" includes="**/*.class"/> - </copy> - <jar destfile="${build.dir}/${jar.name}" basedir="${build.dir}/jar"> - <manifest> -+ <attribute name="Class-Path" value="/usr/share/java/jargs.jar"/> - <attribute name="Main-Class" value="com.yahoo.platform.yui.compressor.Bootstrap"/> - </manifest> - </jar> Copied: tags/yui-compressor/2.4.6+rhino17R2-1/debian/patches/use-system-libraries.patch (from rev 13837, trunk/yui-compressor/debian/patches/use-system-libraries.patch) =================================================================== --- tags/yui-compressor/2.4.6+rhino17R2-1/debian/patches/use-system-libraries.patch (rev 0) +++ tags/yui-compressor/2.4.6+rhino17R2-1/debian/patches/use-system-libraries.patch 2011-07-04 21:34:43 UTC (rev 13838) @@ -0,0 +1,36 @@ +Description: + - use Debian's jargs ard rhino libraries during build + - don't embed jargs inside yui-compressor jar +Author: Michael Gilbert <[email protected]> +Author: Damien Raude-Morvan <[email protected]> +Last-Update: 2010-01-17 +--- a/build.xml ++++ b/build.xml +@@ -20,10 +20,9 @@ + includes="**/*.java" + deprecation="off" + debug="on" +- source="1.4"> ++ source="1.5"> + <classpath> +- <pathelement location="${lib.dir}/jargs-1.0.jar"/> +- <pathelement location="${lib.dir}/rhino-1.6R7.jar"/> ++ <pathelement location="/usr/share/java/jargs.jar"/> + </classpath> + </javac> + </target> +@@ -32,13 +31,12 @@ + <mkdir dir="${build.dir}/jar"/> + <!-- The order is important here. Rhino MUST be unjarred first! + (some of our own classes will override the Rhino classes) --> +- <unjar src="${lib.dir}/jargs-1.0.jar" dest="${build.dir}/jar"/> +- <unjar src="${lib.dir}/rhino-1.6R7.jar" dest="${build.dir}/jar"/> + <copy todir="${build.dir}/jar"> + <fileset dir="${build.dir}/classes" includes="**/*.class"/> + </copy> + <jar destfile="${build.dir}/${jar.name}" basedir="${build.dir}/jar"> + <manifest> ++ <attribute name="Class-Path" value="/usr/share/java/jargs.jar"/> + <attribute name="Main-Class" value="com.yahoo.platform.yui.compressor.Bootstrap"/> + </manifest> + </jar> Deleted: tags/yui-compressor/2.4.6+rhino17R2-1/debian/rules =================================================================== --- trunk/yui-compressor/debian/rules 2011-07-02 05:20:23 UTC (rev 13829) +++ tags/yui-compressor/2.4.6+rhino17R2-1/debian/rules 2011-07-04 21:34:43 UTC (rev 13838) @@ -1,25 +0,0 @@ -#!/usr/bin/make -f - -include /usr/share/cdbs/1/rules/debhelper.mk -include /usr/share/cdbs/1/class/ant.mk - -DEB_COMPRESS_EXCLUDE := .class -JAVA_HOME := /usr/lib/jvm/default-java - -DEB_JARS := js jargs -DEB_ANT_BUILD_TARGET := build.jar -DEB_CLEAN_BUILD_TARGET := clean -DEB_DH_INSTALLCHANGELOGS_ARGS := doc/CHANGELOG - -LIBRARY=yui-compressor -VERSION=2.4.6 -RHINO_VERSION=1.7R3-2 - -install/yui-compressor:: - # Launch tests - (cd tests; bash ./suite.sh) - # Rename JAR file - cp build/yuicompressor-${VERSION}.jar build/yui-compressor.jar - -get-orig-source: - debian/fetch-upstream ${VERSION} ${DEB_UPSTREAM_VERSION} ${RHINO_VERSION} Copied: tags/yui-compressor/2.4.6+rhino17R2-1/debian/rules (from rev 13836, trunk/yui-compressor/debian/rules) =================================================================== --- tags/yui-compressor/2.4.6+rhino17R2-1/debian/rules (rev 0) +++ tags/yui-compressor/2.4.6+rhino17R2-1/debian/rules 2011-07-04 21:34:43 UTC (rev 13838) @@ -0,0 +1,25 @@ +#!/usr/bin/make -f + +include /usr/share/cdbs/1/rules/debhelper.mk +include /usr/share/cdbs/1/class/ant.mk + +DEB_COMPRESS_EXCLUDE := .class +JAVA_HOME := /usr/lib/jvm/default-java + +DEB_JARS := js jargs +DEB_ANT_BUILD_TARGET := build.jar +DEB_CLEAN_BUILD_TARGET := clean +DEB_DH_INSTALLCHANGELOGS_ARGS := doc/CHANGELOG + +LIBRARY=yui-compressor +VERSION=2.4.6 +RHINO_VERSION=1.7R2-4 + +install/yui-compressor:: + # Launch tests + (cd tests; bash ./suite.sh) + # Rename JAR file + cp build/yuicompressor-${VERSION}.jar build/yui-compressor.jar + +get-orig-source: + debian/fetch-upstream ${VERSION} ${DEB_UPSTREAM_VERSION} ${RHINO_VERSION} _______________________________________________ pkg-java-commits mailing list [email protected] http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-java-commits

