Repository: madlib
Updated Branches:
  refs/heads/master 5f80ba978 -> a47cd1ff5


Build: Remove symlinks during rpm uninstall

JIRA: MADLIB-1175

`rpm --install` creates three symlinks to `Versions/`, `.../bin`, and
`.../doc`. These symlinks should be deleted during `rpm --erase`.
Additionally, we also delete `Versions/` if it is empty after the erase.

Closes #286

Co-Authored-by: Arvind Sridhar <asrid...@pivotal.io>


Project: http://git-wip-us.apache.org/repos/asf/madlib/repo
Commit: http://git-wip-us.apache.org/repos/asf/madlib/commit/ac4a51f0
Tree: http://git-wip-us.apache.org/repos/asf/madlib/tree/ac4a51f0
Diff: http://git-wip-us.apache.org/repos/asf/madlib/diff/ac4a51f0

Branch: refs/heads/master
Commit: ac4a51f0a8aacd72f884f6cebb27f43b19948ccd
Parents: 5f80ba9
Author: Rahul Iyer <ri...@apache.org>
Authored: Tue Jul 3 12:02:55 2018 -0700
Committer: Rahul Iyer <ri...@apache.org>
Committed: Thu Jul 12 13:28:54 2018 -0700

----------------------------------------------------------------------
 deploy/CMakeLists.txt        |  1 +
 deploy/rpm_post_uninstall.sh | 26 ++++++++++++++++++++++++++
 2 files changed, 27 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/madlib/blob/ac4a51f0/deploy/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/deploy/CMakeLists.txt b/deploy/CMakeLists.txt
index 32023bd..f8000df 100644
--- a/deploy/CMakeLists.txt
+++ b/deploy/CMakeLists.txt
@@ -54,6 +54,7 @@ add_subdirectory(gppkg)
 # -- Finally do the packaging! 
-------------------------------------------------
 
 set(CPACK_RPM_POST_INSTALL_SCRIPT_FILE 
"${CMAKE_CURRENT_SOURCE_DIR}/rpm_post.sh")
+set(CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE 
"${CMAKE_CURRENT_SOURCE_DIR}/rpm_post_uninstall.sh")
 set(CPACK_PREFLIGHT_SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/preflight.sh)
 set(CPACK_POSTFLIGHT_SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/postflight.sh)
 set(CPACK_MONOLITHIC_INSTALL 1)

http://git-wip-us.apache.org/repos/asf/madlib/blob/ac4a51f0/deploy/rpm_post_uninstall.sh
----------------------------------------------------------------------
diff --git a/deploy/rpm_post_uninstall.sh b/deploy/rpm_post_uninstall.sh
new file mode 100755
index 0000000..c67fd34
--- /dev/null
+++ b/deploy/rpm_post_uninstall.sh
@@ -0,0 +1,26 @@
+# coding=utf-8
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# remove symlinks created during rpm install
+find $RPM_INSTALL_PREFIX/madlib/Current -depth -type l -exec rm {} \; 
2>/dev/null
+find $RPM_INSTALL_PREFIX/madlib/bin -depth -type l -exec rm {} \; 2>/dev/null
+find $RPM_INSTALL_PREFIX/madlib/doc -depth -type l -exec rm {} \; 2>/dev/null
+
+# remove "Versions" directory if it's empty
+rmdir $RPM_INSTALL_PREFIX/madlib/Versions 2>/dev/null

Reply via email to