/hg/release/icedtea6-1.11: Fix patches to work with patch tools ...
omajid at icedtea.classpath.org
omajid at icedtea.classpath.org
Wed Jun 26 07:49:10 PDT 2013
changeset c5297dd496da in /hg/release/icedtea6-1.11
details: http://icedtea.classpath.org/hg/release/icedtea6-1.11?cmd=changeset;node=c5297dd496da
author: Omair Majid <omajid at redhat.com>
date: Wed Jun 26 10:47:13 2013 -0400
Fix patches to work with patch tools that can not handle renames
2013-06-26 Omair Majid <omajid at redhat.com>
* Makefile.am:
(SECURITY_PATCHES): Add patches/openjdk/6990754-handle_renames.patch and
patches/openjdk/6851834-handle_renames.patch
* patches/openjdk/6990754-use_native_memory_for_symboltable.patch: Don't
rename files using extended-diff-style.
* patches/openjdk/6990754-handle_renames.patch: New file. Contains the
rename portion of 6990754 since some patch programs can not handle
renames.
* patches/openjdk/6851834-restructure.patch: Don't rename files using
extended-diff-style.
* patches/openjdk/6851834-handle_renames.patch: New file. Contains rename
porition of 6851834 since some patch programs can not handle renames.
diffstat:
ChangeLog | 15 +
Makefile.am | 2 +
patches/openjdk/6851834-handle_renames.patch | 605 ++++++
patches/openjdk/6851834-restructure.patch | 6 +-
patches/openjdk/6990754-handle_renames.patch | 925 ++++++++++
patches/openjdk/6990754-use_native_memory_for_symboltable.patch | 6 +-
6 files changed, 1555 insertions(+), 4 deletions(-)
diffs (truncated from 1625 to 500 lines):
diff -r f352f5c79104 -r c5297dd496da ChangeLog
--- a/ChangeLog Tue Jun 25 15:07:59 2013 +0100
+++ b/ChangeLog Wed Jun 26 10:47:13 2013 -0400
@@ -1,3 +1,18 @@
+2013-06-26 Omair Majid <omajid at redhat.com>
+
+ * Makefile.am:
+ (SECURITY_PATCHES): Add patches/openjdk/6990754-handle_renames.patch and
+ patches/openjdk/6851834-handle_renames.patch
+ * patches/openjdk/6990754-use_native_memory_for_symboltable.patch: Don't
+ rename files using extended-diff-style.
+ * patches/openjdk/6990754-handle_renames.patch: New file. Contains the
+ rename portion of 6990754 since some patch programs can not handle
+ renames.
+ * patches/openjdk/6851834-restructure.patch: Don't rename files using
+ extended-diff-style.
+ * patches/openjdk/6851834-handle_renames.patch: New file. Contains rename
+ porition of 6851834 since some patch programs can not handle renames.
+
2013-06-24 Andrew John Hughes <gnu.andrew at redhat.com>
* Makefile.am:
diff -r f352f5c79104 -r c5297dd496da Makefile.am
--- a/Makefile.am Tue Jun 25 15:07:59 2013 +0100
+++ b/Makefile.am Wed Jun 26 10:47:13 2013 -0400
@@ -383,6 +383,7 @@
patches/openjdk/7036747-elfstringtable.patch \
patches/openjdk/7017732-move_static_fields_to_class.patch \
patches/openjdk/6990754-use_native_memory_for_symboltable.patch \
+ patches/openjdk/6990754-handle_renames.patch \
patches/openjdk/7008809-report_class_in_arraystoreexception.patch \
patches/openjdk/7086585-flexible_field_injection.patch \
patches/security/20130618/hs_merge-01.patch \
@@ -398,6 +399,7 @@
patches/openjdk/6786688-wcag_table.patch \
patches/openjdk/6961178-doclet_xml.patch \
patches/openjdk/6851834-restructure.patch \
+ patches/openjdk/6851834-handle_renames.patch \
patches/openjdk/7006270-regressions.patch \
patches/security/20130618/8012375-javadoc_framing.patch \
patches/security/20130618/8015997-more_javadoc_framing.patch \
diff -r f352f5c79104 -r c5297dd496da patches/openjdk/6851834-handle_renames.patch
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/openjdk/6851834-handle_renames.patch Wed Jun 26 10:47:13 2013 -0400
@@ -0,0 +1,605 @@
+This handles the rename bits of the original 6851834
+diff -ruN openjdk.orig/langtools/src/share/classes/com/sun/tools/doclets/formats/html/SourceToHTMLConverter.java openjdk/langtools/src/share/classes/com/sun/tools/doclets/formats/html/SourceToHTMLConverter.java
+--- openjdk.orig/langtools/src/share/classes/com/sun/tools/doclets/formats/html/SourceToHTMLConverter.java 1969-12-31 19:00:00.000000000 -0500
++++ openjdk/langtools/src/share/classes/com/sun/tools/doclets/formats/html/SourceToHTMLConverter.java 2013-06-25 14:55:45.802321034 -0400
+@@ -0,0 +1,298 @@
++/*
++ * Copyright (c) 2001, 2006, Oracle and/or its affiliates. All rights reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation. Oracle designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Oracle in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
++ * or visit www.oracle.com if you need additional information or have any
++ * questions.
++ */
++
++package com.sun.tools.doclets.formats.html;
++
++import java.io.*;
++import javax.tools.FileObject;
++import com.sun.javadoc.*;
++import com.sun.tools.doclets.internal.toolkit.*;
++import com.sun.tools.doclets.internal.toolkit.util.*;
++import com.sun.tools.doclets.formats.html.markup.*;
++
++/**
++ * Converts Java Source Code to HTML.
++ *
++ * This code is not part of an API.
++ * It is implementation that is subject to change.
++ * Do not use it as an API
++ *
++ * @author Jamie Ho
++ * @author Bhavesh Patel (Modified)
++ * @since 1.4
++ */
++public class SourceToHTMLConverter {
++
++ /**
++ * The number of trailing blank lines at the end of the page.
++ * This is inserted so that anchors at the bottom of small pages
++ * can be reached.
++ */
++ private static final int NUM_BLANK_LINES = 60;
++
++ /**
++ * New line to be added to the documentation.
++ */
++ private static final Content NEW_LINE = new RawHtml(DocletConstants.NL);
++
++ /**
++ * Relative path from the documentation root to the file that is being
++ * generated.
++ */
++ private static String relativePath = "";
++
++ /**
++ * Source is converted to HTML using static methods below.
++ */
++ private SourceToHTMLConverter() {}
++
++ /**
++ * Convert the Classes in the given RootDoc to an HTML.
++ *
++ * @param configuration the configuration.
++ * @param rd the RootDoc to convert.
++ * @param outputdir the name of the directory to output to.
++ */
++ public static void convertRoot(ConfigurationImpl configuration, RootDoc rd,
++ String outputdir) {
++ if (rd == null || outputdir == null) {
++ return;
++ }
++ PackageDoc[] pds = rd.specifiedPackages();
++ for (int i = 0; i < pds.length; i++) {
++ convertPackage(configuration, pds[i], outputdir);
++ }
++ ClassDoc[] cds = rd.specifiedClasses();
++ for (int i = 0; i < cds.length; i++) {
++ convertClass(configuration, cds[i],
++ getPackageOutputDir(outputdir, cds[i].containingPackage()));
++ }
++ }
++
++ /**
++ * Convert the Classes in the given Package to an HTML.
++ *
++ * @param configuration the configuration.
++ * @param pd the Package to convert.
++ * @param outputdir the name of the directory to output to.
++ */
++ public static void convertPackage(ConfigurationImpl configuration, PackageDoc pd,
++ String outputdir) {
++ if (pd == null || outputdir == null) {
++ return;
++ }
++ String classOutputdir = getPackageOutputDir(outputdir, pd);
++ ClassDoc[] cds = pd.allClasses();
++ for (int i = 0; i < cds.length; i++) {
++ convertClass(configuration, cds[i], classOutputdir);
++ }
++ }
++
++ /**
++ * Return the directory write output to for the given package.
++ *
++ * @param outputDir the directory to output to.
++ * @param pd the Package to generate output for.
++ * @return the package output directory as a String.
++ */
++ private static String getPackageOutputDir(String outputDir, PackageDoc pd) {
++ return outputDir + File.separator +
++ DirectoryManager.getDirectoryPath(pd) + File.separator;
++ }
++
++ /**
++ * Convert the given Class to an HTML.
++ *
++ * @param configuration the configuration.
++ * @param cd the class to convert.
++ * @param outputdir the name of the directory to output to.
++ */
++ public static void convertClass(ConfigurationImpl configuration, ClassDoc cd,
++ String outputdir) {
++ if (cd == null || outputdir == null) {
++ return;
++ }
++ try {
++ SourcePosition sp = cd.position();
++ if (sp == null)
++ return;
++ Reader r;
++ // temp hack until we can update SourcePosition API.
++ if (sp instanceof com.sun.tools.javadoc.SourcePositionImpl) {
++ FileObject fo = ((com.sun.tools.javadoc.SourcePositionImpl) sp).fileObject();
++ if (fo == null)
++ return;
++ r = fo.openReader(true);
++ } else {
++ File file = sp.file();
++ if (file == null)
++ return;
++ r = new FileReader(file);
++ }
++ LineNumberReader reader = new LineNumberReader(r);
++ int lineno = 1;
++ String line;
++ relativePath = DirectoryManager.getRelativePath(DocletConstants.SOURCE_OUTPUT_DIR_NAME) +
++ DirectoryManager.getRelativePath(cd.containingPackage());
++ Content body = getHeader();
++ Content pre = new HtmlTree(HtmlTag.PRE);
++ try {
++ while ((line = reader.readLine()) != null) {
++ addLineNo(pre, lineno);
++ addLine(pre, line, configuration.sourcetab, lineno);
++ lineno++;
++ }
++ } finally {
++ reader.close();
++ }
++ addBlankLines(pre);
++ Content div = HtmlTree.DIV(HtmlStyle.sourceContainer, pre);
++ body.addContent(div);
++ writeToFile(body, outputdir, cd.name(), configuration);
++ } catch (Exception e){
++ e.printStackTrace();
++ }
++ }
++
++ /**
++ * Write the output to the file.
++ *
++ * @param body the documentation content to be written to the file.
++ * @param outputDir the directory to output to.
++ * @param className the name of the class that I am converting to HTML.
++ * @param configuration the Doclet configuration to pass notices to.
++ */
++ private static void writeToFile(Content body, String outputDir,
++ String className, ConfigurationImpl configuration) throws IOException {
++ Content htmlDocType = DocType.Transitional();
++ Content head = new HtmlTree(HtmlTag.HEAD);
++ head.addContent(HtmlTree.TITLE(new StringContent(
++ configuration.getText("doclet.Window_Source_title"))));
++ head.addContent(getStyleSheetProperties(configuration));
++ Content htmlTree = HtmlTree.HTML(configuration.getLocale().getLanguage(),
++ head, body);
++ Content htmlDocument = new HtmlDocument(htmlDocType, htmlTree);
++ File dir = new File(outputDir);
++ dir.mkdirs();
++ File newFile = new File(dir, className + ".html");
++ configuration.message.notice("doclet.Generating_0", newFile.getPath());
++ FileOutputStream fout = new FileOutputStream(newFile);
++ BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(fout));
++ bw.write(htmlDocument.toString());
++ bw.close();
++ fout.close();
++ }
++
++ /**
++ * Returns a link to the stylesheet file.
++ *
++ * @param configuration the doclet configuration for the current run of javadoc
++ * @return an HtmlTree for the lINK tag which provides the stylesheet location
++ */
++ public static HtmlTree getStyleSheetProperties(ConfigurationImpl configuration) {
++ String filename = configuration.stylesheetfile;
++ if (filename.length() > 0) {
++ File stylefile = new File(filename);
++ String parent = stylefile.getParent();
++ filename = (parent == null)?
++ filename:
++ filename.substring(parent.length() + 1);
++ } else {
++ filename = "stylesheet.css";
++ }
++ filename = relativePath + filename;
++ HtmlTree link = HtmlTree.LINK("stylesheet", "text/css", filename, "Style");
++ return link;
++ }
++
++ /**
++ * Get the header.
++ *
++ * @return the header content for the HTML file
++ */
++ private static Content getHeader() {
++ return new HtmlTree(HtmlTag.BODY);
++ }
++
++ /**
++ * Add the line numbers for the source code.
++ *
++ * @param pre the content tree to which the line number will be added
++ * @param lineno The line number
++ */
++ private static void addLineNo(Content pre, int lineno) {
++ HtmlTree span = new HtmlTree(HtmlTag.SPAN);
++ span.addStyle(HtmlStyle.sourceLineNo);
++ if (lineno < 10) {
++ span.addContent("00" + Integer.toString(lineno));
++ } else if (lineno < 100) {
++ span.addContent("0" + Integer.toString(lineno));
++ } else {
++ span.addContent(Integer.toString(lineno));
++ }
++ pre.addContent(span);
++ }
++
++ /**
++ * Add a line from source to the HTML file that is generated.
++ *
++ * @param pre the content tree to which the line will be added.
++ * @param line the string to format.
++ * @param tabLength the number of spaces for each tab.
++ * @param currentLineNo the current number.
++ */
++ private static void addLine(Content pre, String line, int tabLength,
++ int currentLineNo) {
++ if (line != null) {
++ StringBuffer lineBuffer = new StringBuffer(Util.escapeHtmlChars(line));
++ Util.replaceTabs(tabLength, lineBuffer);
++ pre.addContent(new RawHtml(lineBuffer.toString()));
++ Content anchor = HtmlTree.A_NAME("line." + Integer.toString(currentLineNo));
++ pre.addContent(anchor);
++ pre.addContent(NEW_LINE);
++ }
++ }
++
++ /**
++ * Add trailing blank lines at the end of the page.
++ *
++ * @param pre the content tree to which the blank lines will be added.
++ */
++ private static void addBlankLines(Content pre) {
++ for (int i = 0; i < NUM_BLANK_LINES; i++) {
++ pre.addContent(NEW_LINE);
++ }
++ }
++
++ /**
++ * Given a <code>Doc</code>, return an anchor name for it.
++ *
++ * @param d the <code>Doc</code> to check.
++ * @return the name of the anchor.
++ */
++ public static String getAnchorName(Doc d) {
++ return "line." + d.position().line();
++ }
++}
+diff -ruN openjdk.orig/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/SourceToHTMLConverter.java openjdk/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/SourceToHTMLConverter.java
+--- openjdk.orig/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/SourceToHTMLConverter.java 2013-06-25 14:55:45.802321034 -0400
++++ openjdk/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/SourceToHTMLConverter.java 1969-12-31 19:00:00.000000000 -0500
+@@ -1,298 +0,0 @@
+-/*
+- * Copyright (c) 2001, 2006, Oracle and/or its affiliates. All rights reserved.
+- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+- *
+- * This code is free software; you can redistribute it and/or modify it
+- * under the terms of the GNU General Public License version 2 only, as
+- * published by the Free Software Foundation. Oracle designates this
+- * particular file as subject to the "Classpath" exception as provided
+- * by Oracle in the LICENSE file that accompanied this code.
+- *
+- * This code is distributed in the hope that it will be useful, but WITHOUT
+- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+- * version 2 for more details (a copy is included in the LICENSE file that
+- * accompanied this code).
+- *
+- * You should have received a copy of the GNU General Public License version
+- * 2 along with this work; if not, write to the Free Software Foundation,
+- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+- *
+- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+- * or visit www.oracle.com if you need additional information or have any
+- * questions.
+- */
+-
+-package com.sun.tools.doclets.formats.html;
+-
+-import java.io.*;
+-import javax.tools.FileObject;
+-import com.sun.javadoc.*;
+-import com.sun.tools.doclets.internal.toolkit.*;
+-import com.sun.tools.doclets.internal.toolkit.util.*;
+-import com.sun.tools.doclets.formats.html.markup.*;
+-
+-/**
+- * Converts Java Source Code to HTML.
+- *
+- * This code is not part of an API.
+- * It is implementation that is subject to change.
+- * Do not use it as an API
+- *
+- * @author Jamie Ho
+- * @author Bhavesh Patel (Modified)
+- * @since 1.4
+- */
+-public class SourceToHTMLConverter {
+-
+- /**
+- * The number of trailing blank lines at the end of the page.
+- * This is inserted so that anchors at the bottom of small pages
+- * can be reached.
+- */
+- private static final int NUM_BLANK_LINES = 60;
+-
+- /**
+- * New line to be added to the documentation.
+- */
+- private static final Content NEW_LINE = new RawHtml(DocletConstants.NL);
+-
+- /**
+- * Relative path from the documentation root to the file that is being
+- * generated.
+- */
+- private static String relativePath = "";
+-
+- /**
+- * Source is converted to HTML using static methods below.
+- */
+- private SourceToHTMLConverter() {}
+-
+- /**
+- * Convert the Classes in the given RootDoc to an HTML.
+- *
+- * @param configuration the configuration.
+- * @param rd the RootDoc to convert.
+- * @param outputdir the name of the directory to output to.
+- */
+- public static void convertRoot(ConfigurationImpl configuration, RootDoc rd,
+- String outputdir) {
+- if (rd == null || outputdir == null) {
+- return;
+- }
+- PackageDoc[] pds = rd.specifiedPackages();
+- for (int i = 0; i < pds.length; i++) {
+- convertPackage(configuration, pds[i], outputdir);
+- }
+- ClassDoc[] cds = rd.specifiedClasses();
+- for (int i = 0; i < cds.length; i++) {
+- convertClass(configuration, cds[i],
+- getPackageOutputDir(outputdir, cds[i].containingPackage()));
+- }
+- }
+-
+- /**
+- * Convert the Classes in the given Package to an HTML.
+- *
+- * @param configuration the configuration.
+- * @param pd the Package to convert.
+- * @param outputdir the name of the directory to output to.
+- */
+- public static void convertPackage(ConfigurationImpl configuration, PackageDoc pd,
+- String outputdir) {
+- if (pd == null || outputdir == null) {
+- return;
+- }
+- String classOutputdir = getPackageOutputDir(outputdir, pd);
+- ClassDoc[] cds = pd.allClasses();
+- for (int i = 0; i < cds.length; i++) {
+- convertClass(configuration, cds[i], classOutputdir);
+- }
+- }
+-
+- /**
+- * Return the directory write output to for the given package.
+- *
+- * @param outputDir the directory to output to.
+- * @param pd the Package to generate output for.
+- * @return the package output directory as a String.
+- */
+- private static String getPackageOutputDir(String outputDir, PackageDoc pd) {
+- return outputDir + File.separator +
+- DirectoryManager.getDirectoryPath(pd) + File.separator;
+- }
+-
+- /**
+- * Convert the given Class to an HTML.
+- *
+- * @param configuration the configuration.
+- * @param cd the class to convert.
+- * @param outputdir the name of the directory to output to.
+- */
+- public static void convertClass(ConfigurationImpl configuration, ClassDoc cd,
+- String outputdir) {
+- if (cd == null || outputdir == null) {
+- return;
+- }
+- try {
+- SourcePosition sp = cd.position();
+- if (sp == null)
+- return;
+- Reader r;
+- // temp hack until we can update SourcePosition API.
+- if (sp instanceof com.sun.tools.javadoc.SourcePositionImpl) {
+- FileObject fo = ((com.sun.tools.javadoc.SourcePositionImpl) sp).fileObject();
+- if (fo == null)
+- return;
+- r = fo.openReader(true);
+- } else {
More information about the distro-pkg-dev
mailing list