[DRE-commits] [gitlab] 01/01: Check for gitlab_user before trying to delete

Balasankar C balasankarc-guest at moszumanska.debian.org
Fri Feb 24 06:04:04 UTC 2017


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

balasankarc-guest pushed a commit to branch master
in repository gitlab.

commit c160045850ba2c031c073098b3cc9b5c3ba23373
Author: Balasankar C <balasankarc at autistici.org>
Date:   Fri Feb 24 11:30:24 2017 +0530

    Check for gitlab_user before trying to delete
---
 debian/postrm | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/debian/postrm b/debian/postrm
index d0739ab..ddb07e6 100644
--- a/debian/postrm
+++ b/debian/postrm
@@ -53,12 +53,10 @@ case "$1" in
         rm -rf ${gitlab_log_dir}
         rm -rf ${gitlab_cache_path}
         rm -rf ${gitlab_pid_path}
-        # Don't fail if user is already removed
-        if [ -z "${gitlab_user}" ]; then
-            # If gitlab_user variable is unset or empty, use "gitlab" as default.
-            gitlab_user=gitlab
+        if [ ! -z "${gitlab_user}" ]; then
+            # Do only if gitlab_user is set
+            id -u ${gitlab_user} && userdel -r ${gitlab_user}
         fi
-        id -u ${gitlab_user} && userdel -r ${gitlab_user}
         rm -rf ${gitlab_data_dir}
         if [ -x /usr/bin/dropdb ]; then
             su ${gitlab_user} -c 'psql gitlab_production -c ""' && su postgres -c "dropdb gitlab_production"

-- 
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