[debian-edu-commits] debian-edu/pkg-team/ 04/07: debian/gosa.post*: Use proper if clause for conditions. This assures that the postinst/postrm scripts do not fail if any of the conditions is not met.

Mike Gabriel sunweaver at debian.org
Fri Feb 12 10:12:50 UTC 2016


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

sunweaver pushed a commit to branch master
in repository gosa.

commit 88050c6b7e904bef2dacd87eba45b29eba635c84
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date:   Fri Feb 12 09:40:07 2016 +0100

    debian/gosa.post*: Use proper if clause for conditions. This assures that the postinst/postrm scripts do not fail if any of the conditions is not met.
---
 debian/gosa.postinst | 4 ++--
 debian/gosa.postrm   | 8 ++++----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/debian/gosa.postinst b/debian/gosa.postinst
index 984e7b7..0f5fa0f 100755
--- a/debian/gosa.postinst
+++ b/debian/gosa.postinst
@@ -136,11 +136,11 @@ if [ -d /etc/lighttpd/conf-available ]; then
 fi
 
 # Add links for safe mode
-[ ! -d /usr/share/gosa/bin ] && mkdir -p /usr/share/gosa/bin
+if [ ! -d /usr/share/gosa/bin ]; then mkdir -p /usr/share/gosa/bin; fi
 for source in "$(which convert)" "$(which lpstat)"; do
 	if [ -n "$source" ]; then
 		target=/usr/share/gosa/bin/${source##*/}
-		[ ! -L $target ] && ln -sf $source $target
+		if [ ! -L $target ]; then ln -sf $source $target; fi
 	fi
 done
 
diff --git a/debian/gosa.postrm b/debian/gosa.postrm
index cb75e52..8b14745 100755
--- a/debian/gosa.postrm
+++ b/debian/gosa.postrm
@@ -15,10 +15,10 @@ case "$1" in
 			rm -Rf /var/cache/gosa
 		fi
 
-		[ -e /etc/gosa/gosa.secrets ] && rm /etc/gosa/gosa.secrets
-		[ -e /usr/share/gosa/html/themes/default/images/img.png ] && rm /usr/share/gosa/html/themes/default/images/img.png
-		[ -e /usr/share/gosa/ihtml/themes/default/img.styles ] && rm /usr/share/gosa/ihtml/themes/default/img.styles
-		find /usr/share/gosa -depth -type d -empty -exec rmdir "{}" \;
+		if [ -e /etc/gosa/gosa.secrets ]; then rm /etc/gosa/gosa.secrets; fi
+		if [ -e /usr/share/gosa/html/themes/default/images/img.png ]; then rm /usr/share/gosa/html/themes/default/images/img.png; fi
+		if [ -e /usr/share/gosa/ihtml/themes/default/img.styles ]; then rm /usr/share/gosa/ihtml/themes/default/img.styles; fi
+		if [ -d /usr/share/gosa ]; then find /usr/share/gosa -depth -type d -empty -exec rmdir "{}" \;; fi
 	;;
 
 	remove|purge)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-edu/pkg-team/gosa.git



More information about the debian-edu-commits mailing list