CMake: Fix DESTDIR handling in SBOM checksum verification
The DESTDIR env var needs to be evaluated at install time, not
configure time, so the $ENV{} needs to be escaped in the generated
script.
Also improve the error message a bit, to say which path exactly it
expected to read.
This fixes SBOM generation for the debian package builds.
Task-number: QTBUG-122899
Change-Id: I6869f0054601dcb35ae7ad7b55f808df4dc12311
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 08d5d9e9da8a4815be7dd2c952cb45a6597cc077)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
bb10
parent
d81f226fd4
commit
8113dc73f0
|
|
@ -596,17 +596,18 @@ FileCopyrightText: NOASSERTION"
|
|||
endif()
|
||||
|
||||
set(content "
|
||||
if(NOT EXISTS $ENV{DESTDIR}${install_prefix}/${arg_FILENAME}
|
||||
if(NOT EXISTS \$ENV{DESTDIR}${install_prefix}/${arg_FILENAME}
|
||||
AND NOT QT_SBOM_BUILD_TIME AND NOT QT_SBOM_FAKE_CHECKSUM)
|
||||
if(NOT ${arg_OPTIONAL})
|
||||
message(FATAL_ERROR \"Cannot find ${arg_FILENAME}\")
|
||||
message(FATAL_ERROR \"Cannot find '${arg_FILENAME}' to compute its checksum. \"
|
||||
\"Expected to find it at '\$ENV{DESTDIR}${install_prefix}/${arg_FILENAME}' \")
|
||||
endif()
|
||||
else()
|
||||
if(NOT QT_SBOM_BUILD_TIME)
|
||||
if(QT_SBOM_FAKE_CHECKSUM)
|
||||
set(sha1 \"158942a783ee1095eafacaffd93de73edeadbeef\")
|
||||
else()
|
||||
file(SHA1 $ENV{DESTDIR}${install_prefix}/${arg_FILENAME} sha1)
|
||||
file(SHA1 \$ENV{DESTDIR}${install_prefix}/${arg_FILENAME} sha1)
|
||||
endif()
|
||||
list(APPEND QT_SBOM_VERIFICATION_CODES \${sha1})
|
||||
endif()
|
||||
|
|
|
|||
Loading…
Reference in New Issue