aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMohammad Akhlaghi <mohammad@akhlaghi.org>2019-01-08 14:27:24 +0000
committerMohammad Akhlaghi <mohammad@akhlaghi.org>2019-01-08 14:27:24 +0000
commitef5cc722a967fcb0a9af1a62f6f5bb8007c10e8b (patch)
treeb0ce786a5106e5d7272a8d53912d3faf3312c131
parent00d22fb56fa4a9760a040ee4411e4c9d5ebcfb23 (diff)
When installing Bash, check if the sh link is already present
After installing Bash, we would just blindly try to build the $(ibdir)/sh' symbolic link. But that could fail if it already existed. To make things clean, we now remove any link first before attempting to make a new one.
-rw-r--r--reproduce/src/make/dependencies-basic.mk9
1 files changed, 7 insertions, 2 deletions
diff --git a/reproduce/src/make/dependencies-basic.mk b/reproduce/src/make/dependencies-basic.mk
index 89abd0a..8625cf6 100644
--- a/reproduce/src/make/dependencies-basic.mk
+++ b/reproduce/src/make/dependencies-basic.mk
@@ -433,7 +433,8 @@ $(ibdir)/which: $(tdir)/which-$(which-version).tar.gz \
$(ibdir)/bash: $(tdir)/bash-$(bash-version).tar.gz \
$(ibdir)/make
- # Delete any possibly existing output
+ # Delete any possibly existing output (so it doesn't interfere with
+ # the build: we are building bash itself!)
if [ -f $@ ]; then rm $@; fi;
# Build Bash.
@@ -450,8 +451,12 @@ endif
#
# Just to be sure that the installation step above went well,
# before making the link, we'll see if the file actually exists
+ # there and remove any possibly existing link that might already be
# there.
- if [ -f $@ ]; then ln -fs $@ $(ibdir)/sh; fi
+ if [ -f $(ibdir)/sh ]; then rm $(ibdir)/sh; fi
+ if [ -f $@ ]; then ln -s $@ $(ibdir)/sh; \
+ else echo "Bash not build!"; exit 1; fi
+