Re: Reliably deleting empty directories and creating symlinks
Bridger Dyson-Smith <[email protected]> Fri, 8 Aug 2025 03:40:56 +0000
| Newsgroups | gmane.comp.jakarta.ant.user |
|---|---|
| Message-ID | <CAD-FYmQgECroPOO6CYu49sj-Pixd+256706kXcDtQ1t2k=GL5g@mail.gmail.com> |
--0000000000001b27ca063bd258aa Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Stefan, On Wed, Aug 6, 2025 at 6:09=E2=80=AFPM Stefan Bodewig <[email protected]> = wrote: > On 2025-08-06, Bridger Dyson-Smith wrote: > > > I've been working with the assumption that I may be either updating an > > existing install (ie I have symlinks) or I am installing fresh (ie I ha= ve > > empty directories), so the tasks are... uh, probably unnecessarily > verbose > > (suggestions for improvements welcome). > > <symlink action=3D"delete" failonerror=3D"false"/> should remove the syml= ink > if it exists and not do anything if it doesn't. So this should be a > reliable way to delete it without required ant-contrib. > > > <delete removenotfollowedsymlinks=3D"true" failonerror=3D"false"> > > <fileset followsymlinks=3D"false" dir=3D"${basex-home}/data"/> > > </delete> > > I'm surprised this works on FreeBSD as I don't think we'd record "." as > not followed symlink at all - haven't checked the code. > > <delete removenotfollowedsymlinks=3D"true" failonerror=3D"false"> > <fileset followsymlinks=3D"false" dir=3D"${basex-home}"> > <include name=3D"data"/> > </fileset> > </delete> > > should probably work but I'd go with <symlink action=3D"delete">. > I really appreciate the pointer - it's a big help! Thanks for your time. > > Stefan > Best, Bridger > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > > --0000000000001b27ca063bd258aa--