From 29986536728cd58c9da4193c765f90e94c1fb4e8 Mon Sep 17 00:00:00 2001 From: Stefan Bodewig Date: Wed, 2 Apr 2003 16:01:15 +0000 Subject: [PATCH] Ignore index lists found when creating a jar with index="on". PR: 10262 git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@274378 13f79535-47bb-0310-9956-ffa450edef68 --- WHATSNEW | 2 ++ src/main/org/apache/tools/ant/taskdefs/Jar.java | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/WHATSNEW b/WHATSNEW index 54485a2b8..ce5a822d4 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -82,6 +82,8 @@ Fixed bugs: * will now work on Unices with /bin/env instead of /usr/bin/env. Bugzilla Report 17642. +* could include multiple index lists. Bugzilla 10262. + Other changes: -------------- * Shipped XML parser is now Xerces 2.4.0 diff --git a/src/main/org/apache/tools/ant/taskdefs/Jar.java b/src/main/org/apache/tools/ant/taskdefs/Jar.java index c3e90e2db..80a2f4ad8 100644 --- a/src/main/org/apache/tools/ant/taskdefs/Jar.java +++ b/src/main/org/apache/tools/ant/taskdefs/Jar.java @@ -466,7 +466,7 @@ public class Jar extends Zip { } /** - * Overriden from Zip class to deal with manifests + * Overriden from Zip class to deal with manifests and index lists. */ protected void zipFile(InputStream is, ZipOutputStream zOut, String vPath, long lastModified, File fromArchive, int mode) @@ -475,6 +475,10 @@ public class Jar extends Zip { if (! doubleFilePass || (doubleFilePass && skipWriting)) { filesetManifest(fromArchive, is); } + } else if (INDEX_NAME.equalsIgnoreCase(vPath) && index) { + log("Warning: selected " + archiveType + + " files include a META-INF/INDEX.LIST which will" + + " be replaced by a newly generated one.", Project.MSG_WARN); } else { super.zipFile(is, zOut, vPath, lastModified, fromArchive, mode); }