[1/2] signing-keys: Create destination path for exported keys

Submitted by Konrad Scherer on Dec. 10, 2015, 4:44 p.m. | Patch ID: 109675

Details

Message ID 1449765882-15910-2-git-send-email-konrad.scherer@windriver.com
State New
Headers show

Commit Message

Konrad Scherer Dec. 10, 2015, 4:44 p.m.
From: Konrad Scherer <Konrad.Scherer@windriver.com>

When testing the do_export_public_keys function using
  bitbake -c do_export_public_keys signing-keys
the destination path for the exported keys does not exist
and the gpg export call fails.

Signed-off-by: Konrad Scherer <Konrad.Scherer@windriver.com>
---
 meta/recipes-core/meta/signing-keys.bb | 2 ++
 1 file changed, 2 insertions(+)

Patch hide | download patch | download mbox

diff --git a/meta/recipes-core/meta/signing-keys.bb b/meta/recipes-core/meta/signing-keys.bb
index cc401f3..c19a5fe 100644
--- a/meta/recipes-core/meta/signing-keys.bb
+++ b/meta/recipes-core/meta/signing-keys.bb
@@ -22,6 +22,8 @@  EXCLUDE_FROM_WORLD = "1"
 
 def export_gpg_pubkey(d, keyid, path):
     import bb
+    import os.path
+    bb.utils.mkdirhier(os.path.dirname(path))
     gpg_bin = d.getVar('GPG_BIN', True) or \
               bb.utils.which(os.getenv('PATH'), "gpg")
     cmd = '%s --batch --yes --export --armor -o %s %s' % \