Skip to content

Commit

Permalink
Refs #4768. Check for symbolic link not a file.
Browse files Browse the repository at this point in the history
Also added further protection for pruning against pruning empty
directories.
  • Loading branch information
martyngigg committed Feb 8, 2012
1 parent 0590673 commit fd61628
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions Code/Mantid/Build/CMake/LinuxSetup.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ file ( WRITE ${CMAKE_CURRENT_BINARY_DIR}/rpm_remove_all_links.sh "#!/bin/sh\n"
"if [ ! -f $RPM_INSTALL_PREFIX0/${PVPLUGINS_DIR}/libMantidParaViewSplatterPlotSMPlugin.so ];then\n"
" rm -f $RPM_INSTALL_PREFIX0/${BIN_DIR}/mantidplot\n"
"fi\n"
"if [ -f /etc/profile.d/mantid.sh ]; then\n"
"if [ -h /etc/profile.d/mantid.sh ]; then\n"
" rm /etc/profile.d/mantid.sh\n"
"fi\n"
"if [ -f /etc/profile.d/mantid.csh ]; then\n"
"if [ -h /etc/profile.d/mantid.csh ]; then\n"
" rm /etc/profile.d/mantid.csh\n"
"fi\n"
)
Expand All @@ -98,9 +98,14 @@ file ( WRITE ${CMAKE_CURRENT_BINARY_DIR}/rpm_remove_links.sh "#!/bin/sh\n"
)

file ( WRITE ${CMAKE_CURRENT_BINARY_DIR}/rpm_remove_empty_install.sh "#!/bin/sh\n"
"if [ ! -z \"$RPM_INSTALL_PREFIX0\" ]; then\n"
"# If the install prefix contains mantid then prune empty directories.\n"
"# Begin extra cautious here just in case some has set the something like Prefix=/usr\n"
"if echo \"$RPM_INSTALL_PREFIX0\" | grep -qi mantid; then\n"
" find $RPM_INSTALL_PREFIX0 -mindepth 1 -type d -empty -delete\n"
" rmdir --ignore-fail-on-non-empty -p $RPM_INSTALL_PREFIX0\n"
"else\n"
" echo Install prefix does not contain the word mantid. Empty directories NOT removed.\n"
" exit(1)\n"
"fi\n"
)

Expand Down

0 comments on commit fd61628

Please sign in to comment.