aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLei Maohui <leimaohui@cn.fujitsu.com>2019-05-30 16:38:48 +0900
committerLei Maohui <leimaohui@cn.fujitsu.com>2019-05-30 16:38:48 +0900
commitb6c6133b4943d524de59c2170e39a596df54a31c (patch)
tree71f0f038593030dde804524cfaf7d8e2b579435e
parent4bc75d7328bc38e98fabc85c8d3adccd2e659fe1 (diff)
parentb57481af3342db17028a46288cc643470315ae7b (diff)
downloadmeta-spdxscanner-b6c6133b4943d524de59c2170e39a596df54a31c.tar.gz
meta-spdxscanner-b6c6133b4943d524de59c2170e39a596df54a31c.tar.bz2
meta-spdxscanner-b6c6133b4943d524de59c2170e39a596df54a31c.zip
Merge branch 'warrior'
-rw-r--r--classes/fossdriver-host.bbclass50
-rw-r--r--classes/nopackages.bbclass13
2 files changed, 48 insertions, 15 deletions
diff --git a/classes/fossdriver-host.bbclass b/classes/fossdriver-host.bbclass
index 4a4f2e5..6160aa3 100644
--- a/classes/fossdriver-host.bbclass
+++ b/classes/fossdriver-host.bbclass
@@ -131,7 +131,7 @@ python do_spdx () {
bb.warn('Can\'t get the spdx file ' + info['pn'] + '. Please check your.')
}
-addtask do_spdx before do_fetch
+addtask do_spdx before do_unpack after do_fetch
def spdx_create_tarball(d, srcdir, suffix, ar_outdir):
"""
@@ -197,6 +197,7 @@ def spdx_get_src(d):
def invoke_fossdriver(tar_file, spdx_file):
import os
+ import time
(work_dir, tar_file) = os.path.split(tar_file)
os.chdir(work_dir)
@@ -214,24 +215,43 @@ def invoke_fossdriver(tar_file, spdx_file):
bb.note("invoke_fossdriver : tar_file = %s " % tar_file)
if (Reuse(server, tar_file, "Software Repository", tar_file, "Software Repository").run() != True):
bb.note("This OSS has not been scanned. So upload it to fossology server.")
- if (Upload(server, tar_file, "Software Repository").run() != True):
+ i = 0
+ while i < 5:
+ if (Upload(server, tar_file, "Software Repository").run() != True):
bb.warn("%s Upload failed, try again!" % tar_file)
- if (Upload(server, tar_file, "Software Repository").run() != True):
- bb.warn("%s Upload fail.Please check your fossology server." % tar_file)
- return False
- else:
+ i += 1
+ else:
+ i = 0
+ while i < 10:
if (Scanners(server, tar_file, "Software Repository").run() != True):
bb.warn("%s scanner failed, try again!" % tar_file)
- if (Scanners(server, tar_file, "Software Repository").run() != True):
- bb.warn("%s scanner fail.Please check your fossology server." % tar_file)
- return False
+ i+= 1
+ else:
+ i = 0
+ while i < 10:
+ if (SPDXTV(server, tar_file, "Software Repository", spdx_file).run() == False):
+ time.sleep(1)
+ bb.warn("%s SPDXTV failed, try again!" % tar_file)
+ i += 1
+ else:
+ return True
+ bb.warn("%s SPDXTV failed, Please check your fossology server." % tar_file)
+ return False
+ bb.warn("%s Scanners failed, Please check your fossology server." % tar_file)
+ return False
+ bb.warn("%s Upload fail.Please check your fossology server." % tar_file)
+ return False
else:
- bb.note("This OSS has been scanned. Use the last result.")
- if (SPDXTV(server, tar_file, "Software Repository", spdx_file).run() == False):
- bb.warn("%s SPDXTV failed, try again!" % tar_file)
- if (SPDXTV(server, tar_file, "Software Repository", spdx_file).run() == False):
- bb.warn("%s scanner fail.Please check your fossology server." % tar_file)
- return False
+ i = 0
+ while i < 10:
+ if (SPDXTV(server, tar_file, "Software Repository", spdx_file).run() == False):
+ time.sleep(1)
+ bb.warn("%s SPDXTV failed, try again!" % tar_file)
+ i += 1
+ else:
+ return True
+ bb.warn("%s SPDXTV failed, Please check your fossology server." % tar_file)
+ return False
def create_manifest(info,sstatefile):
import shutil
diff --git a/classes/nopackages.bbclass b/classes/nopackages.bbclass
new file mode 100644
index 0000000..eb058a7
--- /dev/null
+++ b/classes/nopackages.bbclass
@@ -0,0 +1,13 @@
+deltask do_package
+deltask do_package_write_rpm
+deltask do_package_write_ipk
+deltask do_package_write_deb
+deltask do_package_qa
+deltask do_packagedata
+deltask do_package_setscene
+deltask do_package_write_rpm_setscene
+deltask do_package_write_ipk_setscene
+deltask do_package_write_deb_setscene
+deltask do_package_qa_setscene
+deltask do_packagedata_setscene
+deltask do_spdx