aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2018-10-27 10:09:08 -0500
committerRob Landley <rob@landley.net>2018-10-27 10:09:08 -0500
commit71984f3e28827549aad5b77939cdeeb62382ecb0 (patch)
tree4c45d40a0d389cbaf5a4f49c8c49e6fbe49b27d9 /scripts
parentad1f2685eb2768dbc2b52a9962d6279aa90a343d (diff)
downloadtoybox-71984f3e28827549aad5b77939cdeeb62382ecb0.tar.gz
Allow unstripped build to overwrite read-only output file.
(Output file is read only because broken installs that write to the old filename will truncate+overwrite toybox binary otherwise.)
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/make.sh6
1 files changed, 4 insertions, 2 deletions
diff --git a/scripts/make.sh b/scripts/make.sh
index ef0a7050..a1fdb343 100755
--- a/scripts/make.sh
+++ b/scripts/make.sh
@@ -336,8 +336,10 @@ do_loudly $BUILD $LNKFILES $LINK || exit 1
if [ ! -z "$NOSTRIP" ] ||
! do_loudly ${CROSS_COMPILE}${STRIP} "$UNSTRIPPED" -o "$OUTNAME"
then
- echo "strip failed, using unstripped" && cp "$UNSTRIPPED" "$OUTNAME" ||
- exit 1
+ echo "strip failed, using unstripped" &&
+ rm -f "$OUTNAME" &&
+ cp "$UNSTRIPPED" "$OUTNAME" ||
+ exit 1
fi
# gcc 4.4's strip command is buggy, and doesn't set the executable bit on