diff -Nru gitlab-8.13.11+dfsg/debian/changelog gitlab-8.13.11+dfsg/debian/changelog --- gitlab-8.13.11+dfsg/debian/changelog 2017-03-21 12:58:43.000000000 +0000 +++ gitlab-8.13.11+dfsg/debian/changelog 2017-03-23 11:46:50.000000000 +0000 @@ -1,3 +1,11 @@ +gitlab (8.13.11+dfsg-8) unstable; urgency=medium + + * Don't fail if gitlab-debian.defaults not found (to support upgrading + from older versions) + * Be more defensive in rm -rf + + -- Pirate Praveen Thu, 23 Mar 2017 17:16:50 +0530 + gitlab (8.13.11+dfsg-7) unstable; urgency=medium [ Balasankar C ] diff -Nru gitlab-8.13.11+dfsg/debian/postrm gitlab-8.13.11+dfsg/debian/postrm --- gitlab-8.13.11+dfsg/debian/postrm 2017-03-17 12:38:07.000000000 +0000 +++ gitlab-8.13.11+dfsg/debian/postrm 2017-03-23 11:44:33.000000000 +0000 @@ -19,7 +19,7 @@ # Read debian specific configuration test -f ${gitlab_debian_conf} && . ${gitlab_debian_conf} -. ${gitlab_debian_defaults} +test -f ${gitlab_debian_defaults} && . ${gitlab_debian_defaults} case "$1" in remove) @@ -48,16 +48,15 @@ # Check if we should remove data? db_get gitlab/purge if [ "${RET}" = "true" ]; then - rm -rf ${gitlab_data_dir}/shared - rm -rf ${gitlab_data_dir}/public - rm -rf ${gitlab_data_dir}/db - rm -rf ${gitlab_data_dir}/repositories - rm -rf ${gitlab_data_dir}/secrets.yml - rm -rf ${gitlab_data_dir}/Gemfile.lock - rm -rf ${gitlab_log_dir} - rm -rf ${gitlab_cache_path} - rm -rf ${gitlab_pid_path} - rm -rf ${gitlab_data_dir} + if [ -d ${gitlab_data_dir} ]; then + for i in shared public db repositories secrets.yml Gemfile.lock; do + test -e ${gitlab_data_dir}/$i && rm -rf ${gitlab_data_dir}/$i + done + fi + test -e ${gitlab_log_dir} && rm -rf ${gitlab_log_dir} + test -e ${gitlab_cache_path} && rm -rf ${gitlab_cache_path} + test -e ${gitlab_pid_path} && rm -rf ${gitlab_pid_path} + test -e ${gitlab_data_dir} && rm -rf ${gitlab_data_dir} if [ ! -z "${gitlab_user}" ]; then # Do only if gitlab_user is set if command -v dropdb >/dev/null; then