Skip to content

Commit

Permalink
Merge pull request #106 from mantidproject/bugfix/10784_linux_startup…
Browse files Browse the repository at this point in the history
…_scripts

Re #10784. Removing links and regular files.
  • Loading branch information
martyngigg committed Dec 16, 2014
2 parents 3989148 + f2ae42f commit dbc21b4
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 30 deletions.
2 changes: 1 addition & 1 deletion Code/Mantid/Build/CMake/LinuxPackageScripts.cmake
Expand Up @@ -97,7 +97,7 @@ if ( "${UNIX_DIST}" MATCHES "RedHatEnterprise" OR "${UNIX_DIST}" MATCHES "^Fedor
${POST_INSTALL_FILE} @ONLY )
configure_file ( ${CMAKE_MODULE_PATH}/Packaging/rpm/scripts/rpm_pre_uninstall.sh.in
${PRE_UNINSTALL_FILE} @ONLY )
configure_file ( ${CMAKE_MODULE_PATH}/Packaging/rpm/scripts/rpm_post_install.sh.in
configure_file ( ${CMAKE_MODULE_PATH}/Packaging/rpm/scripts/rpm_post_uninstall.sh.in
${POST_UNINSTALL_FILE} @ONLY )
# CPack variables
set ( CPACK_RPM_PRE_INSTALL_SCRIPT_FILE ${PRE_INSTALL_FILE} )
Expand Down
Expand Up @@ -4,6 +4,25 @@
# If the installation directory is empty then it is removed
#

# Configured by CMake
ENVVARS_ON_INSTALL=@ENVVARS_ON_INSTALL_INT@

# Remove exe and links only if it looks like we were removed
# and not upgraded. If launch_mantidplot.sh exists then package
# has been upgraded and MantidPlot_exe replaced so don't touch anything
if [ ! -e $RPM_INSTALL_PREFIX0/@BIN_DIR@/launch_mantidplot.sh ]; then
rm $RPM_INSTALL_PREFIX0/@BIN_DIR@/MantidPlot_exe

if [ ${ENVVARS_ON_INSTALL} -eq 1 ]; then
if [ -h /etc/profile.d/mantid.sh ]; then
rm /etc/profile.d/mantid.sh
fi
if [ -h /etc/profile.d/mantid.csh ]; then
rm /etc/profile.d/mantid.csh
fi
fi
fi

# If the install prefix contains mantid then prune empty directories.
# Begin extra cautious here just in case some has set the something like Prefix=/usr
if echo \"$RPM_INSTALL_PREFIX0\" | grep -qi mantid; then
Expand Down
Expand Up @@ -6,16 +6,12 @@
#
ENVVARS_ON_INSTALL=@ENVVARS_ON_INSTALL_INT@

# Remove stale links if left around
if [ -h $RPM_INSTALL_PREFIX0/@BIN_DIR@/mantidplot ]; then
rm $RPM_INSTALL_PREFIX0/@BIN_DIR@/mantidplot
# Remove links
if [ -h $RPM_INSTALL_PREFIX0/@BIN_DIR@/mantidplot ]; then
rm $RPM_INSTALL_PREFIX0/@BIN_DIR@/mantidplot
fi
if [ -h $RPM_INSTALL_PREFIX0/@BIN_DIR@/MantidPlot ]; then
rm $RPM_INSTALL_PREFIX0/@BIN_DIR@/MantidPlot
fi
# Stale _exe
if [ -f @CMAKE_INSTALL_PREFIX@/@BIN_DIR@/MantidPlot_exe ]; then
rm $RPM_INSTALL_PREFIX0/@BIN_DIR@/MantidPlot_exe
if [ -h $RPM_INSTALL_PREFIX0/@BIN_DIR@/Mantidplot ]; then
rm $RPM_INSTALL_PREFIX0/@BIN_DIR@/Mantidplot
fi

if [ ${ENVVARS_ON_INSTALL} -eq 1 ]; then
Expand Down
@@ -1,25 +1,6 @@
#!/bin/sh
#
# RPM pre-uninstall script
# Remove links to mantidplot & /etc/profile.d
#

# Configured by CMake
ENVVARS_ON_INSTALL=@ENVVARS_ON_INSTALL_INT@

# Remove link and exe
if [ -h $RPM_INSTALL_PREFIX0/@BIN_DIR@/mantidplot ]; then
rm $RPM_INSTALL_PREFIX0/@BIN_DIR@/mantidplot
fi
if [ -f $RPM_INSTALL_PREFIX0/@BIN_DIR@/MantidPlot_exe ]; then
rm $RPM_INSTALL_PREFIX0/@BIN_DIR@/MantidPlot_exe
fi

if [ ${ENVVARS_ON_INSTALL} -eq 1 ]; then
if [ -h /etc/profile.d/mantid.sh ]; then
rm /etc/profile.d/mantid.sh
fi
if [ -h /etc/profile.d/mantid.csh ]; then
rm /etc/profile.d/mantid.csh
fi
fi
# Nothing needs to be done

0 comments on commit dbc21b4

Please sign in to comment.