[elbe-devel] [PATCH] Fix Debian repo key import to chroot directory
Philipp Arras
philipp.arras at linutronix.de
Mon Jun 12 14:50:10 CEST 2017
Fix commit fd91ed93796db5cd0986762561b747b15b758071
Signed-off-by: Philipp Arras <philipp.arras at linutronix.de>
---
elbepack/rfs.py | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/elbepack/rfs.py b/elbepack/rfs.py
index 213bcb4..0e82158 100644
--- a/elbepack/rfs.py
+++ b/elbepack/rfs.py
@@ -20,6 +20,7 @@ import apt_pkg
import os
import sys
import urlparse
+import urllib2
import elbepack
@@ -195,11 +196,10 @@ class BuildEnv ():
l = url.text('key').strip() # URL to key
name = l.split('/')[-1] # Filename of key
- # Download key and add it to Debian keyring
- self.log.do('wget %s' % l)
- self.log.do('cp %s %s' % (name, self.rfs.fname("tmp")))
- self.log.chroot(self.rfs.path, 'apt-key add %s' % name )
- self.log.chroot(self.rfs.path, 'rm %s' % name)
+ myKey = urllib2.urlopen(l).read()
+ self.log.do('echo "%s" > %s' % (myKey, self.rfs.fname("tmp/key.pub")))
+ with self.rfs:
+ self.log.chroot(self.rfs.path, 'apt-key add /tmp/key.pub' )
def initialize_dirs (self, build_sources=False):
mirror = self.xml.create_apt_sources_list (build_sources=build_sources)
--
2.1.4
More information about the elbe-devel
mailing list