[rhino] 08/09: Fixed a bug in Context.getImplementationVersion() when the project is built with Ant

Emmanuel Bourg ebourg-guest at moszumanska.debian.org
Fri Jan 20 10:09:26 UTC 2017


This is an automated email from the git hooks/post-receive script.

ebourg-guest pushed a commit to branch master
in repository rhino.

commit 82fda87f7251ddfb592209e3b8d097a412fb42d0
Author: Emmanuel Bourg <ebourg at apache.org>
Date:   Fri Jan 20 11:03:10 2017 +0100

    Fixed a bug in Context.getImplementationVersion() when the project is built with Ant
---
 debian/changelog                                       |  2 ++
 .../07_fix-context-implementation-version.patch        | 18 ++++++++++++++++++
 debian/patches/series                                  |  1 +
 3 files changed, 21 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index a658fdd..313207e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -10,6 +10,8 @@ rhino (1.7.7.1-1) UNRELEASED; urgency=medium
       and relocate the old coordinates rhino:js to org.mozilla:rhino
     - Reintroduced some removed classes and methods to preserve the backward
       compatibility and fix build failures in reverse dependencies.
+    - Fixed a bug in Context.getImplementationVersion() when the project
+      is built with Ant
   * Removed the transitional package rhino-doc
   * Updated the man pages (Closes: #792243)
   * Build with the DH sequencer instead of CDBS
diff --git a/debian/patches/07_fix-context-implementation-version.patch b/debian/patches/07_fix-context-implementation-version.patch
new file mode 100644
index 0000000..8050ad8
--- /dev/null
+++ b/debian/patches/07_fix-context-implementation-version.patch
@@ -0,0 +1,18 @@
+Description: Fixes the logic to extract the implementation version from the manifest
+ (only when the project is built with Ant, with Gradle the manifest is ok).
+Author: Emmanuel Bourg <ebourg at apache.org>
+Forwarded: https://github.com/mozilla/rhino/commit/f575445cbe5e245#commitcomment-20551124
+--- a/src/org/mozilla/javascript/Context.java
++++ b/src/org/mozilla/javascript/Context.java
+@@ -704,9 +704,9 @@
+                     is = metaUrl.openStream();
+                     Manifest mf = new Manifest(is);
+                     Attributes attrs = mf.getMainAttributes();
+-                    if ("Mozilla Rhino".equals(attrs.getValue("Implementation-Title"))) {
++                    if (attrs.getValue("Implementation-Title") != null && attrs.getValue("Implementation-Title").startsWith("Mozilla Rhino")) {
+                         implementationVersion =
+-                            "Rhino " + attrs.getValue("Implementation-Version") + " " + attrs.getValue("Built-Date").replaceAll("-", " ");
++                            "Rhino " + attrs.getValue("Implementation-Version");
+                         return implementationVersion;
+                     }
+                 } catch (IOException e) {
diff --git a/debian/patches/series b/debian/patches/series
index 49135c5..265070d 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
 03_public_getSourcePositionFromStack.patch
 05_modify-usage.patch
 06_preserve-backward-compatibility.patch
+07_fix-context-implementation-version.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/rhino.git



More information about the pkg-java-commits mailing list