From 81348fd2e0ee1c20d2f1f5e9d3079bb36590d732 Mon Sep 17 00:00:00 2001 From: Mohammad Akhlaghi Date: Thu, 4 Jun 2020 06:05:05 +0100 Subject: tex/build and tex/tikz treated properly in tarball When the project is being re-built from the tarball (not the Git repository), the 'tex/build' and 'tex/tikz' addresses are actual directories, not symbolic links. In this case, when someone runs './project configure', it will complain about not being able to delete them (it assumes they are symbolic links!). So with this commit, we first check if they are deletable without '-r'. If so, then they are full directories and we rename them to a backup directory to allow the rest of the project to continue building a link there. --- reproduce/software/shell/configure.sh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'reproduce/software/shell') diff --git a/reproduce/software/shell/configure.sh b/reproduce/software/shell/configure.sh index 882570e..1c7e60d 100755 --- a/reproduce/software/shell/configure.sh +++ b/reproduce/software/shell/configure.sh @@ -1044,6 +1044,19 @@ if ! [ -d $texbdir ]; then mkdir $texbdir; fi tikzdir=$texbdir/tikz if ! [ -d $tikzdir ]; then mkdir $tikzdir; fi +# If 'tex/build' and 'tex/tikz' aren't symbolic links, then we are in the +# tarball (not the Git repository), so we'll give them another name and let +# the script continue normally. +if rm -f tex/build; then + rm -f tex/tikz +else + mv tex/tikz tex/tikz-from-tarball + mv tex/build tex/build-from-tarball +fi + + + + # Set the symbolic links for easy access to the top project build # directories. Note that these are put in each user's source/cloned @@ -1053,7 +1066,7 @@ if ! [ -d $tikzdir ]; then mkdir $tikzdir; fi # Note: if we don't delete them first, it can happen that an extra link # will be created in each directory that points to its parent. So to be # safe, we are deleting all the links on each re-configure of the project. -rm -f .build .local tex/build tex/tikz .gnuastro +rm -f .build .local .gnuastro ln -s $bdir .build ln -s $instdir .local ln -s $texdir tex/build -- cgit v1.2.1