summaryrefslogtreecommitdiffstats
path: root/patches/opkg-utils-0.4.1/0101-Update-Installed-Size-properly.patch
blob: 184095540682fb3036d82c40dc36469681ce32f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
From: Michael Olbrich <m.olbrich@pengutronix.de>
Date: Tue, 9 Oct 2018 11:19:37 +0200
Subject: [PATCH] Update Installed-Size properly

Convert '-' to '_' to match the variable name 'installed_size' and use the
correct property name 'Installed-Size'.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
---
 opkg.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/opkg.py b/opkg.py
index d4e782546bc1..2e58b5f7ad19 100644
--- a/opkg.py
+++ b/opkg.py
@@ -247,7 +247,7 @@ class Package(object):
             lineparts = re.match(r'([\w-]*?):\s*(.*)', line)
             if lineparts:
                 name = lineparts.group(1)
-                name_lowercase = name.lower()
+                name_lowercase = name.lower().replace('-',"_")
                 value = lineparts.group(2)
                 while 1:
                     line = control.readline().rstrip()
@@ -504,7 +504,7 @@ class Package(object):
         if 'sha256' in checksum:
             if self.sha256: out = out + "SHA256sum: %s\n" % (self.sha256)
         if self.size: out = out + "Size: %d\n" % int(self.size)
-        if self.installed_size: out = out + "InstalledSize: %d\n" % int(self.installed_size)
+        if self.installed_size: out = out + "Installed-Size: %d\n" % int(self.installed_size)
         if self.filename: out = out + "Filename: %s\n" % (self.filename)
         if self.source: out = out + "Source: %s\n" % (self.source)
         if self.description: out = out + "Description: %s\n" % (self.description)