Hi Helmut,

On 07/18/2014 03:52 PM, Helmut Grohne wrote:
> While your patch moves a lot of files, it does not address the
> underlying problem. The libpam-ldap package still creates the very same
> configuration files using its postinst script and it still removes them
> in postrm.
Right. As I explained to you, I was planning to create a config-only package, 
and
a different package for the binaries, which doesn't seem to be the best 
solution,
as you already explained.

So, since these /etc/pam_ldap.conf is not a conffile, I am creating a patch that
just removes the file if there is no further package (libpam_ldap) installed in
the system (as from a different arch), thus, olving the problem here specified, 
as
it doesn't remove the /etc/pam_ldap.conf files if there are further packages
installed in the system.

I didn't touch the postinst packages because it is already configured to not
override an already installed configuration file.

The scripts becomes very short, and I am attaching as a RFC.

Thank you,
Breno

Index: libpam-ldap/libpam-ldap-184/debian/libpam-ldap.postrm
===================================================================
--- libpam-ldap.orig/libpam-ldap-184/debian/libpam-ldap.postrm
+++ libpam-ldap/libpam-ldap-184/debian/libpam-ldap.postrm
@@ -7,7 +7,8 @@ PASSWDFILE="/etc/pam_ldap.secret"
 
 action=$1
 
-if [ "$action" = "purge" ]; then
+if [ "$action" = "purge" ] && \
+[ "$(dpkg-query --show libpam-ldap 2> /dev/null | wc -l)" = 1 ]; then
        rm -f $CONFFILE $PASSWDFILE
 fi
 
Index: libpam-ldap/libpam-ldap-184/debian/libpam-ldap.prerm
===================================================================
--- libpam-ldap.orig/libpam-ldap-184/debian/libpam-ldap.prerm
+++ libpam-ldap/libpam-ldap-184/debian/libpam-ldap.prerm
@@ -2,7 +2,8 @@
 
 set -e
 
-if [ "$1" = remove ]; then
+if [ "$1" = remove ] && \
+[ "$(dpkg-query --show libpam-ldap 2> /dev/null | wc -l)" = 1 ]; then
        pam-auth-update --package --remove ldap
 fi
 

Reply via email to