mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-28 13:16:41 +00:00
Merge pull request #3191 from vpeter4/addon_service_fix
kodi: service addon wrapper call fix
This commit is contained in:
commit
df9076a4b5
@ -19,8 +19,8 @@ index 8343101b96..8130d99b83 100644
|
|||||||
+ case LE_ADDON_DISABLED:
|
+ case LE_ADDON_DISABLED:
|
||||||
+ contextStr = "disable";
|
+ contextStr = "disable";
|
||||||
+ break;
|
+ break;
|
||||||
+ case LE_ADDON_POST_INSTALL:
|
+ case LE_ADDON_POST_UPDATE:
|
||||||
+ contextStr = "post-install";
|
+ contextStr = "post-update";
|
||||||
+ break;
|
+ break;
|
||||||
+ case LE_ADDON_PRE_UNINSTALL:
|
+ case LE_ADDON_PRE_UNINSTALL:
|
||||||
+ contextStr = "pre-uninstall";
|
+ contextStr = "pre-uninstall";
|
||||||
@ -40,12 +40,13 @@ index 8343101b96..8130d99b83 100644
|
|||||||
void OnPreInstall(const AddonPtr& addon)
|
void OnPreInstall(const AddonPtr& addon)
|
||||||
{
|
{
|
||||||
//Fallback to the pre-install callback in the addon.
|
//Fallback to the pre-install callback in the addon.
|
||||||
@@ -426,6 +457,8 @@ void OnPostInstall(const AddonPtr& addon, bool update, bool modal)
|
@@ -426,6 +457,9 @@ void OnPostInstall(const AddonPtr& addon, bool update, bool modal)
|
||||||
}
|
}
|
||||||
closedir(addonsDir);
|
closedir(addonsDir);
|
||||||
}
|
}
|
||||||
+
|
+
|
||||||
+ LEAddonHook(addon, LE_ADDON_POST_INSTALL);
|
+ if (update)
|
||||||
|
+ LEAddonHook(addon, LE_ADDON_POST_UPDATE);
|
||||||
// OE
|
// OE
|
||||||
|
|
||||||
addon->OnPostInstall(update, modal);
|
addon->OnPostInstall(update, modal);
|
||||||
@ -69,7 +70,7 @@ index b877839848..f7c0b717f6 100644
|
|||||||
+typedef enum {
|
+typedef enum {
|
||||||
+ LE_ADDON_ENABLED,
|
+ LE_ADDON_ENABLED,
|
||||||
+ LE_ADDON_DISABLED,
|
+ LE_ADDON_DISABLED,
|
||||||
+ LE_ADDON_POST_INSTALL,
|
+ LE_ADDON_POST_UPDATE,
|
||||||
+ LE_ADDON_PRE_UNINSTALL,
|
+ LE_ADDON_PRE_UNINSTALL,
|
||||||
+} LE_ADDON_CONTEXT;
|
+} LE_ADDON_CONTEXT;
|
||||||
+
|
+
|
||||||
|
@ -29,8 +29,8 @@ if [ -f "${SERVICE_FILE}" ] ; then
|
|||||||
systemctl stop "${ADDON_ID}.service"
|
systemctl stop "${ADDON_ID}.service"
|
||||||
systemctl disable "${ADDON_ID}.service"
|
systemctl disable "${ADDON_ID}.service"
|
||||||
;;
|
;;
|
||||||
post-install)
|
post-update)
|
||||||
# post-install is triggered on update as well,
|
# post-update is triggered on update,
|
||||||
# make sure to stop and re-install service
|
# make sure to stop and re-install service
|
||||||
systemctl stop "${ADDON_ID}.service"
|
systemctl stop "${ADDON_ID}.service"
|
||||||
systemctl disable "${ADDON_ID}.service"
|
systemctl disable "${ADDON_ID}.service"
|
||||||
@ -77,7 +77,7 @@ if [ -d "${OVERLAY_PATH}" ] ; then
|
|||||||
OVERLAY_CONF="/storage/.cache/kernel-overlays/50-${ADDON_ID}.conf"
|
OVERLAY_CONF="/storage/.cache/kernel-overlays/50-${ADDON_ID}.conf"
|
||||||
|
|
||||||
case "${CONTEXT}" in
|
case "${CONTEXT}" in
|
||||||
enable | post-install )
|
enable | post-update )
|
||||||
create_overlay_conf
|
create_overlay_conf
|
||||||
;;
|
;;
|
||||||
disable | pre-uninstall )
|
disable | pre-uninstall )
|
||||||
|
Loading…
x
Reference in New Issue
Block a user