From 4633f89217f2581aef8197c35f6e2a035af5c742 Mon Sep 17 00:00:00 2001 From: tuftedocelot Date: Wed, 29 Dec 2021 11:52:59 -0600 Subject: [PATCH] Meta: Use portable gzip option for extracting PCI and USB ID files gzip -c is supported in both Linux and BSD flavors of gzip. The -o flag was introduced in a previous commit which is present in OpenBSD, but not other flavors of Linux. -c will write to stdout which is redirected to the target files. As a side benefit, we no longer need to copy files anywhere --- CMakeLists.txt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ab356c3ed61..0b5bf1b9a17 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -270,8 +270,7 @@ endif() if(EXISTS ${PCI_IDS_GZ_PATH} AND NOT EXISTS ${PCI_IDS_INSTALL_PATH}) message(STATUS "Extracting PCI ID database from ${PCI_IDS_GZ_PATH}...") file(MAKE_DIRECTORY ${CMAKE_INSTALL_DATAROOTDIR}) - file(COPY ${PCI_IDS_GZ_PATH} DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}) - execute_process(COMMAND gzip -d -o ${PCI_IDS_INSTALL_PATH} ${CMAKE_INSTALL_DATAROOTDIR}/${PCI_IDS_FILE}.gz) + execute_process(COMMAND gzip -d -c "${PCI_IDS_GZ_PATH}" OUTPUT_FILE "${PCI_IDS_INSTALL_PATH}") endif() set(USB_IDS_FILE usb.ids) @@ -288,6 +287,5 @@ endif() if(EXISTS ${USB_IDS_GZ_PATH} AND NOT EXISTS ${USB_IDS_INSTALL_PATH}) message(STATUS "Extracting USB ID database from ${USB_IDS_GZ_PATH}...") file(MAKE_DIRECTORY ${CMAKE_INSTALL_DATAROOTDIR}) - file(COPY ${USB_IDS_GZ_PATH} DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}) - execute_process(COMMAND gzip -d -o ${USB_IDS_INSTALL_PATH} ${CMAKE_INSTALL_DATAROOTDIR}/${USB_IDS_FILE}.gz) + execute_process(COMMAND gzip -d -c "${USB_IDS_GZ_PATH}" OUTPUT_FILE "${USB_IDS_INSTALL_PATH}") endif()