diff options
author | Mohammad Akhlaghi <mohammad@akhlaghi.org> | 2020-06-04 06:05:05 +0100 |
---|---|---|
committer | Mohammad Akhlaghi <mohammad@akhlaghi.org> | 2020-06-04 06:05:05 +0100 |
commit | 81348fd2e0ee1c20d2f1f5e9d3079bb36590d732 (patch) | |
tree | 20ebe28d8858d4cd89f46a012a01e7e555113e7c | |
parent | 2c53017c92ad7538317d2da878ff48caa611b93b (diff) |
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.
-rwxr-xr-x | reproduce/software/shell/configure.sh | 15 |
1 files changed, 14 insertions, 1 deletions
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 |