mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-11 13:36:13 +03:00
Meta: Refactor FLAC spec test extraction with extract_tar_path
This commit is contained in:
parent
a6dd992ad3
commit
d3d93ef1df
Notes:
sideshowbarker
2024-07-16 22:42:59 +09:00
Author: https://github.com/kleinesfilmroellchen Commit: https://github.com/SerenityOS/serenity/commit/d3d93ef1df Pull-request: https://github.com/SerenityOS/serenity/pull/16937 Issue: https://github.com/SerenityOS/serenity/issues/14683 Reviewed-by: https://github.com/linusg ✅
@ -13,17 +13,13 @@ if(INCLUDE_FLAC_SPEC_TESTS)
|
||||
set(FLAC_SPEC_TEST_PATH ${FLAC_TEST_PATH}/SpecTests)
|
||||
|
||||
if(NOT EXISTS ${FLAC_SPEC_TEST_GZ_PATH})
|
||||
message(STATUS "Downloading the IETF CELLAR FLAC testsuite from ${FLAC_SPEC_TEST_GZ_URL}...")
|
||||
message(STATUS "Downloading the IETF CELLAR FLAC testsuite...")
|
||||
download_file(${FLAC_SPEC_TEST_GZ_URL} ${FLAC_SPEC_TEST_GZ_PATH})
|
||||
endif()
|
||||
|
||||
if(EXISTS ${FLAC_SPEC_TEST_GZ_PATH} AND NOT EXISTS ${FLAC_SPEC_TEST_PATH})
|
||||
file(MAKE_DIRECTORY ${FLAC_SPEC_TEST_PATH})
|
||||
message(STATUS "Extracting the FLAC testsuite from ${FLAC_SPEC_TEST_GZ_PATH}...")
|
||||
execute_process(COMMAND "${TAR_TOOL}" -xzf ${FLAC_SPEC_TEST_GZ_PATH} -C ${FLAC_TEST_PATH} RESULT_VARIABLE tar_result)
|
||||
if (NOT tar_result EQUAL 0)
|
||||
message(FATAL_ERROR "Failed to unzip ${FLAC_TEST_PATH} from ${FLAC_SPEC_TEST_GZ_PATH} with status ${tar_result}")
|
||||
endif()
|
||||
extract_tar_path(${FLAC_TEST_PATH} ${FLAC_SPEC_TEST_GZ_PATH} "flac-test-files-main/subset/*.flac" ${FLAC_SPEC_TEST_PATH})
|
||||
file(RENAME "${FLAC_TEST_PATH}/flac-test-files-main/subset" ${FLAC_SPEC_TEST_PATH})
|
||||
file(REMOVE "${FLAC_TEST_PATH}/flac-test-files-main")
|
||||
endif()
|
||||
endif()
|
||||
|
Loading…
Reference in New Issue
Block a user