Return-Path: Delivered-To: apmail-ant-user-archive@www.apache.org Received: (qmail 40723 invoked from network); 14 Jun 2007 16:42:16 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 14 Jun 2007 16:42:16 -0000 Received: (qmail 31966 invoked by uid 500); 14 Jun 2007 16:42:14 -0000 Delivered-To: apmail-ant-user-archive@ant.apache.org Received: (qmail 31928 invoked by uid 500); 14 Jun 2007 16:42:14 -0000 Mailing-List: contact user-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Ant Users List" Reply-To: "Ant Users List" Delivered-To: mailing list user@ant.apache.org Received: (qmail 31917 invoked by uid 99); 14 Jun 2007 16:42:14 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Jun 2007 09:42:14 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [194.78.35.143] (HELO bemtal01.swift.com) (194.78.35.143) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Jun 2007 09:42:09 -0700 Received: from besec560 (besec560.swift.com [172.24.88.20]) by bemtal01.swift.com with ESMTP id l5EGfkmv002481 for ; Thu, 14 Jun 2007 16:41:46 GMT X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: replace an entry in a zip file? Date: Thu, 14 Jun 2007 18:41:43 +0200 Message-ID: In-Reply-To: <32251DD60B0C1B4386EE15B0FA279A62060114C2@mercmbx08.na.sas.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: replace an entry in a zip file? Thread-Index: AceuYV96mY3ZPKFiT5KLF2mH6P1NAgAA27MgAA4Q7hAAAS04sA== References: <32251DD60B0C1B4386EE15B0FA279A62060114C2@mercmbx08.na.sas.com> From: "RADEMAKERS Tanguy" To: "Ant Users List" X-OriginalArrivalTime: 14 Jun 2007 16:41:45.0315 (UTC) FILETIME=[E4FE3B30:01C7AEA2] X-Flow-Control: Sendmail Flow Controller v2.0.0 bemtal01.swift.com l5EGfkmv002481 X-Virus-Checked: Checked by ClamAV on apache.org that's weird, i'm using 1.6.5 as well.=20 I think we have a misunderstanding. Here's what i did: 1) make three files a.txt, b.txt, c.txt, each with some text 2) create the following build.xml: 3) run that to get the first zip file: txtfiles.zip, containing the three txt files listed above. 4) move b.txt and c.txt to b.bak and c.bak (so the zip task no longer sees them) and update a.txt (add a string "updated") 5) re-run the build, and the updated zip archive txtfiles.zip now contains the original versions of b.txt and c.txt, but the updated version of a.txt. In my book, that's equivalent to "replace one entry in a zip file with an updated file", no? /t >-----Original Message----- >From: Cyril Sagan [mailto:Cyril.Sagan@sas.com]=20 >Sent: Thursday, June 14, 2007 6:12 PM >To: Ant Users List >Subject: RE: replace an entry in a zip file? > >Thanks for your reponse. However, this does not work for me=20 >in Ant 1.6.5. >Note that my goal is to *replace* a file that's already in the zip. > >Seems like the best solution would be for the duplicate=20 >attribute to support a "replace" option. > >FWIW, I'm doing this to control my jar manifest. I can't use=20 > because Ant merges with its default manifest. I'm=20 >having a hard time employing this advice from the Ant doc: > >http://ant.apache.org/manual/CoreTasks/manifest.html > > If you find that Ant generates manifests incompatible with your > runtime, take a manifest it has built, fix it up however you need > and switch to using the task to create the JAR, feeding in > the hand-crafted manifest. > >Here's my build.xml: > > > > > > =20 > > > > > > > > > > > > > fullpath=3D"META-INF/MANIFEST.MF"/> > > > > >Thanks. > >--Cyril > > >-----Original Message----- >From: RADEMAKERS Tanguy [mailto:Tanguy.RADEMAKERS@swift.com]=20 >Sent: Thursday, June 14, 2007 5:23 AM >To: Ant Users List >Subject: RE: replace an entry in a zip file? > >Hello Cyril, > >>GOAL: To replace one entry in a zip file with an updated file. >> >>I cannot find an elegant way to do this, short of 'ing the=20 >>archive, replacing the file of interest and then re-. It seems=20 >>there should be a better way. Can anyone help? >> >>Thanks. >> >>--Cyril > >If you use the update attribute of the zip task - it will=20 >"refresh" the zip with the file or files you send it, without=20 >changing or removing the other files in the archive. You may=20 >still need to extract the files of interest from the zip if=20 >you don't have them elsewhere, but you don't need to explode=20 >the whole zip just to change a few files. > >Regs, >/t > >--------------------------------------------------------------------- >To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For=20 >additional commands, e-mail: user-help@ant.apache.org > > >--------------------------------------------------------------------- >To unsubscribe, e-mail: user-unsubscribe@ant.apache.org >For additional commands, e-mail: user-help@ant.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional commands, e-mail: user-help@ant.apache.org