aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLei Maohui <leimaohui@fujitsu.com>2021-08-18 09:40:40 +0900
committerLei Maohui <leimaohui@fujitsu.com>2021-08-18 09:40:40 +0900
commit6adb6fc3ab547928c60ee382bddd555fc3ef33f7 (patch)
treecda6b47c79c9c42a3026604b7328249976d2c0fb
parent11b6b946b20207311b272618bc299eb4b56e9353 (diff)
downloadmeta-spdxscanner-6adb6fc3ab547928c60ee382bddd555fc3ef33f7.zip
meta-spdxscanner-6adb6fc3ab547928c60ee382bddd555fc3ef33f7.tar.gz
meta-spdxscanner-6adb6fc3ab547928c60ee382bddd555fc3ef33f7.tar.bz2
Fix issue of Document Information.
Signed-off-by: Lei Maohui <leimaohui@fujitsu.com>
-rw-r--r--classes/spdx-common.bbclass9
1 files changed, 6 insertions, 3 deletions
diff --git a/classes/spdx-common.bbclass b/classes/spdx-common.bbclass
index 58112ce..4584b3d 100644
--- a/classes/spdx-common.bbclass
+++ b/classes/spdx-common.bbclass
@@ -276,13 +276,16 @@ def write_cached_spdx( info,sstatefile, ver_code ):
## Delet ^M in doc format
subprocess.call("sed -i -e 's#\r##g' %s" % sstatefile, shell=True)
+
## Document level information
+ subprocess.call("sed -i '/SPDXID: SPDXRef-DOCUMENT/d' %s" % sstatefile, shell=True)
+ subprocess.call("sed -i '/DocumentName: \/srv\/fossology\/repository\/report/d' %s" % sstatefile, shell=True)
+ subprocess.call("sed -i '/DocumentNamespace: http:/i SPDXID: SPDXRef-DOCUMENT' %s" % sstatefile, shell=True)
+
sed_cmd = r"sed -i "
spdx_DocumentComment = "<text>SPDX for " + info['pn'] + " version " \
+ info['pv'] + "</text>"
- sed_cmd = sed_replace(sed_cmd,"DocumentComment: ",spdx_DocumentComment)
- sed_cmd = sed_insert(sed_cmd,"SPDXID:","DocumentName: " + info['pn']+"-"+info['pv'])
- sed_cmd = sed_insert(sed_cmd,"SPDXID:","DocumentNamespace: http://spdx.org/spdxdocs/SPDXRef-" + info['creator']['Tool']+"-"+info['pn']+"_"+info['pv'])
+ sed_cmd = sed_insert(sed_cmd,"SPDXID: SPDXRef-DOCUMENT","DocumentName: " + info['pn']+"-"+info['pv'])
## Creator information
sed_cmd = sed_replace(sed_cmd,"Creator: Tool: ",info['creator']['Tool'])