tools: --preserve-root --one-file-system are not portable options.
pippin had trouble with it when using busybox. So let's test for them (assuming they will show up in a `rm --help`).
This commit is contained in:
@ -59,13 +59,18 @@ if [ -n "$GIMP3_DIRECTORY" ] && [ -d "$GIMP3_DIRECTORY" ] && [ -O "$GIMP3_DIRECT
|
|||||||
echo " \"$used_dir_prefix\" != \"$tmpl_dir_prefix\""
|
echo " \"$used_dir_prefix\" != \"$tmpl_dir_prefix\""
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
echo INFO: Running: rm -fr --preserve-root --one-file-system \"$GIMP3_DIRECTORY\"
|
RM_OPTIONS=""
|
||||||
if [ -n "$GIMP_TEMP_UPDATE_RPATH" ]; then
|
if [ -z "$GIMP_TEMP_UPDATE_RPATH" ]; then
|
||||||
# macOS doesn't have the additional security options.
|
# macOS doesn't have the additional security options.
|
||||||
rm -fr "$GIMP3_DIRECTORY"
|
# Testing for other OS or environments (apparently these options are
|
||||||
else
|
# not on busybox for instance).
|
||||||
rm -fr --preserve-root --one-file-system "$GIMP3_DIRECTORY"
|
echo "INFO: Testing if rm supports --preserve-root"
|
||||||
|
rm --help | grep no-preserve-root && RM_OPTIONS="--no-preserve-root"
|
||||||
|
echo "INFO: Testing if rm supports --one-file-system"
|
||||||
|
rm --help | grep one-file-system && RM_OPTIONS="$RM_OPTIONS --one-file-system"
|
||||||
fi
|
fi
|
||||||
|
echo INFO: Running: rm -fr $RM_OPTIONS \"$GIMP3_DIRECTORY\"
|
||||||
|
rm -fr $RM_OPTIONS "$GIMP3_DIRECTORY"
|
||||||
else
|
else
|
||||||
echo "ERROR: \$GIMP3_DIRECTORY ($GIMP3_DIRECTORY) is not a directory or does not belong to the user"
|
echo "ERROR: \$GIMP3_DIRECTORY ($GIMP3_DIRECTORY) is not a directory or does not belong to the user"
|
||||||
exit 1
|
exit 1
|
||||||
|
Reference in New Issue
Block a user