Ticket #34 (closed defect: fixed)
<fileset dir="."> does include more than expected
| Reported by: | norman@… | Owned by: | mrook |
|---|---|---|---|
| Priority: | blocker | Milestone: | 2.2.0 |
| Component: | Version: | 2.2.0RC2 | |
| Keywords: | fileset | Cc: |
Description
Hi folks,
when I put the following lines in my build.xml file
<target name="dev-dist" depends="preparedist">
<zip destfile="dist/OpenDocumentPHP-dev.zip" basedir=".">
<fileset dir=".">
<include name="**/**"/>
<exclude name="dist/**"/>
<exclude name="reports/**"/>
<exclude name="docs/**"/>
<exclude name="production/**"/>
</fileset>
</zip>
<tar destfile="dist/OpenDocumentPHP-dev.tar.gz" basedir="." compression="gzip">
<fileset dir=".">
<include name="**/**"/>
<exclude name="dist/**"/>
<exclude name="reports/**"/>
<exclude name="docs/**"/>
<exclude name="production/**"/>
</fileset>
</tar>
</target>
I would expect that two files "OpenDocumentPHP-dev.zip" and "OpenDocumentPHP-dev.tar.gz" will be generated. So far so good. But when I look into these files I found some very nasty things:
- The excluded directories are included in both files.
- In the ZIP file most files are included twice. One (e.g.) src/OpenDocument.php and /home/user/test/devel/OpenDocumentPHP/src/OpenDocument.php.
This happend in a unix and in a windows enviroment.
Thanks, Norman
Attachments
Change History
comment:2 Changed 6 years ago by mrook
- Status changed from assigned to closed
- Resolution set to fixed
Hi Norman,
sorry for the late response - but your issue seems to be a documentation problem.
The tar and zip tasks include the entire directory contents because the basedir attribute is used, effectively overriding (or supplementing, if you will) any additional fileset's you have specified. Some clarifying notes about this behavior have been committed in r91.
Additionally the relative paths issue in ZipTask has been fixed in r92.
Thanks for the report!
