aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLei Maohui <leimaohui@fujitsu.com>2021-09-13 16:38:44 +0900
committerLei Maohui <leimaohui@fujitsu.com>2021-09-13 16:38:44 +0900
commitd364d90e57b4cd54b4d86992ed911451d3646d28 (patch)
tree0a0db4190aa62492b8023e0475c87b9dce5d133d
parent471f3ed4002ada5961052ea767f6d4ad2aceb9ba (diff)
downloadmeta-spdxscanner-d364d90e57b4cd54b4d86992ed911451d3646d28.zip
meta-spdxscanner-d364d90e57b4cd54b4d86992ed911451d3646d28.tar.gz
meta-spdxscanner-d364d90e57b4cd54b4d86992ed911451d3646d28.tar.bz2
fossology-rest.bbclass: Only for target has necessary task of spdx.HEADmaster
Signed-off-by: Lei Maohui <leimaohui@fujitsu.com>
-rw-r--r--classes/fossology-rest.bbclass14
1 files changed, 10 insertions, 4 deletions
diff --git a/classes/fossology-rest.bbclass b/classes/fossology-rest.bbclass
index 7f1df07..18d5e55 100644
--- a/classes/fossology-rest.bbclass
+++ b/classes/fossology-rest.bbclass
@@ -84,9 +84,15 @@ python () {
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)
+ def hasTask(task):
+ return bool(d.getVarFlag(task, "task", False)) and not bool(d.getVarFlag(task, "noexec", False))
+
+ if d.getVar('PACKAGES'):
+ # Some recipes do not have any packaging tasks
+ if hasTask("do_package_write_rpm") or hasTask("do_package_write_ipk") or hasTask("do_package_write_deb"):
+ 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)
}
python do_get_report () {
@@ -336,7 +342,7 @@ def has_upload(d, tar_file, folder_id):
bb.note("len of upload_output = ")
bb.note(str(len(upload_output)))
for i in range(0, len(upload_output)):
- if upload_output[i]["uploadname"] == file_name:
+ if upload_output[i]["uploadname"] == file_name and str(upload_output[i]["folderid"]) == str(folder_id):
bb.warn("Find " + file_name + " in fossology server. So, will not upload again.")
return upload_output[i]["id"]
return False