diff options
author | Petteri Räty <betelgeuse@gentoo.org> | 2009-03-15 12:18:37 +0000 |
---|---|---|
committer | Petteri Räty <betelgeuse@gentoo.org> | 2009-03-15 12:18:37 +0000 |
commit | 39dcbdec23765eb7c255dfe0620c19c1830f2c91 (patch) | |
tree | 16b5a383cd23ba04280b9b57e3b9df99922723f5 /dev-java/ant-core | |
parent | Bump to 0.0.6. (diff) | |
download | historical-39dcbdec23765eb7c255dfe0620c19c1830f2c91.tar.gz historical-39dcbdec23765eb7c255dfe0620c19c1830f2c91.tar.bz2 historical-39dcbdec23765eb7c255dfe0620c19c1830f2c91.zip |
Add patch from trunk for an issue with pkg-info files. Fixes bug #262511. Thanks to John W Eckhart <jweckhart@gmail.com> for reporting.
Package-Manager: portage-2.2_rc25/cvs/Linux i686
Diffstat (limited to 'dev-java/ant-core')
-rw-r--r-- | dev-java/ant-core/ChangeLog | 9 | ||||
-rw-r--r-- | dev-java/ant-core/Manifest | 14 | ||||
-rw-r--r-- | dev-java/ant-core/ant-core-1.7.1-r3.ebuild | 104 | ||||
-rw-r--r-- | dev-java/ant-core/files/1.7.1-pkg-info.patch | 244 |
4 files changed, 369 insertions, 2 deletions
diff --git a/dev-java/ant-core/ChangeLog b/dev-java/ant-core/ChangeLog index 86e205e96a92..0025cf60c3e5 100644 --- a/dev-java/ant-core/ChangeLog +++ b/dev-java/ant-core/ChangeLog @@ -1,11 +1,18 @@ # ChangeLog for dev-java/ant-core # Copyright 2002-2009 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/dev-java/ant-core/ChangeLog,v 1.91 2009/01/07 15:05:15 ranger Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-java/ant-core/ChangeLog,v 1.92 2009/03/15 12:18:36 betelgeuse Exp $ # Ant-core blocks lower/older versions of ant-tasks, # since it will not run when there is a version mismatch betwean the 2 packages # Please unemerge ant-tasks when updating ant-core. +*ant-core-1.7.1-r3 (15 Mar 2009) + + 15 Mar 2009; Petteri Räty <betelgeuse@gentoo.org> + +files/1.7.1-pkg-info.patch, +ant-core-1.7.1-r3.ebuild: + Add patch from trunk for an issue with pkg-info files. Fixes bug #262511. + Thanks to John W Eckhart <jweckhart@gmail.com> for reporting. + 07 Jan 2009; Brent Baude <ranger@gentoo.org> ant-core-1.7.1-r2.ebuild: Marking ant-core-1.7.1-r2 ppc64 for bug 252819 diff --git a/dev-java/ant-core/Manifest b/dev-java/ant-core/Manifest index b6af9bb3db1e..0526cc99d995 100644 --- a/dev-java/ant-core/Manifest +++ b/dev-java/ant-core/Manifest @@ -1,6 +1,10 @@ +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA1 + AUX 1.7.0-ant 5996 RMD160 d523fc2f9cef31e77980de4d367265e205856a0e SHA1 356bc5bfe466969d292b3b6fae4b3f4d97239945 SHA256 d90dac639da2564d16b11f02dad6327bce40082ca00d671c77826a4cda6a1537 AUX 1.7.1-ant 5996 RMD160 131664c910a23f3ee4136fb60733eef699e0b6aa SHA1 0adeb2f78824eac0c5bca84446f4853f2be1f42e SHA256 3a162dfb297eadaa30feed4b130819b5acd50aec00417a9129d1e856cf844bfb AUX 1.7.1-ant-r1 6239 RMD160 f942c93807c332ad348a3e7d4c234940f3e02c5a SHA1 5b1c278727f06a0a7f5a17cf33b832890f388e0e SHA256 b356287d56db9c72e39ccb9785bfaf8db06b67a601c939db7f48014428ccea4d +AUX 1.7.1-pkg-info.patch 10193 RMD160 c0f1d9682b3fdd7b18dd2cd0e1e1a246bc569ba8 SHA1 87f158f661654c8e374e55604cdadc9a6d61799a SHA256 3e2171dd478410ce36700075c94939f582d64a442979d766db23e596317649ec AUX ant-core-1.7.0-services.patch 792 RMD160 d9d5e69860428301f3e27475835781938f1abb14 SHA1 c7502fa3e1481a68d3b8533d4673fce5831fd225 SHA256 fa45cd934948dd3b2df5cd56fba3be54eb54d8476b9a2bc3289fd2fe28a1f357 DIST ant-1.7.0-gentoo.tar.bz2 11720 RMD160 51d24f2c0c98195ed6ef1852045201a567a5d9ea SHA1 41acb8398a5ac9713dec30d6305b5abc6c014fff SHA256 7b1e0c63bec193c010c3fcca7a3524e2e35cc4ca56b86e4571737ac1e169e35c DIST ant-1.7.1-gentoo.tar.bz2 11836 RMD160 9194996b5b04113d2a6542221890e1ef3f7953d0 SHA1 ef848268ec2b7ecd9aca2f8a3d6705ec8386a621 SHA256 4bacd711cc4981272b8377335dafcb8841dd1fac177c0c349f3faf78b0354fe5 @@ -11,5 +15,13 @@ EBUILD ant-core-1.7.0-r2.ebuild 2647 RMD160 91738c8636b2c3f78792eac2f2837fc7308d EBUILD ant-core-1.7.0.ebuild 2552 RMD160 418c8d927107524c849e1d0ff12861448ef77309 SHA1 2f8509ec164c3d70d9bd5482dbdc2c7038ea9f24 SHA256 607185bb6d56d749d32b38dc740db00f498bafe04656127a582d329304995e4a EBUILD ant-core-1.7.1-r1.ebuild 2784 RMD160 27a9ffe314536c812577b73312178df543ec0a9f SHA1 5076398f0441cfd93ef00a105037954c06f1212b SHA256 8633fd7d974677e923b062e23a36fab61a7d30acdbaf7783dd13b51279da3319 EBUILD ant-core-1.7.1-r2.ebuild 2813 RMD160 b8985f4e847b8ea55b006b376775795604159231 SHA1 b63d7ad4746a2e1ce63845a6e8c3693a60f1cd72 SHA256 9d71fbb261df38216c2bd7a91ab37ce6caba77e9eaa1ee248e92efc74ace7176 -MISC ChangeLog 26942 RMD160 7a37b8b18858d2d484c7d22d2d294ab178f38da9 SHA1 c6d02cd2051c0b92403a75129a7874ca602f251a SHA256 438993f35b1676e64f82504ef58ca6213afa1a3d696d5aed96cefde5d4ddec35 +EBUILD ant-core-1.7.1-r3.ebuild 2875 RMD160 6a4d5677f333fb51e8663c6174d29f350c8e66ad SHA1 fa5f932992c16ffe5f628880753d6e144b06e12f SHA256 8bf8e3f5efc688d1b3eca97ca1d9366f99aefc5d8def9774e559f329186fee2b +MISC ChangeLog 27232 RMD160 4b9c630fb3234077adda4b934d4aad95ed58a8ab SHA1 87d25b59252b747aa14f3141eb5d13633e0fe7a0 SHA256 469d54da12c9da86d3c8ff952210eb5265cb4eb7e54752ce78764f96e367ee30 MISC metadata.xml 158 RMD160 493079b5fb71d66863beea1b023901c90ba81be5 SHA1 77cd509a8b3c377b9a24480b48a5d5481b7874f1 SHA256 ea882ceccfd160b16cf7e79de423bdcc12b3fa000f124491a6df36f5783894fb +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v2.0.10 (GNU/Linux) + +iEYEARECAAYFAkm88kAACgkQcxLzpIGCsLRa5wCeMbmt7IbyGpMxZoePzcB+exSW +tRQAnRn7RxYxDZ7kDGGVPrj6+P7L1KKj +=3mZV +-----END PGP SIGNATURE----- diff --git a/dev-java/ant-core/ant-core-1.7.1-r3.ebuild b/dev-java/ant-core/ant-core-1.7.1-r3.ebuild new file mode 100644 index 000000000000..fa52e59ccc48 --- /dev/null +++ b/dev-java/ant-core/ant-core-1.7.1-r3.ebuild @@ -0,0 +1,104 @@ +# Copyright 1999-2009 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-java/ant-core/ant-core-1.7.1-r3.ebuild,v 1.1 2009/03/15 12:18:36 betelgeuse Exp $ + +EAPI="2" + +# don't depend on itself +JAVA_ANT_DISABLE_ANT_CORE_DEP=true +# rewriting build.xml files for the testcases has no reason atm +JAVA_PKG_BSFIX_ALL=no +JAVA_PKG_IUSE="doc source" +inherit java-pkg-2 java-ant-2 + +MY_P="apache-ant-${PV}" + +DESCRIPTION="Java-based build tool similar to 'make' that uses XML configuration files." +HOMEPAGE="http://ant.apache.org/" +SRC_URI="mirror://apache/ant/source/${MY_P}-src.tar.bz2 + mirror://gentoo/ant-${PV}-gentoo.tar.bz2" + +LICENSE="Apache-2.0" +SLOT="0" +KEYWORDS="~amd64 ~ia64 ~ppc ~ppc64 ~x86 ~x86-fbsd" +IUSE="" + +DEPEND=">=virtual/jdk-1.4 + !dev-java/ant-tasks + !dev-java/ant-optional" +RDEPEND="${DEPEND}" + +S="${WORKDIR}/${MY_P}" + +src_prepare() { + # remove bundled xerces + rm -v lib/*.jar || die + + epatch "${FILESDIR}/1.7.1-pkg-info.patch" + + # use our split-ant build.xml + mv -f "${WORKDIR}/build.xml" . || die + + # bug #196080 + java-ant_bsfix_one build.xml + java-pkg-2_src_prepare +} + +src_compile() { + export ANT_HOME="" + + local bsyscp + + # this ensures that when building ant with bootstrapped ant, + # only the source is used for resolving references, and not + # the classes in bootstrapped ant + # but jikes in kaffe has issues with this... + if ! java-pkg_current-vm-matches kaffe; then + bsyscp="-Dbuild.sysclasspath=ignore" + fi + + CLASSPATH="$(java-config -t)" ./build.sh ${bsyscp} jars-core internal_dist \ + $(use_doc javadocs) || die "build failed" +} + +src_install() { + dodir /usr/share/ant/lib + for jar in ant.jar ant-bootstrap.jar ant-launcher.jar ; do + java-pkg_dojar build/lib/${jar} + dosym /usr/share/${PN}/lib/${jar} /usr/share/ant/lib/${jar} + done + + newbin "${FILESDIR}/${PV}-ant-r1" ant || die "failed to install wrapper" + dodir /usr/share/${PN}/bin + for each in antRun runant.pl runant.py complete-ant-cmd.pl ; do + dobin "${S}/src/script/${each}" + dosym /usr/bin/${each} /usr/share/${PN}/bin/${each} + done + dosym /usr/share/${PN}/bin /usr/share/ant/bin + + insinto /usr/share/${PN} + doins -r dist/etc + dosym /usr/share/${PN}/etc /usr/share/ant/etc + + echo "ANT_HOME=\"/usr/share/ant\"" > "${T}/20ant" + doenvd "${T}/20ant" || die "failed to install env.d file" + + dodoc README WHATSNEW KEYS + + if use doc; then + dohtml welcome.html + dohtml -r docs/* + java-pkg_dojavadoc --symlink manual/api build/javadocs + fi + + use source && java-pkg_dosrc src/main/* +} + +pkg_postinst() { + elog "The way of packaging ant in Gentoo has changed significantly since" + elog "the 1.7.0 version, For more information, please see:" + elog "http://www.gentoo.org/proj/en/java/ant-guide.xml" + elog + elog "Since 1.7.1, the ant-tasks meta-ebuild has been removed and its USE" + elog "flags have been moved to dev-java/ant." +} diff --git a/dev-java/ant-core/files/1.7.1-pkg-info.patch b/dev-java/ant-core/files/1.7.1-pkg-info.patch new file mode 100644 index 000000000000..2531aeef6150 --- /dev/null +++ b/dev-java/ant-core/files/1.7.1-pkg-info.patch @@ -0,0 +1,244 @@ +Index: Javac.java +=================================================================== +--- src/main/org/apache/tools/ant/taskdefs/Javac.java (revision 672109) ++++ src/main/org/apache/tools/ant/taskdefs/Javac.java (revision 743910) +@@ -19,10 +19,12 @@ + package org.apache.tools.ant.taskdefs; + + import java.io.File; +- +-import java.util.ArrayList; ++import java.io.FileOutputStream; ++import java.io.IOException; ++import java.io.OutputStream; ++import java.util.HashMap; + import java.util.Iterator; +-import java.util.List; ++import java.util.Map; + + import org.apache.tools.ant.BuildException; + import org.apache.tools.ant.DirectoryScanner; +@@ -32,6 +34,7 @@ + import org.apache.tools.ant.taskdefs.compilers.CompilerAdapterFactory; + import org.apache.tools.ant.types.Path; + import org.apache.tools.ant.types.Reference; ++import org.apache.tools.ant.util.FileUtils; + import org.apache.tools.ant.util.GlobPatternMapper; + import org.apache.tools.ant.util.JavaEnvUtils; + import org.apache.tools.ant.util.SourceFileScanner; +@@ -86,8 +89,7 @@ + private static final String CLASSIC = "classic"; + private static final String EXTJAVAC = "extJavac"; + +- private static final String PACKAGE_INFO_JAVA = "package-info.java"; +- private static final String PACKAGE_INFO_CLASS = "package-info.class"; ++ private static final FileUtils FILE_UTILS = FileUtils.getFileUtils(); + + private Path src; + private File destDir; +@@ -115,6 +117,7 @@ + protected boolean failOnError = true; + protected boolean listFiles = false; + protected File[] compileList = new File[0]; ++ private Map/*<String,Long>*/ packageInfos = new HashMap(); + // CheckStyle:VisibilityModifier ON + + private String source; +@@ -124,7 +127,6 @@ + private String errorProperty; + private boolean taskSuccess = true; // assume the best + private boolean includeDestClasses = true; +- private List updateDirList = new ArrayList(); + + /** + * Javac task for compilation of Java files. +@@ -183,13 +185,16 @@ + } + + /** +- * Value of the -source command-line switch; will be ignored +- * by all implementations except modern and jikes. ++ * Value of the -source command-line switch; will be ignored by ++ * all implementations except modern, jikes and gcj (gcj uses ++ * -fsource). ++ * ++ * <p>If you use this attribute together with jikes or gcj, you ++ * must make sure that your version of jikes supports the -source ++ * switch.</p> + * +- * If you use this attribute together with jikes, you must make +- * sure that your version of jikes supports the -source switch. +- * Legal values are 1.3, 1.4, 1.5, and 5 - by default, no +- * -source argument will be used at all. ++ * <p>Legal values are 1.3, 1.4, 1.5, and 5 - by default, no ++ * -source argument will be used at all.</p> + * + * @param v Value to assign to source. + */ +@@ -892,6 +897,7 @@ + */ + protected void resetFileLists() { + compileList = new File[0]; ++ packageInfos = new HashMap(); + } + + /** +@@ -909,8 +915,8 @@ + SourceFileScanner sfs = new SourceFileScanner(this); + File[] newFiles = sfs.restrictAsFiles(files, srcDir, destDir, m); + +- newFiles = removePackageInfoFiles(newFiles, srcDir, destDir); + if (newFiles.length > 0) { ++ lookForPackageInfos(srcDir, newFiles); + File[] newCompileList + = new File[compileList.length + newFiles.length]; + System.arraycopy(compileList, 0, newCompileList, 0, +@@ -1063,10 +1069,12 @@ + + // finally, lets execute the compiler!! + if (adapter.execute()) { +- // Success - check +- for (Iterator i = updateDirList.iterator(); i.hasNext();) { +- File file = (File) i.next(); +- file.setLastModified(System.currentTimeMillis()); ++ // Success ++ try { ++ generateMissingPackageInfoClasses(); ++ } catch (IOException x) { ++ // Should this be made a nonfatal warning? ++ throw new BuildException(x, getLocation()); + } + } else { + // Fail path +@@ -1100,75 +1108,68 @@ + } + } + +- // ---------------------------------------------------------------- +- // Code to remove package-info.java files from compilation +- // Since Ant 1.7.1. +- // +- // package-info.java are files that contain package level +- // annotations. They may or may not have corresponding .class +- // files. +- // +- // The following code uses the algorithm: +- // * on entry we have the files that need to be compiled +- // * if the filename is not package-info.java compile it +- // * if a corresponding .class file exists compile it +- // * if the corresponding class directory does not exist compile it +- // * if the corresponding directory lastmodifed time is +- // older than the java file, compile the java file and +- // touch the corresponding class directory (on successful +- // compilation). +- // +- // ---------------------------------------------------------------- +- private File[] removePackageInfoFiles( +- File[] newFiles, File srcDir, File destDir) { +- if (!hasPackageInfo(newFiles)) { +- return newFiles; +- } +- List ret = new ArrayList(); +- for (int i = 0; i < newFiles.length; ++i) { +- if (needsCompilePackageFile(newFiles[i], srcDir, destDir)) { +- ret.add(newFiles[i]); ++ private void lookForPackageInfos(File srcDir, File[] newFiles) { ++ for (int i = 0; i < newFiles.length; i++) { ++ File f = newFiles[i]; ++ if (!f.getName().equals("package-info.java")) { ++ continue; ++ } ++ String path = FILE_UTILS.removeLeadingPath(srcDir, f). ++ replace(File.separatorChar, '/'); ++ String suffix = "/package-info.java"; ++ if (!path.endsWith(suffix)) { ++ log("anomalous package-info.java path: " + path, Project.MSG_WARN); ++ continue; + } ++ String pkg = path.substring(0, path.length() - suffix.length()); ++ packageInfos.put(pkg, Long.valueOf(f.lastModified())); + } +- return (File[]) ret.toArray(new File[0]); + } + +- private boolean hasPackageInfo(File[] newFiles) { +- for (int i = 0; i < newFiles.length; ++i) { +- if (newFiles[i].getName().equals(PACKAGE_INFO_JAVA)) { +- return true; ++ /** ++ * Ensure that every {@code package-info.java} produced a {@code package-info.class}. ++ * Otherwise this task's up-to-date tracking mechanisms do not work. ++ * @see <a href="https://issues.apache.org/bugzilla/show_bug.cgi?id=43114">Bug #43114</a> ++ */ ++ private void generateMissingPackageInfoClasses() throws IOException { ++ for (Iterator i = packageInfos.entrySet().iterator(); i.hasNext(); ) { ++ Map.Entry entry = (Map.Entry) i.next(); ++ String pkg = (String) entry.getKey(); ++ Long sourceLastMod = (Long) entry.getValue(); ++ File pkgBinDir = new File(destDir, pkg.replace('/', File.separatorChar)); ++ pkgBinDir.mkdirs(); ++ File pkgInfoClass = new File(pkgBinDir, "package-info.class"); ++ if (pkgInfoClass.isFile() && pkgInfoClass.lastModified() >= sourceLastMod.longValue()) { ++ continue; ++ } ++ log("Creating empty " + pkgInfoClass); ++ OutputStream os = new FileOutputStream(pkgInfoClass); ++ try { ++ os.write(PACKAGE_INFO_CLASS_HEADER); ++ byte[] name = pkg.getBytes("UTF-8"); ++ int length = name.length + /* "/package-info" */ 13; ++ os.write((byte) length / 256); ++ os.write((byte) length % 256); ++ os.write(name); ++ os.write(PACKAGE_INFO_CLASS_FOOTER); ++ } finally { ++ os.close(); + } + } +- return false; + } ++ private static final byte[] PACKAGE_INFO_CLASS_HEADER = { ++ (byte) 0xca, (byte) 0xfe, (byte) 0xba, (byte) 0xbe, 0x00, 0x00, 0x00, ++ 0x31, 0x00, 0x07, 0x07, 0x00, 0x05, 0x07, 0x00, 0x06, 0x01, 0x00, 0x0a, ++ 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x01, 0x00, ++ 0x11, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x2d, 0x69, 0x6e, 0x66, ++ 0x6f, 0x2e, 0x6a, 0x61, 0x76, 0x61, 0x01 ++ }; ++ private static final byte[] PACKAGE_INFO_CLASS_FOOTER = { ++ 0x2f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x2d, 0x69, 0x6e, 0x66, ++ 0x6f, 0x01, 0x00, 0x10, 0x6a, 0x61, 0x76, 0x61, 0x2f, 0x6c, 0x61, 0x6e, ++ 0x67, 0x2f, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x02, 0x00, 0x00, 0x01, ++ 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, ++ 0x00, 0x00, 0x00, 0x02, 0x00, 0x04 ++ }; + +- private boolean needsCompilePackageFile( +- File file, File srcDir, File destDir) { +- if (!file.getName().equals(PACKAGE_INFO_JAVA)) { +- return true; +- } +- // return true if destDir contains the file +- String rel = relativePath(srcDir, file); +- File destFile = new File(destDir, rel); +- File parent = destFile.getParentFile(); +- destFile = new File(parent, PACKAGE_INFO_CLASS); +- File sourceFile = new File(srcDir, rel); +- if (destFile.exists()) { +- return true; +- } +- // Dest file does not exist +- // Compile Source file if sourceFile is newer that destDir +- // TODO - use fs +- if (sourceFile.lastModified() +- > destFile.getParentFile().lastModified()) { +- updateDirList.add(destFile.getParentFile()); +- return true; +- } +- return false; +- } +- +- private String relativePath(File src, File file) { +- return file.getAbsolutePath().substring( +- src.getAbsolutePath().length() + 1); +- } + } |