Skip to content

Commit

Permalink
Automatic snapshot commit from tribits at 4b335ea
Browse files Browse the repository at this point in the history
Origin repo remote tracking branch: 'github/master'
Origin repo remote repo URL: 'github = git@github.com:TriBITSPub/TriBITS.git'

At commit:

commit 4b335ea765597db4f0bf3e77f7e0c90891635ef4
Author:  Roscoe A. Bartlett <rabartl@sandia.gov>
Date:    Fri May 1 11:55:06 2020 -0600
Summary: Implement check for non-owning base dir (trilinos#314)
  • Loading branch information
bartlettroscoe committed May 1, 2020
1 parent 1ee206f commit 244b331
Showing 1 changed file with 27 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ SET(projectSubdirPathsArray "@PROJECT_SUBDIR_PATHS_ARRAY@")
SET(PROJECT_MAKE_INSTALL_GROUP "@PROJECT_MAKE_INSTALL_GROUP@")
SET(PROJECT_MAKE_INSTALL_PERMS_CHANGE "@PROJECT_MAKE_INSTALL_PERMS_CHANGE@")

#
# Helper functions
#

SET(CHMOD_CHGRP_IDX 0)

Expand All @@ -26,25 +28,43 @@ ENDFUNCTION()

FUNCTION(SET_DIR_OWNER_AND_PERMS dirPath recurseFlag)

IF (NOT "${PROJECT_MAKE_INSTALL_GROUP}" STREQUAL "")
ECHO_AND_RUN_CMND(
chgrp ${PROJECT_MAKE_INSTALL_GROUP} ${recurseFlag} "${dirPath}")
ENDIF()
EXECUTE_PROCESS(COMMAND stat -c %U "${dirPath}"
OUTPUT_STRIP_TRAILING_WHITESPACE
OUTPUT_VARIABLE dirOwner)

IF (NOT "${dirOwner}" STREQUAL "${CURRENT_USER_RUNNING_INSTALL}")

MESSAGE(STATUS "${CHMOD_CHGRP_IDX}: NOTE: Not calling chgrp and chmod on ${dirPath} since owner '${dirOwner}' != current owner '${CURRENT_USER_RUNNING_INSTALL}'!")

ELSE()

IF (NOT "${PROJECT_MAKE_INSTALL_GROUP}" STREQUAL "")
ECHO_AND_RUN_CMND(
chgrp ${PROJECT_MAKE_INSTALL_GROUP} ${recurseFlag} "${dirPath}")
ENDIF()

IF (NOT "${PROJECT_MAKE_INSTALL_PERMS_CHANGE}" STREQUAL "")
ECHO_AND_RUN_CMND(
chmod ${PROJECT_MAKE_INSTALL_PERMS_CHANGE} ${recurseFlag} "${dirPath}")
ENDIF()

IF (NOT "${PROJECT_MAKE_INSTALL_PERMS_CHANGE}" STREQUAL "")
ECHO_AND_RUN_CMND(
chmod ${PROJECT_MAKE_INSTALL_PERMS_CHANGE} ${recurseFlag} "${dirPath}")
ENDIF()

MATH(EXPR CHMOD_CHGRP_IDX "${CHMOD_CHGRP_IDX}+1")
SET(CHMOD_CHGRP_IDX ${CHMOD_CHGRP_IDX} PARENT_SCOPE)

ENDFUNCTION()

#
# Executable script
#

IF (EXISTS "${projectInstallBaseDir}")

EXECUTE_PROCESS(COMMAND whoami
OUTPUT_STRIP_TRAILING_WHITESPACE
OUTPUT_VARIABLE CURRENT_USER_RUNNING_INSTALL)

LIST(LENGTH projectSubdirPathsArray numSubDirs)

# Get projectSubdirPathsArrayLessOne and CMAKE_INSTALL_PREFIX
Expand Down

0 comments on commit 244b331

Please sign in to comment.