enigma2: update to 4.3.0r13
[opendreambox.git] / meta-opendreambox / recipes-dreambox / enigma2 / enigma2-4.3.0r13-dm7080 / 0001-Components.Ipkg-fix-installation-of-non-local-packag.patch
1 From ee028143510da1ffa57bd30342006b63dfc70e9d Mon Sep 17 00:00:00 2001
2 From: reichi <reichi@opendreambox.org>
3 Date: Tue, 30 Aug 2016 11:28:01 +0200
4 Subject: [PATCH] Components.Ipkg: fix installation of non-local packages. We
5  actually have to take a "two-way" approach currently depending on wheter a
6  package is local or remote
7
8 ---
9  usr/lib/enigma2/python/Components/Ipkg.py | 21 +++++++++++++--------
10  1 file changed, 13 insertions(+), 8 deletions(-)
11
12 diff --git a/usr/lib/enigma2/python/Components/Ipkg.py b/usr/lib/enigma2/python/Components/Ipkg.py
13 index efdf6bb..f20c813 100644
14 --- a/usr/lib/enigma2/python/Components/Ipkg.py
15 +++ b/usr/lib/enigma2/python/Components/Ipkg.py
16 @@ -1,7 +1,8 @@
17  from enigma import eConsoleAppContainer
18 -
19  from Tools.Log import Log
20  
21 +from pipes import quote as pipes_quote
22 +
23  class PkgComponent:
24         EVENT_INSTALL = 0
25         EVENT_DOWNLOAD = 1
26 @@ -18,8 +19,9 @@ class PkgComponent:
27         CMD_UPDATE = 3
28         CMD_UPGRADE = 4
29  
30 -       def __init__(self, dpkg = 'dpkg'):
31 +       def __init__(self, dpkg = 'opkg', dpkg_local='dpkg'):
32                 self.dpkg = dpkg
33 +               self.dpkg_local = dpkg_local
34                 self.cmd = eConsoleAppContainer()
35                 self.cmd_appClosed_conn = self.cmd.appClosed.connect(self.cmdFinished)
36                 self.cmd_dataAvail_conn = self.cmd.dataAvail.connect(self.cmdData)
37 @@ -54,11 +56,14 @@ class PkgComponent:
38                         else:
39                                 self.runCmd("list")
40                 elif cmd == self.CMD_INSTALL:
41 -                       self.preInstCmd = eConsoleAppContainer()
42 -                       self.preInstCmd_appClosed_conn = self.preInstCmd.appClosed.connect(self.preInstCmdFinished)
43 -                       self.preInstCmd_dataAvail_conn = self.preInstCmd.dataAvail.connect(self.cmdData)
44 -                       Log.i("executing apt-get update")
45 -                       self.preInstCmd.execute("apt-get update")
46 +                       if args['package'].startswith('/'):
47 +                               self.preInstCmd = eConsoleAppContainer()
48 +                               self.preInstCmd_appClosed_conn = self.preInstCmd.appClosed.connect(self.preInstCmdFinished)
49 +                               self.preInstCmd_dataAvail_conn = self.preInstCmd.dataAvail.connect(self.cmdData)
50 +                               Log.i("A local package is to be installed: executing apt-get update before doing so")
51 +                               self.preInstCmd.execute("apt-get update")
52 +                       else:
53 +                               self.runCmd("install " + args['package'])
54                 elif cmd == self.CMD_REMOVE:
55                         append = ""
56                         if args["autoremove"]:
57 @@ -70,7 +75,7 @@ class PkgComponent:
58                 self.instcmd = eConsoleAppContainer()
59                 self.instcmd_appClosed_conn = self.instcmd.appClosed.connect(self.instCmdFinished)
60                 self.instcmd_dataAvail_conn = self.instcmd.dataAvail.connect(self.cmdData)
61 -               self.instcmd.execute("dpkg -i " + self.args['package'])
62 +               self.instcmd.execute(self.dpkg_local + " -i " + pipes_quote(self.args['package']))
63  
64         def instCmdFinished(self, retval):
65                 self.postcmd = eConsoleAppContainer()
66 -- 
67 2.1.4
68