mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-29 21:56:42 +00:00
package cache: initialise with a function
This commit is contained in:
parent
bf71ef864b
commit
64156ea8c8
@ -515,6 +515,28 @@ enable_service () {
|
|||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
init_package_cache() {
|
||||||
|
local _ANCHOR="@?+?@" DIR
|
||||||
|
|
||||||
|
# If the package caches are unset, then populate them
|
||||||
|
if [ -z "${_CACHE_PACKAGE_LOCAL+x}" -o -z "${_CACHE_PACKAGE_GLOBAL+x}" ]; then
|
||||||
|
_CACHE_PACKAGE_LOCAL=""
|
||||||
|
_CACHE_PACKAGE_GLOBAL=""
|
||||||
|
|
||||||
|
# cache project folder for a package
|
||||||
|
for DIR in $(find $ROOT/projects/$PROJECT/packages -type d 2>/dev/null); do
|
||||||
|
[ -r "$DIR/package.mk" ] && _CACHE_PACKAGE_LOCAL+="${DIR}${_ANCHOR}\n"
|
||||||
|
done
|
||||||
|
|
||||||
|
# cache packages folder
|
||||||
|
for DIR in $(find $ROOT/$PACKAGES -type d 2>/dev/null); do
|
||||||
|
[ -r "$DIR/package.mk" ] && _CACHE_PACKAGE_GLOBAL+="${DIR}${_ANCHOR}\n"
|
||||||
|
done
|
||||||
|
|
||||||
|
export _CACHE_PACKAGE_LOCAL _CACHE_PACKAGE_GLOBAL
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
check_path() {
|
check_path() {
|
||||||
dashes="==========================="
|
dashes="==========================="
|
||||||
if [ "${PWD##/usr}" != "${PWD}" ]; then
|
if [ "${PWD##/usr}" != "${PWD}" ]; then
|
||||||
|
21
config/path
21
config/path
@ -53,6 +53,9 @@ SED="sed -i"
|
|||||||
|
|
||||||
unset LD_LIBRARY_PATH
|
unset LD_LIBRARY_PATH
|
||||||
|
|
||||||
|
# If the package caches are unset, then populate them
|
||||||
|
init_package_cache
|
||||||
|
|
||||||
# set package metadata
|
# set package metadata
|
||||||
reset_pkg_vars "$1"
|
reset_pkg_vars "$1"
|
||||||
|
|
||||||
@ -63,24 +66,6 @@ unset LD_LIBRARY_PATH
|
|||||||
_ANCHOR="@?+?@"
|
_ANCHOR="@?+?@"
|
||||||
PKG_DIR=""
|
PKG_DIR=""
|
||||||
|
|
||||||
# If the package caches are unset, then populate them
|
|
||||||
if [ -z "${_CACHE_PACKAGE_LOCAL+x}" -o -z "${_CACHE_PACKAGE_GLOBAL+x}" ]; then
|
|
||||||
_CACHE_PACKAGE_LOCAL=""
|
|
||||||
_CACHE_PACKAGE_GLOBAL=""
|
|
||||||
|
|
||||||
# cache project folder for a package
|
|
||||||
for DIR in $(find $ROOT/projects/$PROJECT/packages -type d 2>/dev/null); do
|
|
||||||
[ -r "$DIR/package.mk" ] && _CACHE_PACKAGE_LOCAL+="${DIR}${_ANCHOR}\n"
|
|
||||||
done
|
|
||||||
|
|
||||||
# cache packages folder
|
|
||||||
for DIR in $(find $ROOT/$PACKAGES -type d 2>/dev/null); do
|
|
||||||
[ -r "$DIR/package.mk" ] && _CACHE_PACKAGE_GLOBAL+="${DIR}${_ANCHOR}\n"
|
|
||||||
done
|
|
||||||
|
|
||||||
export _CACHE_PACKAGE_LOCAL _CACHE_PACKAGE_GLOBAL
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Check for any available local package in preference to a global package
|
# Check for any available local package in preference to a global package
|
||||||
for DIR in $(echo -e "${_CACHE_PACKAGE_LOCAL}" | grep -F "/${_PKG_ROOT_NAME}${_ANCHOR}"); do
|
for DIR in $(echo -e "${_CACHE_PACKAGE_LOCAL}" | grep -F "/${_PKG_ROOT_NAME}${_ANCHOR}"); do
|
||||||
DIR="${DIR%${_ANCHOR}}"
|
DIR="${DIR%${_ANCHOR}}"
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
unset _CACHE_PACKAGE_LOCAL _CACHE_PACKAGE_GLOBAL
|
unset _CACHE_PACKAGE_LOCAL _CACHE_PACKAGE_GLOBAL
|
||||||
|
|
||||||
. config/options TRIGGER_POPULATION_OF_CACHE_PACKAGE
|
. config/options ""
|
||||||
|
|
||||||
. config/show_config
|
. config/show_config
|
||||||
show_config
|
show_config
|
||||||
|
Loading…
x
Reference in New Issue
Block a user