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:44:05 +0900
commitef787302e5714db847c7c2a9a642625d0f9cb962 (patch)
tree6cc760f6dcf34e50963940c2d52068f261224a0e
parentd9caafd4254e31f6dd127cadd66c80d8124fc5b4 (diff)
downloadmeta-spdxscanner-hardknott.tar.gz
meta-spdxscanner-hardknott.tar.bz2
meta-spdxscanner-hardknott.zip
Fix issue of Document Information.hardknott
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'])