On Tue, Aug 5, 2025, 11:32 PM Bridger Dyson-Smith <bdysonsm...@gmail.com> wrote:
> Hi all - > > I'm trying to use Ant to help automate a software install/update process: > a ZIP download and unpack, remove empty directories, create symlinks in > their place, and then apply some simple regex/replace tasks. I have the > process worked out on a FreeBSD machine, but as soon as I move the > build.xml to a Linux system, things fail when I try to create the symlinks. > > 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 have > empty directories), so the tasks are... uh, probably unnecessarily verbose > (suggestions for improvements welcome). The error on linux comes in when > the `symlink` task is called: I get the following BUILD FAILED error: > 'Deletion of file at /home/bridger/bin/basex/data failed, while trying to > overwrite it with a symlink.' > > Any suggestions about what to do to fix this and make it more robust? > Thanks in advance for your time and help. > Best, > Bridger > > > <target name="rm-dirs"> > <if> > <available file="${basex-home}/data" type="dir"/> > <then> > <echo>*** ${basex-home}/data symlink available ***</echo> > <delete removenotfollowedsymlinks="true" failonerror="false"> > <fileset followsymlinks="false" dir="${basex-home}/data"/> > </delete> > </then> > </if> > <if> > <available file="${basex-home}/repo" type="dir"/> > <then> > <echo>*** ${basex-home}/repo symlink available ***</echo> > <delete removenotfollowedsymlinks="true" failonerror="false"> > <fileset followsymlinks="false" dir="${basex-home}/repo"/> > </delete> > </then> > </if> > <if> > <available file="${basex-home}/src" type="dir"/> > <then> > <echo>*** ${basex-home}/repo symlink available ***</echo> > <delete removenotfollowedsymlinks="true" failonerror="false"> > <fileset followsymlinks="false" dir="${basex-home}/src "/> > </delete> > </then> > </if> > <if> > <available file="${basex-home}/data" type="dir"/> > <then> > <delete failonerror="false"><fileset dir="${basex-home}/data"/></delete> > </then> > </if> > <if> > <available file="${basex-home}/repo" type="dir"/> > <then> > <delete failonerror="false"><fileset dir="${basex-home}/repo"/></delete> > </then> > </if> > <if> > <available file="${basex-home}/src" type="dir"/> > <then> > <delete failonerror="false"><fileset dir="${basex-home}/src"/></delete> > </then> > </if> > </target> > > <target name="symlink-dirs" depends="rm-dirs"> > <echo>*** creating symlinks for `data`, `repo`, and `src` directories > ***</echo> > <symlink overwrite="true" link="${basex-home}/data" > resource="${bin}/basex-data"/> > <symlink overwrite="true" link="${basex-home}/repo" > resource="${bin}/basex-repo"/> > <symlink overwrite="true" link="${basex-home}/src" > resource="${bin}/basex-src"/> > </target> > > Apologies, forgot to mention that I have the antcontribs installed (from source forge). Best, Bridger >