summaryrefslogtreecommitdiffstats
path: root/meta/lib/oe
diff options
context:
space:
mode:
authorIoan-Adrian Ratiu <adrian.ratiu@ni.com>2016-03-10 12:02:59 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-03-11 16:50:45 +0000
commit42f612c42a8b6cb73a16798d22d3332ec9c8dfb3 (patch)
treebcff74b5e553e1d3307874abd1137ca45bd06dad /meta/lib/oe
parentc637783638379f20e475715ca952d7b5620bb537 (diff)
downloadpoky-42f612c42a8b6cb73a16798d22d3332ec9c8dfb3.tar.gz
package_manager: sign IPK package feeds
Create gpg signed ipk package feeds using the gpg backend if configured (From OE-Core rev: a2ee831cfb688bc64c071f75a1dff8a963abe287) Signed-off-by: Ioan-Adrian Ratiu <adrian.ratiu@ni.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oe')
-rw-r--r--meta/lib/oe/package_manager.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py
index b701b8c51b..25c38a5642 100644
--- a/meta/lib/oe/package_manager.py
+++ b/meta/lib/oe/package_manager.py
@@ -153,11 +153,16 @@ class OpkgIndexer(Indexer):
153 "MULTILIB_ARCHS"] 153 "MULTILIB_ARCHS"]
154 154
155 opkg_index_cmd = bb.utils.which(os.getenv('PATH'), "opkg-make-index") 155 opkg_index_cmd = bb.utils.which(os.getenv('PATH'), "opkg-make-index")
156 if self.d.getVar('PACKAGE_FEED_SIGN', True) == '1':
157 signer = get_signer(self.d, self.d.getVar('PACKAGE_FEED_GPG_BACKEND', True))
158 else:
159 signer = None
156 160
157 if not os.path.exists(os.path.join(self.deploy_dir, "Packages")): 161 if not os.path.exists(os.path.join(self.deploy_dir, "Packages")):
158 open(os.path.join(self.deploy_dir, "Packages"), "w").close() 162 open(os.path.join(self.deploy_dir, "Packages"), "w").close()
159 163
160 index_cmds = [] 164 index_cmds = []
165 index_sign_files = []
161 for arch_var in arch_vars: 166 for arch_var in arch_vars:
162 archs = self.d.getVar(arch_var, True) 167 archs = self.d.getVar(arch_var, True)
163 if archs is None: 168 if archs is None:
@@ -176,6 +181,8 @@ class OpkgIndexer(Indexer):
176 index_cmds.append('%s -r %s -p %s -m %s' % 181 index_cmds.append('%s -r %s -p %s -m %s' %
177 (opkg_index_cmd, pkgs_file, pkgs_file, pkgs_dir)) 182 (opkg_index_cmd, pkgs_file, pkgs_file, pkgs_dir))
178 183
184 index_sign_files.append(pkgs_file)
185
179 if len(index_cmds) == 0: 186 if len(index_cmds) == 0:
180 bb.note("There are no packages in %s!" % self.deploy_dir) 187 bb.note("There are no packages in %s!" % self.deploy_dir)
181 return 188 return
@@ -183,9 +190,12 @@ class OpkgIndexer(Indexer):
183 result = oe.utils.multiprocess_exec(index_cmds, create_index) 190 result = oe.utils.multiprocess_exec(index_cmds, create_index)
184 if result: 191 if result:
185 bb.fatal('%s' % ('\n'.join(result))) 192 bb.fatal('%s' % ('\n'.join(result)))
186 if self.d.getVar('PACKAGE_FEED_SIGN', True) == '1':
187 raise NotImplementedError('Package feed signing not implementd for ipk')
188 193
194 if signer:
195 for f in index_sign_files:
196 signer.detach_sign(f,
197 self.d.getVar('PACKAGE_FEED_GPG_NAME', True),
198 self.d.getVar('PACKAGE_FEED_GPG_PASSPHRASE_FILE', True))
189 199
190 200
191class DpkgIndexer(Indexer): 201class DpkgIndexer(Indexer):