ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <bode...@apache.org>
Subject Re: simplify copy with regexpmapper (mapper/regexp)
Date Mon, 20 Sep 2010 15:55:03 GMT
On 2010-09-17, Niklas Matthies wrote:

> On Fri 2010-09-17 at 14:54h, Stefan Bodewig wrote on user:
>> On 2010-09-17, Niklas Matthies wrote:

>>> But "flatten" also cuts away all sub-directories.

>> Absolutely, hence "since you really want to remove all dirs".

>>> If for example the files to copy are Java source files under multiple
>>> source roots, "flatten" would also remove the Java package directories
>>> from the file paths, instead of just the part above the source roots.

>> This is correct, but this is not the case in the problem Michael is
>> trying to solve.

> Well, Michael wrote "I want to strip the leading two directories", and
> also "/lib/**/*.*", which suggests that there can be directories below
> "lib", and his regex just strips the directories up to "lib".

OK, I missed that part, sorry.

> Anyway, I'd be interested in a solution that really only removes a
> prefix of the path.

<http://svn.apache.org/repos/asf/ant/core/trunk/src/main/org/apache/tools/ant/types/mappers/CutDirsMapper.java>
or for the full commit including rudimentary documentation and tests
<http://svn.apache.org/viewvc?view=revision&revision=998962>

I couldn't figure out from the man-page (and was too lazy to trie) what
wget does if you specify --cut-dirs=12 but the path is only two levels
deep.  The mapper will currently behave in a not-my-business way like
the regexp mapper does when the from regex doesn't match.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message