summaryrefslogtreecommitdiffstats
path: root/patches/opkg-utils-r4747/0004-opkg.py-Add-knowledge-about-License-field-in-ipk-hea.patch
blob: 248a9921737f6da58c7cd3537ffeef4bf9d6774e (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
35
36
37
38
39
40
41
42
43
From: Khem Raj <raj.khem@gmail.com>
Date: Thu, 29 Mar 2012 10:45:44 +0200
Subject: [PATCH] opkg.py: Add knowledge about License field in ipk headers

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
 opkg.py | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/opkg.py b/opkg.py
index 3fda9b5..8ddc8b8 100644
--- a/opkg.py
+++ b/opkg.py
@@ -145,6 +145,7 @@ class Package:
         self.priority = None
         self.tags = None
         self.fn = fn
+        self.license = None
 
         if fn:
             # see if it is deb format
@@ -319,6 +320,12 @@ class Package:
     def get_section(self, section):
         return self.section
 
+    def set_license(self, license):
+        self.license = license
+
+    def get_license(self, license):
+        return self.license
+
     def get_file_list(self):
         if not self.fn:
             return []
@@ -425,6 +432,7 @@ class Package:
         if self.description: out = out + "Description: %s\n" % (self.description)
         if self.oe: out = out + "OE: %s\n" % (self.oe)
         if self.homepage: out = out + "HomePage: %s\n" % (self.homepage)
+        if self.license: out = out + "License: %s\n" % (self.license)
         if self.priority: out = out + "Priority: %s\n" % (self.priority)
         if self.tags: out = out + "Tags: %s\n" % (self.tags)
         out = out + "\n"