Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH] create-spdx-2.2: combine spdx can try to write before dir creation
@ 2023-12-15 17:10 jpuhlman
  2023-12-15 17:19 ` [OE-core] " Joshua Watt
  2023-12-16 22:18 ` Alexandre Belloni
  0 siblings, 2 replies; 3+ messages in thread
From: jpuhlman @ 2023-12-15 17:10 UTC (permalink / raw)
  To: openembedded-core; +Cc: Jeremy A. Puhlman

From: "Jeremy A. Puhlman" <jpuhlman@mvista.com>

On occasion a file is attmpeded to be opened prior to the
creation of the spdx_workdir. Create the directory before
the open, just in case.

File: '/build/layers/poky/meta/classes/create-spdx-2.2.bbclass', lineno: 1081, function: combine_spdx
     1077:        )
     1078:
     1079:    image_spdx_path = spdx_workdir / (rootfs_name + ".spdx.json")
     1080:
 *** 1081:    with image_spdx_path.open("wb") as f:
     1082:        doc.to_json(f, sort_keys=True, indent=get_json_indent(d))

Signed-off-by: Jeremy A. Puhlman <jpuhlman@mvista.com>
---
 meta/classes/create-spdx-2.2.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/classes/create-spdx-2.2.bbclass b/meta/classes/create-spdx-2.2.bbclass
index b0aef80db1..486efadba9 100644
--- a/meta/classes/create-spdx-2.2.bbclass
+++ b/meta/classes/create-spdx-2.2.bbclass
@@ -1075,7 +1075,7 @@ def combine_spdx(d, rootfs_name, rootfs_deploydir, rootfs_spdxid, packages, spdx
             "%s:%s" % (runtime_ref.externalDocumentId, runtime_doc.SPDXID),
             comment="Runtime dependencies for %s" % name
         )
-
+    bb.utils.mkdirhier(spdx_workdir)
     image_spdx_path = spdx_workdir / (rootfs_name + ".spdx.json")
 
     with image_spdx_path.open("wb") as f:
-- 
2.35.2



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-12-16 22:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-15 17:10 [PATCH] create-spdx-2.2: combine spdx can try to write before dir creation jpuhlman
2023-12-15 17:19 ` [OE-core] " Joshua Watt
2023-12-16 22:18 ` Alexandre Belloni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox