android exec fix

sandbox1
DiMartinoXBMC 2015-12-21 16:31:27 +03:00
parent 7985cab656
commit 3495306859
3 changed files with 10 additions and 5 deletions

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="script.module.torrent2http" name="torrent2http" version="0.1.2" provider-name="anteo"> <addon id="script.module.torrent2http" name="torrent2http" version="0.1.3" provider-name="anteo">
<requires> <requires>
<import addon="xbmc.python" version="2.14.0"/> <import addon="xbmc.python" version="2.14.0"/>
</requires> </requires>

View File

@ -1,3 +1,6 @@
[B]Version 0.1.3[/B]
+ Android execute fix
[B]Version 0.1.2[/B] [B]Version 0.1.2[/B]
+ Torrent2http binaries for Raspberry Pi v1 (arm v6) + Torrent2http binaries for Raspberry Pi v1 (arm v6)

View File

@ -30,8 +30,12 @@ class Engine:
def _ensure_binary_executable(self, path): def _ensure_binary_executable(self, path):
st = os.stat(path) st = os.stat(path)
if not st.st_mode & stat.S_IEXEC: if not st.st_mode & stat.S_IEXEC:
try:
self._log("%s is not executable, trying to change its mode..." % path) self._log("%s is not executable, trying to change its mode..." % path)
os.chmod(path, st.st_mode | stat.S_IEXEC) os.chmod(path, st.st_mode | stat.S_IEXEC)
except Exception, e:
self._log("Failed! Exception: %s" % str(e))
return False
st = os.stat(path) st = os.stat(path)
if st.st_mode & stat.S_IEXEC: if st.st_mode & stat.S_IEXEC:
self._log("Succeeded") self._log("Succeeded")
@ -63,8 +67,6 @@ class Engine:
if not success: if not success:
raise Error("Can't find torrent2http or download binary for %s" % self.platform, raise Error("Can't find torrent2http or download binary for %s" % self.platform,
Error.UNKNOWN_PLATFORM, platform=str(self.platform)) Error.UNKNOWN_PLATFORM, platform=str(self.platform))
else:
lm.update()
if not self._ensure_binary_executable(binary_path): if not self._ensure_binary_executable(binary_path):
if self.platform.system == "android": if self.platform.system == "android":