Bugs item #1495507, was opened at 2006-05-26 07:59
Message generated for change (Comment added) made by eberhard
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=402868&aid=1495507&group_id=31650
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Tasks
Group: 0.85
>Status: Open
>Resolution: None
Priority: 5
Submitted By: Eberhard Beilharz (eberhard)
Assigned to: Nobody/Anonymous (nobody)
Summary: foreach task with IN element retrieves parent folder
Initial Comment:
The "in" element inside of the foreach task seems to
have a problem: I'm trying to delete all subfolders
under dir1. However, no matter what I specify as
include (with/without wildcard...), either none of the
subdirectories gets deleted, or all including dir1 gets
deleted. This used to work in NAnt 0.84.
If I use the "in" attribute it works as expected.
Directory structure:
tmp\dir1
tmp\dir1\dir2
tmp\dir1\dir3
The following deletes dir1, dir2 and dir3, but should
delete only dir2 and dir3:
<foreach item="Folder" property="foldername">
<in>
<items>
<include name="dir1\*"/>
</items>
</in>
<do>
<delete dir="${foldername}" failonerror="false" />
</do>
</foreach>
See attachment for a build file that demonstrates this bug.
By the way, I'm using the nightly build 2006-04-30.
----------------------------------------------------------------------
>Comment By: Eberhard Beilharz (eberhard)
Date: 2006-05-27 15:28
Message:
Logged In: YES
user_id=695643
Using basedir doesn't help. I still get dir1 and dir2.
----------------------------------------------------------------------
Comment By: Gary Feldman (garyfx)
Date: 2006-05-26 11:47
Message:
Logged In: YES
user_id=847172
Try using the basedir attribute for the fileset, i.e.
<items basedir="dir1">
<include name="*/>
</items>
The <foreach><in><items> is behaving as documented. That's
because * matches zero or more characters, and hence the
pattern "dir1\*" matches "dir1\", which means the dir1
directory will be returned.
Feel free to reopen if the above suggestion doesn't work.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=402868&aid=1495507&group_id=31650
-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
_______________________________________________
nant-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nant-developers