[SCM] vlc/master: Check if directories exist before removing them

sramacher at users.alioth.debian.org sramacher at users.alioth.debian.org
Tue Dec 31 01:31:38 UTC 2013


The following commit has been merged in the master branch:
commit 3591ee6a4ccb60e560a40d11d09bba0414d6982c
Author: Sebastian Ramacher <sramacher at debian.org>
Date:   Tue Dec 31 02:25:25 2013 +0100

    Check if directories exist before removing them
    
    Closes: #732806

diff --git a/debian/vlc-data.postinst b/debian/vlc-data.postinst
index 0a3d0eb..2fc1f4f 100644
--- a/debian/vlc-data.postinst
+++ b/debian/vlc-data.postinst
@@ -3,11 +3,20 @@ set -e
 
 #DEBHELPER#
 
+check_and_remove() {
+	if test -d "$1"; then
+		rmdir --ignore-fail-on-non-empty "$1"
+	fi
+}
+
 case "$1" in
 	configure)
 		# Remove empty /etc/vlc directory (to work around bug #584185).
-		if dpkg --compare-versions "$2" le "2.1.1" && test -d "/etc/vlc"; then
-			rmdir --ignore-fail-on-non-empty /etc/vlc/lua/http/dialogs /etc/vlc/lua/http /etc/vlc/lua /etc/vlc
+		if dpkg --compare-versions "$2" le "2.1.1"; then
+			check_and_remove /etc/vlc/lua/http/dialogs
+			check_and_remove /etc/vlc/lua/http
+			check_and_remove /etc/vlc/lua
+			check_and_remove /etc/vlc
 		fi
 		;;
 esac

-- 
VLC media player packaging



More information about the pkg-multimedia-commits mailing list