Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

[fix] make sure we actually stop the service addon before upgrading it #2069

Merged
merged 1 commit into from

4 participants

@amet

this is a fix to make sure we actually stop service addons before we update them.

currently we attempt to stop the addon that is in a zip and fail miserably as we cannot find that addon path in database, after install we start the new one and endup with 2 versions of the same addon running.

what happens now is that addon id from zip is used to find the actual installed addon and stop it, install the newer version and start it again.

@ronie if you could test please, I think its a FIX for Frodo

@ronie
Collaborator

tested and works as expected.
thx!

@davilla
Collaborator

push and add to frodo backports list

@amet amet merged commit 58eb6a9 into xbmc:master
@MartijnKaijser

Would it also fix service script failed on uninstall?
http://trac.xbmc.org/ticket/13620

@ronie
Collaborator

nope:

19:56:44 T:140662014445312   DEBUG: FileManager: delete folder /home/ronie/.xbmc/addons/script.xbmc.boblight/
19:56:44 T:140662072739584   DEBUG: Process - The source file to load is /home/ronie/.xbmc/addons/script.xbmc.boblight/default.py
19:56:44 T:140662014445312    INFO: ADDON: cpluff: 'Could not read plug-in directory /opt/xbmc-20120113/lib/xbmc/addons: No such file or directory'
19:56:44 T:140662072739584   ERROR: /home/ronie/.xbmc/addons/script.xbmc.boblight/default.py not found!
19:56:44 T:140662072739584   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.IOError'>
                                            Error Contents: (2, 'No such file or directory', '/home/ronie/.xbmc/addons/script.xbmc.boblight/default.py')
                                            IOError: (2, 'No such file or directory', '/home/ronie/.xbmc/addons/script.xbmc.boblight/default.py')
                                            -->End of Python script error report<--

looks like xbmc is trying to start the addon after it has been uninstalled

@amet amet deleted the amet:service_addon_stop branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 1 deletion.
  1. +3 −1 xbmc/addons/AddonInstaller.cpp
View
4 xbmc/addons/AddonInstaller.cpp
@@ -556,7 +556,9 @@ bool CAddonInstallJob::OnPreInstall()
if (m_addon->Type() == ADDON_SERVICE)
{
- boost::shared_ptr<CService> service = boost::dynamic_pointer_cast<CService>(m_addon);
+ AddonPtr addon;
+ ADDON::CAddonMgr::Get().GetAddon(m_addon->ID(), addon);
+ boost::shared_ptr<CService> service = boost::dynamic_pointer_cast<CService>(addon);
if (service)
service->Stop();
return true;
Something went wrong with that request. Please try again.