All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Marco Cavallini" <koansoftware@gmail.com>
To: yocto@lists.yoctoproject.org
Cc: Marco Cavallini <m.cavallini@koansoftware.com>,
	Marco Cavallini <koansoftware@gmail.com>
Subject: [meta-spdxscanner][PATCH] fossology-rest.bbclass: Moved check if spdx already exists out of the task
Date: Thu, 22 Jul 2021 15:06:23 +0200	[thread overview]
Message-ID: <20210722130623.30388-1-koansoftware@gmail.com> (raw)

From: Marco Cavallini <m.cavallini@koansoftware.com>

 With the previous code was impossible to run the do_get_report
 task  whenever a correspondent .spdx file was already present
 in tmp/deploy/spdx.
 Now the check if spdx already exists is at a higher level
 therefore is possible to run : bitbake -c get_report

Signed-off-by: Marco Cavallini <koansoftware@gmail.com>
---
 classes/fossology-rest.bbclass | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/classes/fossology-rest.bbclass b/classes/fossology-rest.bbclass
index 3694440..e55e859 100644
--- a/classes/fossology-rest.bbclass
+++ b/classes/fossology-rest.bbclass
@@ -84,6 +84,15 @@ python () {
         create_manifest(info,sstatefile)
         return
 
+    # if spdx already exists
+    if os.path.exists(info['outfile']):
+        bb.note(info['pn'] + "spdx file has been exist, do nothing")
+        return
+    if os.path.exists( sstatefile ):
+        bb.note(info['pn'] + "spdx file has been exist, do nothing")
+        create_manifest(info,sstatefile)
+        return
+
     d.appendVarFlag('do_spdx', 'depends', ' %s:do_get_report' % pn)
     bb.build.addtask('do_get_report', 'do_configure', 'do_patch' , d)
     bb.build.addtask('do_spdx', 'do_configure', 'do_get_report', d)
@@ -157,15 +166,6 @@ python do_get_report () {
     info['outfile'] = os.path.join(manifest_dir, info['pn'] + "-" + info['pv'] + ".spdx" )
     sstatefile = os.path.join(spdx_outdir, info['pn'] + "-" + info['pv'] + ".spdx" )
     
-    # if spdx has been exist
-    if os.path.exists(info['outfile']):
-        bb.note(info['pn'] + "spdx file has been exist, do nothing")
-        return
-    if os.path.exists( sstatefile ):
-        bb.note(info['pn'] + "spdx file has been exist, do nothing")
-        create_manifest(info,sstatefile)
-        return
-
     spdx_get_src(d)
 
     bb.note('SPDX: Archiving the patched source...')
-- 
2.17.1


             reply	other threads:[~2021-07-22 13:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-22 13:06 Marco Cavallini [this message]
2021-07-27  1:11 ` [yocto] [meta-spdxscanner][PATCH] fossology-rest.bbclass: Moved check if spdx already exists out of the task leimaohui
2021-07-27  6:51   ` Marco Cavallini
2021-07-27  7:27     ` leimaohui
2021-07-27  7:33       ` Marco Cavallini
2021-07-27  9:07         ` leimaohui

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210722130623.30388-1-koansoftware@gmail.com \
    --to=koansoftware@gmail.com \
    --cc=m.cavallini@koansoftware.com \
    --cc=yocto@lists.yoctoproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.