[DRE-commits] [gitlab] 01/02: check if gitlab_data_dir is empty as well

Praveen Arimbrathodiyil praveen at moszumanska.debian.org
Fri Apr 21 14:05:32 UTC 2017


This is an automated email from the git hooks/post-receive script.

praveen pushed a commit to branch master
in repository gitlab.

commit 9a257e780b9b5fb1af2af7c7f8ba7c0a43328a7c
Author: Praveen Arimbrathodiyil <praveen at debian.org>
Date:   Fri Apr 21 19:31:09 2017 +0530

    check if gitlab_data_dir is empty as well
---
 debian/postrm | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/debian/postrm b/debian/postrm
index 87340ef..b563fae 100644
--- a/debian/postrm
+++ b/debian/postrm
@@ -58,9 +58,11 @@ case "$1" in
       # Check if we should remove data?
       db_get gitlab/purge_data
       if [ "${RET}" = "true" ]; then
-        if [ -d ${gitlab_data_dir} ]; then
+        if [ -n "${gitlab_data_dir}" ] && [ -d ${gitlab_data_dir} ]; then
           for i in shared public db repositories secrets.yml Gemfile.lock; do
-            if [ -e ${gitlab_data_dir}/$i ]; then rm -rf ${gitlab_data_dir}/$i; fi
+            if [ -e ${gitlab_data_dir}/$i ]; then
+              echo "Removing: ${gitlab_data_dir}/$i"
+              rm -rf ${gitlab_data_dir}/$i; fi
           done
         fi
 	for i in ${gitlab_log_dir} ${gitlab_cache_path} ${gitlab_pid_path} \

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/gitlab.git



More information about the Pkg-ruby-extras-commits mailing list