mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-28 13:16:41 +00:00
config/functions: fix safe_remove of multiple files
Several packages call safe_remove with a wildcard to remove multiple files but safe_remove only deleted the first one. Fix this by iterating over all arguments passed into safe_remove so unwanted files don't end up in the image. Signed-off-by: Matthias Reichl <hias@horus.com>
This commit is contained in:
parent
24c4c14ab2
commit
e96a892a10
@ -132,17 +132,17 @@ build_msg() {
|
|||||||
# prints a warning if the file slated for removal doesn't exist
|
# prints a warning if the file slated for removal doesn't exist
|
||||||
# this allows us to continue instead of bailing out with just "rm"
|
# this allows us to continue instead of bailing out with just "rm"
|
||||||
safe_remove() {
|
safe_remove() {
|
||||||
local path="$1"
|
local path
|
||||||
|
|
||||||
[ -z "${path}" ] && return 0
|
for path in "$@" ; do
|
||||||
|
if [ -e "${path}" -o -L "${path}" ]; then
|
||||||
if [ -e "${path}" -o -L "${path}" ]; then
|
rm -r "${path}"
|
||||||
rm -r "${path}"
|
elif [ -n "${PKG_NAME}" ]; then
|
||||||
elif [ -n "${PKG_NAME}" ]; then
|
print_color CLR_WARNING "safe_remove: path does not exist: [${PKG_NAME}]: ${path}\n"
|
||||||
print_color CLR_WARNING "safe_remove: path does not exist: [${PKG_NAME}]: ${path}\n"
|
else
|
||||||
else
|
print_color CLR_WARNING "safe_remove: path does not exist: ${path}\n"
|
||||||
print_color CLR_WARNING "safe_remove: path does not exist: ${path}\n"
|
fi
|
||||||
fi
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
### BUILDSYSTEM HELPERS ###
|
### BUILDSYSTEM HELPERS ###
|
||||||
|
Loading…
x
Reference in New Issue
Block a user