Ticket #75 (closed defect: fixed)

Opened 2 years ago

Last modified 1 year ago

files excluded by fileset end up in .tgz but not .zip

Reported by: adrian.woodhead@gmail.com Assigned to: hans
Priority: major Milestone: 2.3.0
Component: cruisecontrol-builder-plugin Version: 2.2.0
Keywords: Cc:

Description (Last modified by hans)

I am trying to build 2 archives (a .tgz and a .zip) from a CVS checkout, excluding all the CVS folders. So I define a file set like so:

  <fileset dir="." id="archive.files">
    <include name="**/**"/>
    <exclude name="CVS/**"/>
    <exclude name="CVSROOT/**"/>
    <exclude name="build/**"/>
    <exclude name="build.xml"/>
  </fileset>

I then have two targets like so:

  <target name="build-tgz" description="Generates .tgz file containing modules" depends="init">
    <tar destfile="${tarfile}" compression="gzip">
      <fileset refid="archive.files"/>
    </tar>
  </target>
  
  <target name="build-zip" description="Generates .zip file containing modules" depends="init">
    <zip destfile="${zipfile}">
      <fileset refid="archive.files"/>
    </zip>
  </target>

Which you would think would end up with the same files in both archives. This is not the case and I can't quite lay my finger on what is causing the issue. The archives are very nearly identical except (this is just one example) in the .tgz I have this folder:

timeline/resources/ext/geochrono/images/CVS

Which is incorrect (my fileset specifically excludes all CVS folders). This folder does not end up in the zip file. There is a hidden .svn folder at the same level as the CVS folder under images, I don't know if this is causing the problem (i.e. if you have a hidden folder under an excluded folder the excluded folder is still included).

Attachments

Change History

07/29/07 21:18:09 changed by hans

  • owner set to hans.
  • status changed from new to assigned.
  • component set to cruisecontrol-builder-plugin.

07/29/07 21:18:24 changed by hans

  • milestone set to 2.3.0.

08/02/07 02:08:26 changed by hans

  • description changed.

I'm having a hard time with a real basic reproduction of this. One thing I would point out is that the

<exclude name="CVS/**"/>

clause will only exclude the top-level CVS directory. It is expected behavior (as coded, perhaps not as documented!) that sub-directory CVS folders would be included. I just duplicated that behavior with the tar task.

Here's a transcript of that test, if this helps:

hans@rubidium ~/tests $ ls
CVS  build.xml  included.txt  included2.txt
hans@rubidium ~/tests $ mkdir testdir/CVS
mkdir: cannot create directory `testdir/CVS': No such file or directory
hans@rubidium ~/tests $ mkdir -p testdir/CVS
hans@rubidium ~/tests $ phing
Buildfile: /home/hans/tests/build.xml

test > build-tgz:

      [tar] Building tar: /home/hans/tests/test.tgz

BUILD FINISHED

Total time: 0.1730 seconds

hans@rubidium ~/tests $ tar tvf test.tgz
-rw-r--r-- 1000/1000         5 2007-08-02 02:00:53 included.txt
-rw-r--r-- 1000/1000        14 2007-08-02 02:01:04 included2.txt
drwxr-xr-x 1000/1000         0 2007-08-02 02:04:25 testdir
drwxr-xr-x 1000/1000         0 2007-08-02 02:04:25 testdir/CVS

08/02/07 02:09:20 changed by hans

  • description changed.

This does pose a question, though, about why the CVS dir was not included in the zip file... Both TarTask and ZipTask are using FileSets, though TarTask uses a sub-class of FileSet, so it's possible there's some subtle difference.

08/14/07 23:23:20 changed by hans

I need some feedback on this ticket, or I will mark it "can't reproduce". Can the poster please verify that there is indeed an issue here -- whether it is with the task or documentation?

08/15/07 04:28:34 changed by anonymous

Hey, I am the original poster of the bug, travelling in central america so haven't been able to reply...

The issue is that the tasks produce different results exactly like was pointed out above - why do the CVS directories end up in the .tgz and not the zip, it's inconsistent. I would really expect them both to produce the same results (other than the compression used obviously) based on the phing build file I submitted. I'm sure Ant works like that.

08/21/07 00:12:40 changed by hans

  • status changed from assigned to closed.
  • resolution set to fixed.

Fixed in changeset:220. Note that there is another bug related to inclusion of directory resources: see #137 (which does have a workaround).


Add/Change #75 (files excluded by fileset end up in .tgz but not .zip)




Action