File tree Expand file tree Collapse file tree 2 files changed +19
-4
lines changed Expand file tree Collapse file tree 2 files changed +19
-4
lines changed Original file line number Diff line number Diff line change 11<?xml version =" 1.0" encoding =" UTF-8" ?>
22<schema elementFormDefault =" qualified" xmlns =" http://www.w3.org/2001/XMLSchema" >
33 <import namespace =" http://cyclonedx.org/schema/spdx" schemaLocation =" spdx.xsd" />
4- <import namespace =" http://cyclonedx.org/schema/bom/1.2 " schemaLocation =" cyclonedx.xsd" />
4+ <import namespace =" http://cyclonedx.org/schema/bom/1.3 " schemaLocation =" cyclonedx.xsd" />
55</schema >
Original file line number Diff line number Diff line change 3030 fi
3131done
3232
33+ SYFT_VERSION=$( syft version | grep ' ^Version' | tr -s ' ' | cut -d' ' -f2)
34+ compare_version () {
35+ local x=$1
36+ first=${x%% .* } # Delete first dot and what follows.
37+ last=${x##* .} # Delete up to last dot.
38+ mid=${x## " $first " .} # Delete first number and dot.
39+ mid=${mid%% ." $last " } # Delete dot and last number.
40+ if [ " $mid " -lt 34 ]
41+ then
42+ echo >&2 " syft must be at least version 0.34.0"
43+ exit 10
44+ fi
45+ }
46+ compare_version " ${SYFT_VERSION} "
47+
3348set -e
3449set -u
3550
@@ -68,7 +83,7 @@ URL=https://app.rkvst.io
6883usage () {
6984 cat >&2 << EOF
7085
71- Create a Cyclone DX 1.2 XML SBOM from a docker image and upload to RKVST SBOM Hub
86+ Create a Cyclone DX 1.3 XML SBOM from a docker image and upload to RKVST SBOM Hub
7287
7388Usage: $SCRIPTNAME [-a AUTHOR_NAME] [-A COMPONENT_AUTHOR] [-c CLIENT_SECRET_FILE] [-e AUTHOR_EMAIL] [-sp] [-u URL] CLIENT_ID [docker-image:tag|sbom file|jar URL]
7489
@@ -284,8 +299,8 @@ def indent(elem, level=0):
284299 if level and (not elem.tail or not elem.tail.strip()):
285300 elem.tail = i
286301
287- ET.register_namespace('', 'http://cyclonedx.org/schema/bom/1.2 ')
288- ns = {'': 'http://cyclonedx.org/schema/bom/1.2 '}
302+ ET.register_namespace('', 'http://cyclonedx.org/schema/bom/1.3 ')
303+ ns = {'': 'http://cyclonedx.org/schema/bom/1.3 '}
289304
290305# Open original file
291306et = ET.parse(sys.stdin)
You can’t perform that action at this time.
0 commit comments