summaryrefslogtreecommitdiffstats
path: root/patches/opkg-utils-0.3.6/0101-Update-Installed-Size-properly.patch
blob: f5ecd3967c0e2086b2bb35f132bedabbfb46b29a (plain) (blame)
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 153b62c7e7fa..f5cb9b86a773 100644
--- a/opkg.py
+++ b/opkg.py
@@ -230,7 +230,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()
@@ -482,7 +482,7 @@ class Package(object):
         if self.maintainer: out = out + "Maintainer: %s\n" % (self.maintainer)
         if self.md5: out = out + "MD5Sum: %s\n" % (self.md5)
         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)