diff options
author | Rob Landley <rob@landley.net> | 2018-10-27 10:09:08 -0500 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2018-10-27 10:09:08 -0500 |
commit | 71984f3e28827549aad5b77939cdeeb62382ecb0 (patch) | |
tree | 4c45d40a0d389cbaf5a4f49c8c49e6fbe49b27d9 | |
parent | ad1f2685eb2768dbc2b52a9962d6279aa90a343d (diff) | |
download | toybox-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.)
-rwxr-xr-x | scripts/make.sh | 6 |
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 |