Skip to content

Commit

Permalink
rename scripts to have extensions for automatic syntax highlighting
Browse files Browse the repository at this point in the history
python scripts do not have standard shebangs that editors can use
also fixes accidental creation of gufi_client_jail during make install
    gufi_jail should only exist on the server side
  • Loading branch information
calccrypto committed Nov 2, 2023
1 parent 4cfba13 commit d763681
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 13 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,11 @@ jobs:
coverage xml --omit="${{ github.workspace }}/build/contrib/hashes.py,${{ github.workspace }}/build/contrib/performance/performance_pkg/tests/*,${{ github.workspace }}/build/test/*,${{ github.workspace }}/build/test/regression/*,${{ github.workspace }}/build/test/unit/python/*"
rm .coverage # If not removed, codecov will attempt to run coverage xml which will not account for our omissions
# add extensions back to renamed files
for script in gufi_find gufi_getfattr gufi_ls gufi_stat gufi_stats
do
sed -i "s/filename=\"scripts\/${script}\"/filename=\"scripts\/${script}.py\"/g;" coverage.xml
done
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
Expand Down
29 changes: 16 additions & 13 deletions scripts/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,13 @@

cmake_minimum_required(VERSION 3.1.0)

# gufi_* scripts
# gufi_*.py scripts
set(TOOLS
find
getfattr
ls
stat
stats

jail # gufi_jail is used by sshd_config to prevent commands other than gufi_* from running
)

# python libraries installed into bin for convenience
Expand All @@ -82,32 +80,37 @@ set(LIBRARIES
if (CLIENT)
# add the paramiko source for installing
# keep the trailing / to rename the directory
install(DIRECTORY ${DEP_BUILD_PREFIX}/paramiko-master/ DESTINATION lib/GUFI/paramiko COMPONENT Client)
install(DIRECTORY "${DEP_BUILD_PREFIX}/paramiko-master/" DESTINATION lib/GUFI/paramiko COMPONENT Client)
endif()

foreach(TOOL ${TOOLS})
configure_file(gufi_${TOOL} gufi_${TOOL} @ONLY)
configure_file("gufi_${TOOL}.py" "gufi_${TOOL}" @ONLY)

install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/gufi_${TOOL} DESTINATION bin COMPONENT Server)
install(PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/gufi_${TOOL}" DESTINATION bin COMPONENT Server)

# when running make install, client files will not overwrite server files
# when building, client files WILL NOT overwrite server files
# when installing, client files WILL overwrite server files
if (CLIENT)
configure_file(gufi_client gufi_client_${TOOL} @ONLY)
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/gufi_client_${TOOL}
RENAME gufi_${TOOL}
configure_file("gufi_client.py" "gufi_client_${TOOL}" @ONLY)
install(PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/gufi_client_${TOOL}"
RENAME "gufi_${TOOL}"
DESTINATION bin
COMPONENT Client)
endif()
endforeach()

# gufi_jail is used by sshd_config to prevent commands other than gufi_* from running
configure_file(gufi_jail gufi_jail @ONLY)
install(PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/gufi_jail" DESTINATION bin COMPONENT Server)

foreach(LIB ${LIBRARIES})
configure_file(${LIB} ${LIB} @ONLY)
configure_file("${LIB}" "${LIB}" @ONLY)

install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${LIB} DESTINATION bin COMPONENT Server)
install(PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/${LIB}" DESTINATION bin COMPONENT Server)

# when running make install, client files will not overwrite server files
if (CLIENT)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${LIB} DESTINATION bin COMPONENT Client)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${LIB}" DESTINATION bin COMPONENT Client)
endif()
endforeach()

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit d763681

Please sign in to comment.