Package: davfs2
Version: 1.5.2-1
Severity: normal
Tags: patch
User: [email protected]
Usertags: usrmerge

The package installs a symbolic link and a file with the same name in
both /sbin/ and /usr/sbin/, so it makes impossible to convert a system
to the everything-in-usr directories scheme.

The attached patch solves this problem by creating the link in postinst
and only if it is needed.

For more information about everything-in-usr please read
http://anonscm.debian.org/cgit/users/md/usrmerge.git/tree/debian/README.Debian

-- 
ciao,
Marco
diff -urpN a/debian/postinst b/debian/postinst
--- a/debian/postinst	2012-07-14 08:22:58.000000000 +0200
+++ b/debian/postinst	2014-11-02 15:34:40.000000000 +0100
@@ -31,6 +31,12 @@ case "$1" in
         chown root:davfs2 /var/run/mount.davfs > /dev/null 2>&1 || true
         chmod 775 /var/cache/davfs2 > /dev/null 2>&1 || true
         chmod 1775 /var/run/mount.davfs > /dev/null 2>&1 || true
+
+        for file in mount.davfs umount.davfs; do
+            if [ ! -e /sbin/$file ]; then
+        	ln -s /usr/sbin/$file /sbin/$file
+            fi
+        done
     ;;
 esac
 #DEBHELPER#
diff -urpN a/debian/postrm b/debian/postrm
--- a/debian/postrm	2014-05-29 13:15:35.000000000 +0200
+++ b/debian/postrm	2014-11-02 15:35:30.000000000 +0100
@@ -48,5 +48,12 @@ if [ "$1" = "purge" ]; then
          fi
        fi
 fi
+if [ "$1" = "remove" ]; then
+    for file in mount.davfs umount.davfs; do
+        if [ -L /sbin/$file ]; then
+            rm /sbin/$file
+        fi
+    done
+fi
 #DEBHELPER#
 exit 0
diff -urpN a/debian/rules b/debian/rules
--- a/debian/rules	2014-05-29 15:35:05.000000000 +0200
+++ b/debian/rules	2014-11-02 15:32:40.000000000 +0100
@@ -58,7 +58,6 @@ binary-arch: install build install6 buil
 	dh_installchangelogs ChangeLog
 	dh_installdocs
 	dh_installman
-	dh_link usr/sbin/mount.davfs sbin/mount.davfs usr/sbin/umount.davfs sbin/umount.davfs
 	dh_strip
 	dh_compress
 	dh_fixperms -X etc/davfs2/secrets -X var/run/mount.davfs -X etc/davfs2/certs/private

Attachment: signature.asc
Description: Digital signature

Reply via email to