Package: policycoreutils
Version: 2.3-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 /bin/ and /usr/bin/, 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/policycoreutils.postinst b/debian/policycoreutils.postinst
--- a/debian/policycoreutils.postinst	2014-05-17 12:30:42.000000000 +0200
+++ b/debian/policycoreutils.postinst	2014-11-02 15:43:37.000000000 +0100
@@ -39,6 +39,9 @@ SELINUXTYPE=default
 SETLOCALDEFS=0
 EOF
         fi
+        if [ ! -e /usr/sbin/load_policy ]; then
+            ln -s /sbin/load_policy /usr/sbin/load_policy
+        fi
     ;;
 
     abort-upgrade|abort-remove|abort-deconfigure)
diff -urpN a/debian/policycoreutils.postrm b/debian/policycoreutils.postrm
--- a/debian/policycoreutils.postrm	2014-05-17 12:30:42.000000000 +0200
+++ b/debian/policycoreutils.postrm	2014-11-02 15:43:45.000000000 +0100
@@ -20,7 +20,13 @@ set -e
 
 
 case "$1" in
-    remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
+    upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
+    ;;
+
+    remove)
+        if [ -L /usr/sbin/load_policy ]; then
+            rm /usr/sbin/load_policy
+        fi
     ;;
 
     purge)
diff -urpN a/debian/rules b/debian/rules
--- a/debian/rules	2014-05-17 12:30:42.000000000 +0200
+++ b/debian/rules	2014-11-02 15:40:35.000000000 +0100
@@ -30,10 +30,6 @@ override_dh_auto_install:
 override_dh_install:
 	dh_install --list-missing
 
-# Fix symlink
-	rm -f $(CURDIR)/debian/policycoreutils/usr/sbin/load_policy
-	ln -s /sbin/load_policy $(CURDIR)/debian/policycoreutils/usr/sbin/load_policy
-
 override_dh_fixperms:
 	dh_fixperms -Xusr/sbin/seunshare
 

Attachment: signature.asc
Description: Digital signature

_______________________________________________
SELinux-devel mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/selinux-devel

Reply via email to