summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortuftedocelot <tuftedocelot@fastmail.fm>2021-12-29 11:52:59 -0600
committerBrian Gianforcaro <b.gianfo@gmail.com>2021-12-29 15:03:47 -0800
commit4633f89217f2581aef8197c35f6e2a035af5c742 (patch)
treefcd29c2a11cc7ecd8fbd71f4fcf3a7fed0124ba0
parent018dc4bb5ca7f67ed5a0acb8d51c9310371a2267 (diff)
downloadserenity-4633f89217f2581aef8197c35f6e2a035af5c742.zip
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
-rw-r--r--CMakeLists.txt6
1 files changed, 2 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ab356c3ed6..0b5bf1b9a1 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()