ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 51602] New: zip reports "not found" when basedir attribute used with fileset
Date Tue, 02 Aug 2011 19:03:15 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=51602

             Bug #: 51602
           Summary: zip reports "not found" when basedir attribute used
                    with fileset
           Product: Ant
           Version: 1.6.5
          Platform: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Core tasks
        AssignedTo: notifications@ant.apache.org
        ReportedBy: Lothsahn@yahoo.com
    Classification: Unclassified


The zip target performs validation to ensure the fileset exists before doing
zip.  Unfortunately, this fileset validation is performed ignoring the basedir.
 For example, assume the following directories exist:



Case #1:

C:\build
C:\zipOutput
C:\zipOutput\temp


Assume that we want to zip the temp directory to C:\zipOutput\temp.zip, and
that our build process is running inside C:\build (the ant scripts and basedir
for ant is that directory).  To do this build, we would make the following zip
task:

Attributes:
zip-base-dir=C:\zipOutput
zip-filename=temp.zip
zip-dir-path=temp

Macro:
<zip destfile="@{zip-base-dir}/@{zip-filename}" basedir="@{zip-base-dir}">
  <fileset dir="@{zip-dir-path}" />
</zip>

Running this task would result in the following output:
C:\build\build.xml:102: C:\build\temp not found.

This is because the ant zip target does validation that the source fileset
exists PRIOR to zipping.  However, it does not consider the "basedir" flag in
this case, so errors are thrown.




Case #2:

Let's try to do the same thing, but this time, add two new folders:
C:\build\doc
C:\zipOutput\doc

Attributes:
zip-base-dir=C:\zipOutput
zip-filename=doc.zip
zip-dir-doc=temp

Macro:
<zip destfile="@{zip-base-dir}/@{zip-filename}" basedir="@{zip-base-dir}">
  <fileset dir="@{zip-dir-path}" />
</zip>


In this case, the zip target will succeed because the validation first
validates that C:\build\doc exists (it does), then it proceeds to zip the
C:\zipOutput\doc folder into C:\zipOutput\doc.zip

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

Mime
View raw message