CPackComponentsDEB test: simplify if() arguments

This commit is contained in:
Rolf Eike Beer
2019-07-05 11:50:38 +02:00
parent 09cf052079
commit 3d11c63c9c
9 changed files with 43 additions and 43 deletions

View File

@@ -54,18 +54,18 @@ if(DPKGDEB_EXECUTABLE)
message(STATUS "package='${dpkg_package_name}', dependencies='${dpkg_depends}'")
if("${dpkg_package_name}" STREQUAL "mylib-applications")
if(NOT "${dpkg_depends}" STREQUAL "depend-application")
if(dpkg_package_name STREQUAL "mylib-applications")
if(NOT dpkg_depends STREQUAL "depend-application")
set(dpkgdeb_output_errors_all ${dpkgdeb_output_errors_all}
"dpkg-deb: ${_f}: Incorrect dependencies for package ${dpkg_package_name}: '${dpkg_depends}' != 'depend-application'\n")
endif()
elseif("${dpkg_package_name}" STREQUAL "mylib-headers")
if(NOT "${dpkg_depends}" STREQUAL "mylib-libraries (= 1.0.3), depend-headers")
elseif(dpkg_package_name STREQUAL "mylib-headers")
if(NOT dpkg_depends STREQUAL "mylib-libraries (= 1.0.3), depend-headers")
set(dpkgdeb_output_errors_all ${dpkgdeb_output_errors_all}
"dpkg-deb: ${_f}: Incorrect dependencies for package ${dpkg_package_name}: '${dpkg_depends}' != 'mylib-libraries (= 1.0.3), depend-headers'\n")
endif()
elseif("${dpkg_package_name}" STREQUAL "mylib-libraries")
if(NOT "${dpkg_depends}" STREQUAL "depend-default")
elseif(dpkg_package_name STREQUAL "mylib-libraries")
if(NOT dpkg_depends STREQUAL "depend-default")
set(dpkgdeb_output_errors_all ${dpkgdeb_output_errors_all}
"dpkg-deb: ${_f}: Incorrect dependencies for package ${dpkg_package_name}: '${dpkg_depends}' != 'depend-default'\n")
endif()
@@ -77,7 +77,7 @@ if(DPKGDEB_EXECUTABLE)
endforeach()
if(NOT "${dpkgdeb_output_errors_all}" STREQUAL "")
if(NOT dpkgdeb_output_errors_all STREQUAL "")
message(FATAL_ERROR "dpkg-deb checks failed:\n${dpkgdeb_output_errors_all}")
endif()
else()

View File

@@ -54,7 +54,7 @@ if(DPKGDEB_EXECUTABLE)
message(STATUS "package='${dpkg_package_name}', dependencies='${dpkg_depends}'")
if("${dpkg_package_name}" STREQUAL "mylib-applications")
if(dpkg_package_name STREQUAL "mylib-applications")
find_program(DPKG_SHLIBDEP_EXECUTABLE dpkg-shlibdeps)
if(DPKG_SHLIBDEP_EXECUTABLE)
string(FIND "${dpkg_depends}" "lib" index_libwhatever)
@@ -72,13 +72,13 @@ if(DPKGDEB_EXECUTABLE)
set(dpkgdeb_output_errors_all "${dpkgdeb_output_errors_all}"
"dpkg-deb: ${_f}: Incorrect dependencies for package ${dpkg_package_name}: '${dpkg_depends}' does contains 'depend-default'\n")
endif()
elseif("${dpkg_package_name}" STREQUAL "mylib-headers")
if(NOT "${dpkg_depends}" STREQUAL "mylib-libraries (= 1.0.3), depend-headers")
elseif(dpkg_package_name STREQUAL "mylib-headers")
if(NOT dpkg_depends STREQUAL "mylib-libraries (= 1.0.3), depend-headers")
set(dpkgdeb_output_errors_all "${dpkgdeb_output_errors_all}"
"dpkg-deb: ${_f}: Incorrect dependencies for package ${dpkg_package_name}: '${dpkg_depends}' != 'mylib-libraries (= 1.0.3), depend-headers'\n")
endif()
elseif("${dpkg_package_name}" STREQUAL "mylib-libraries")
if(NOT "${dpkg_depends}" STREQUAL "depend-default")
elseif(dpkg_package_name STREQUAL "mylib-libraries")
if(NOT dpkg_depends STREQUAL "depend-default")
set(dpkgdeb_output_errors_all "${dpkgdeb_output_errors_all}"
"dpkg-deb: ${_f}: Incorrect dependencies for package ${dpkg_package_name}: '${dpkg_depends}' != 'depend-default'\n")
endif()
@@ -89,7 +89,7 @@ if(DPKGDEB_EXECUTABLE)
endforeach()
if(NOT "${dpkgdeb_output_errors_all}" STREQUAL "")
if(NOT dpkgdeb_output_errors_all STREQUAL "")
message(FATAL_ERROR "dpkg-deb checks failed:\n${dpkgdeb_output_errors_all}")
endif()
else()

View File

@@ -54,18 +54,18 @@ if(DPKGDEB_EXECUTABLE)
message(STATUS "package='${dpkg_package_name}', description='${dpkg_description}'")
if("${dpkg_package_name}" STREQUAL "mylib-applications")
if(dpkg_package_name STREQUAL "mylib-applications")
if(NOT "${dpkg_description}" STREQUAL "applications_description")
set(dpkgdeb_output_errors_all ${dpkgdeb_output_errors_all}
"dpkg-deb: ${_f}: Incorrect description for package ${dpkg_package_name}: ${dpkg_description} != applications_description")
endif()
elseif("${dpkg_package_name}" STREQUAL "mylib-headers")
if(NOT "${dpkg_description}" STREQUAL "headers_description")
elseif(dpkg_package_name STREQUAL "mylib-headers")
if(NOT dpkg_description STREQUAL "headers_description")
set(dpkgdeb_output_errors_all ${dpkgdeb_output_errors_all}
"dpkg-deb: ${_f}: Incorrect description for package ${dpkg_package_name}: ${dpkg_description} != headers_description")
endif()
elseif("${dpkg_package_name}" STREQUAL "mylib-libraries")
if(NOT "${dpkg_description}" STREQUAL "main description")
elseif(dpkg_package_name STREQUAL "mylib-libraries")
if(NOT dpkg_description STREQUAL "main description")
set(dpkgdeb_output_errors_all ${dpkgdeb_output_errors_all}
"dpkg-deb: ${_f}: Incorrect description for package ${dpkg_package_name}: ${dpkg_description} != 'main description'")
endif()
@@ -77,7 +77,7 @@ if(DPKGDEB_EXECUTABLE)
endforeach()
if(NOT "${dpkgdeb_output_errors_all}" STREQUAL "")
if(NOT dpkgdeb_output_errors_all STREQUAL "")
message(FATAL_ERROR "dpkg-deb checks failed:\n${dpkgdeb_output_errors_all}")
endif()
else()

View File

@@ -54,18 +54,18 @@ if(DPKGDEB_EXECUTABLE)
message(STATUS "package='${dpkg_package_name}', description='${dpkg_description}'")
if("${dpkg_package_name}" STREQUAL "mylib-applications")
if(NOT "${dpkg_description}" STREQUAL "main description 2")
if(dpkg_package_name STREQUAL "mylib-applications")
if(NOT dpkg_description STREQUAL "main description 2")
set(dpkgdeb_output_errors_all ${dpkgdeb_output_errors_all}
"dpkg-deb: ${_f}: Incorrect description for package ${dpkg_package_name}: ${dpkg_description} != applications_description")
endif()
elseif("${dpkg_package_name}" STREQUAL "mylib-headers")
if(NOT "${dpkg_description}" STREQUAL "main description 2")
elseif(dpkg_package_name STREQUAL "mylib-headers")
if(NOT dpkg_description STREQUAL "main description 2")
set(dpkgdeb_output_errors_all ${dpkgdeb_output_errors_all}
"dpkg-deb: ${_f}: Incorrect description for package ${dpkg_package_name}: ${dpkg_description} != headers_description")
endif()
elseif("${dpkg_package_name}" STREQUAL "mylib-libraries")
if(NOT "${dpkg_description}" STREQUAL "library description")
elseif(dpkg_package_name STREQUAL "mylib-libraries")
if(NOT dpkg_description STREQUAL "library description")
set(dpkgdeb_output_errors_all ${dpkgdeb_output_errors_all}
"dpkg-deb: ${_f}: Incorrect description for package ${dpkg_package_name}: ${dpkg_description} != 'main description'")
endif()
@@ -77,7 +77,7 @@ if(DPKGDEB_EXECUTABLE)
endforeach()
if(NOT "${dpkgdeb_output_errors_all}" STREQUAL "")
if(NOT dpkgdeb_output_errors_all STREQUAL "")
message(FATAL_ERROR "dpkg-deb checks failed:\n${dpkgdeb_output_errors_all}")
endif()
else()

View File

@@ -44,7 +44,7 @@ if(LINTIAN_EXECUTABLE)
string(APPEND lintian_output_errors_all "${lintian_output_errors}")
endforeach()
if(NOT "${lintian_output_errors_all}" STREQUAL "")
if(NOT lintian_output_errors_all STREQUAL "")
message(FATAL_ERROR "Lintian checks failed:\n${lintian_output_errors_all}")
endif()
else()
@@ -64,13 +64,13 @@ if(DPKGDEB_EXECUTABLE)
DPKGDEB_OUTPUT "${dpkg_output}"
METAENTRY "Maintainer:")
if(NOT "${dpkgentry}" STREQUAL "None")
if(NOT dpkgentry STREQUAL "None")
set(dpkgdeb_output_errors_all "${dpkgdeb_output_errors_all}"
"dpkg-deb: ${_f}: Incorrect value for Maintainer: ${dpkgentry} != None\n")
endif()
endforeach()
if(NOT "${dpkgdeb_output_errors_all}" STREQUAL "")
if(NOT dpkgdeb_output_errors_all STREQUAL "")
message(FATAL_ERROR "dpkg-deb checks failed:\n${dpkgdeb_output_errors_all}")
endif()
else()

View File

@@ -39,7 +39,7 @@ endif()
# dpkg-deb checks for the summary of the packages
find_program(DPKGDEB_EXECUTABLE dpkg-deb)
if(DPKGDEB_EXECUTABLE)
set(dpkgdeb_output_errors_all)
set(dpkgdeb_output_errors_all "")
foreach(_f IN LISTS actual_output)
# extracts the metadata from the package
@@ -53,11 +53,11 @@ if(DPKGDEB_EXECUTABLE)
message(STATUS "package='${dpkg_package_name}'")
if("${dpkg_package_name}" STREQUAL "mylib-applications")
if(dpkg_package_name STREQUAL "mylib-applications")
# pass
elseif("${dpkg_package_name}" STREQUAL "mylib-headers")
elseif(dpkg_package_name STREQUAL "mylib-headers")
# pass
elseif("${dpkg_package_name}" STREQUAL "mylib-libraries")
elseif(dpkg_package_name STREQUAL "mylib-libraries")
# pass
else()
set(dpkgdeb_output_errors_all ${dpkgdeb_output_errors_all}
@@ -67,7 +67,7 @@ if(DPKGDEB_EXECUTABLE)
endforeach()
if(NOT "${dpkgdeb_output_errors_all}" STREQUAL "")
if(NOT dpkgdeb_output_errors_all STREQUAL "")
message(FATAL_ERROR "dpkg-deb checks failed:\n${dpkgdeb_output_errors_all}")
endif()
else()

View File

@@ -54,20 +54,20 @@ if(DPKGDEB_EXECUTABLE)
message(STATUS "package='${_f}', source='${dpkg_package_source}'")
if(NOT ("${dpkg_package_name}" STREQUAL "mylib-applications"))
if(NOT ("${dpkg_package_source}" STREQUAL "test-source"))
if(NOT dpkg_package_name STREQUAL "mylib-applications")
if(NOT dpkg_package_source STREQUAL "test-source")
set(dpkgdeb_output_errors_all "${dpkgdeb_output_errors_all}"
"dpkg-deb: ${_f}: Incorrect source for package '${dpkg_package_name}': '${dpkg_package_source}' instead of 'test-source'\n")
endif()
else()
if(NOT ("${dpkg_package_source}" STREQUAL "test-other-source"))
if(NOT dpkg_package_source STREQUAL "test-other-source")
set(dpkgdeb_output_errors_all "${dpkgdeb_output_errors_all}"
"dpkg-deb: ${_f}: Incorrect source for package '${dpkg_package_name}': '${dpkg_package_source}' instead of 'test-other-source'\n")
endif()
endif()
endforeach()
if(NOT "${dpkgdeb_output_errors_all}" STREQUAL "")
if(NOT dpkgdeb_output_errors_all STREQUAL "")
message(FATAL_ERROR "dpkg-deb checks failed:\n${dpkgdeb_output_errors_all}")
endif()
else()

View File

@@ -40,13 +40,13 @@ if(DPKGDEB_EXECUTABLE)
)
# message(FATAL_ERROR "output = '${dpkg_output}'")
if("${dpkg_output}" STREQUAL "")
if(dpkg_output STREQUAL "")
set(dpkgdeb_output_errors_all "${dpkgdeb_output_errors_all}"
"dpkg-deb: ${_f}: empty content returned by dpkg-deb")
endif()
endforeach()
if(NOT "${dpkgdeb_output_errors_all}" STREQUAL "")
if(NOT dpkgdeb_output_errors_all STREQUAL "")
message(FATAL_ERROR "dpkg-deb checks failed:\n${dpkgdeb_output_errors_all}")
endif()
else()

View File

@@ -119,13 +119,13 @@ function(lintian_check_specific_errors output_errors)
# regex to avoid
foreach(_s IN LISTS lintian_check_specific_errors_deb_ERROR_REGEX_STRINGS)
if("${_s}" STREQUAL "")
if(_s STREQUAL "")
continue()
endif()
string(REGEX MATCHALL "${_s}" "_TMP_CHECK_ERROR" "${lintian_output}")
if(NOT "${_TMP_CHECK_ERROR}" STREQUAL "")
if(NOT _TMP_CHECK_ERROR STREQUAL "")
string(APPEND ERROR_ACC "\nlintian: ${_f}: output contains an undesirable regex:\n\t${_TMP_CHECK_ERROR}")
endif()
endforeach()
@@ -167,7 +167,7 @@ function(run_dpkgdeb dpkg_deb_output)
ERROR_VARIABLE DPKGDEB_ERROR
OUTPUT_STRIP_TRAILING_WHITESPACE )
if(NOT ("${DPKGDEB_RESULT}" EQUAL "0"))
if(NOT DPKGDEB_RESULT EQUAL "0")
message(FATAL_ERROR "Error '${DPKGDEB_RESULT}' returned by dpkg-deb: '${DPKGDEB_ERROR}'")
endif()