kodi: update addon service patches

This commit is contained in:
MilhouseVH 2017-07-07 17:37:22 +01:00
parent ea8a1a232e
commit f454de0435
2 changed files with 32 additions and 34 deletions

View File

@ -1,7 +1,7 @@
From 416981e6bbcf81443e3ca8f35ca26042e174c971 Mon Sep 17 00:00:00 2001 From 3e1f7d098726e4af7eac9c83c70cf8196e4e9e3e Mon Sep 17 00:00:00 2001
From: Stefan Saraev <stefan@saraev.ca> From: MilhouseVH <milhouseVH.github@nmacleod.com>
Date: Mon, 2 Mar 2015 23:50:40 +0200 Date: Wed, 5 Jul 2017 15:46:51 +0100
Subject: [PATCH 05/13] make binary addons executable Subject: [PATCH] make binary addons executable
add executable mode to all files in addon's bin folder add executable mode to all files in addon's bin folder
@ -11,24 +11,24 @@ credits to vpeter4 for the patch
1 file changed, 26 insertions(+) 1 file changed, 26 insertions(+)
diff --git a/xbmc/addons/Addon.cpp b/xbmc/addons/Addon.cpp diff --git a/xbmc/addons/Addon.cpp b/xbmc/addons/Addon.cpp
index 77c2db8..6c21c87 100644 index 07fd5bf..639ee5c 100644
--- a/xbmc/addons/Addon.cpp --- a/xbmc/addons/Addon.cpp
+++ b/xbmc/addons/Addon.cpp +++ b/xbmc/addons/Addon.cpp
@@ -46,6 +46,10 @@ @@ -26,6 +26,10 @@
#include <string.h> #include <utility>
#include <ostream> #include <vector>
+#include <iostream> +#include <iostream>
+#include <dirent.h> +#include <dirent.h>
+#include <sys/stat.h> +#include <sys/stat.h>
+ +
using XFILE::CDirectory; #include "AddonManager.h"
using XFILE::CFile; #include "addons/Service.h"
#include "filesystem/Directory.h"
@@ -694,6 +698,28 @@ void OnPostInstall(const AddonPtr& addon, bool update, bool modal) @@ -417,6 +421,28 @@ void OnPreInstall(const AddonPtr& addon)
if (CAddonMgr::GetInstance().GetAddon(addon->ID(), localAddon, ADDON_REPOSITORY))
CRepositoryUpdater::GetInstance().ScheduleUpdate(); //notify updater there is a new addon or version
void OnPostInstall(const AddonPtr& addon, bool update, bool modal)
{
+ // OE: make binary addons executable, creddits to vpeter4 + // OE: make binary addons executable, creddits to vpeter4
+ std::string addonDirPath; + std::string addonDirPath;
+ std::string chmodFilePath; + std::string chmodFilePath;
@ -55,5 +55,5 @@ index 77c2db8..6c21c87 100644
} }
-- --
2.5.0 2.7.4

View File

@ -1,18 +1,18 @@
From 0f1be94283a3d1a3286430bbc0e326dc7b4cc6b8 Mon Sep 17 00:00:00 2001 From faebee708dc7c24d177fa6b8874b3f1374a08e25 Mon Sep 17 00:00:00 2001
From: MilhouseVH <milhouseVH.github@nmacleod.com> From: MilhouseVH <milhouseVH.github@nmacleod.com>
Date: Fri, 30 Jun 2017 14:19:59 +0100 Date: Wed, 5 Jul 2017 15:58:57 +0100
Subject: [PATCH] use a wrapper to setup systemd services Subject: [PATCH] use a wrapper to setup systemd services
--- ---
xbmc/addons/Addon.cpp | 33 +++++++++++++++++++++++++++++++++ xbmc/addons/Addon.cpp | 35 +++++++++++++++++++++++++++++++++++
xbmc/addons/Addon.h | 2 ++ xbmc/addons/Addon.h | 2 ++
2 files changed, 35 insertions(+) 2 files changed, 37 insertions(+)
diff --git a/xbmc/addons/Addon.cpp b/xbmc/addons/Addon.cpp diff --git a/xbmc/addons/Addon.cpp b/xbmc/addons/Addon.cpp
index 8bf4664..caed7c4 100644 index 639ee5c..7f205a7 100644
--- a/xbmc/addons/Addon.cpp --- a/xbmc/addons/Addon.cpp
+++ b/xbmc/addons/Addon.cpp +++ b/xbmc/addons/Addon.cpp
@@ -392,6 +392,13 @@ AddonVersion CAddon::GetDependencyVersion(const std::string &dependencyID) const @@ -396,18 +396,36 @@ AddonVersion CAddon::GetDependencyVersion(const std::string &dependencyID) const
return AddonVersion("0.0.0"); return AddonVersion("0.0.0");
} }
@ -26,19 +26,17 @@ index 8bf4664..caed7c4 100644
void OnEnabled(const std::string& id) void OnEnabled(const std::string& id)
{ {
// If the addon is a special, call enabled handler // If the addon is a special, call enabled handler
@@ -399,6 +406,11 @@ void OnEnabled(const std::string& id) AddonPtr addon;
if (CAddonMgr::GetInstance().GetAddon(id, addon, ADDON_PVRDLL)) if (CAddonMgr::GetInstance().GetAddon(id, addon, ADDON_PVRDLL))
return addon->OnEnabled(); return addon->OnEnabled();
+
+ // OE: systemctl enable & start on addon enable + // OE: systemctl enable & start on addon enable
+ if (CAddonMgr::GetInstance().GetAddon(id, addon, ADDON_SERVICE)) + if (CAddonMgr::GetInstance().GetAddon(id, addon, ADDON_SERVICE))
+ CallOEWrapper(addon->ID(), false); + CallOEWrapper(addon->ID(), false);
+ // OE + // OE
+
if (CAddonMgr::GetInstance().GetAddon(id, addon, ADDON_REPOSITORY))
CRepositoryUpdater::GetInstance().ScheduleUpdate(); //notify updater there is a new addon
} }
@@ -407,6 +419,12 @@ void OnDisabled(const std::string& id)
void OnDisabled(const std::string& id)
{ {
AddonPtr addon; AddonPtr addon;
@ -51,10 +49,12 @@ index 8bf4664..caed7c4 100644
if (CAddonMgr::GetInstance().GetAddon(id, addon, ADDON_PVRDLL, false)) if (CAddonMgr::GetInstance().GetAddon(id, addon, ADDON_PVRDLL, false))
return addon->OnDisabled(); return addon->OnDisabled();
} }
@@ -422,6 +440,14 @@ void OnPostInstall(const AddonPtr& addon, bool update, bool modal) @@ -443,11 +461,28 @@ void OnPostInstall(const AddonPtr& addon, bool update, bool modal)
{ }
AddonPtr localAddon; // OE
+ AddonPtr localAddon;
+
+ // OE: systemctl stop & disable / enable & start on addon upgrade + // OE: systemctl stop & disable / enable & start on addon upgrade
+ if (CAddonMgr::GetInstance().GetAddon(addon->ID(), localAddon, ADDON_SERVICE)) + if (CAddonMgr::GetInstance().GetAddon(addon->ID(), localAddon, ADDON_SERVICE))
+ { + {
@ -63,10 +63,8 @@ index 8bf4664..caed7c4 100644
+ } + }
+ // OE + // OE
+ +
if (CAddonMgr::GetInstance().GetAddon(addon->ID(), localAddon, ADDON_REPOSITORY)) addon->OnPostInstall(update, modal);
CRepositoryUpdater::GetInstance().ScheduleUpdate(); //notify updater there is a new addon or version }
@@ -430,6 +456,13 @@ void OnPostInstall(const AddonPtr& addon, bool update, bool modal)
void OnPreUnInstall(const AddonPtr& addon) void OnPreUnInstall(const AddonPtr& addon)
{ {