wok-4.x rev 11446

pam, busybox-pam: trigger the proper reinstallation of busybox before removing them
author Antoine Bodin <gokhlayeh@slitaz.org>
date Fri Dec 16 23:50:33 2011 +0100 (2011-12-16)
parents e584450f5f0e
children d70cd76f3c2f
files busybox-pam/receipt pam/receipt
line diff
     1.1 --- a/busybox-pam/receipt	Fri Dec 16 20:31:59 2011 +0100
     1.2 +++ b/busybox-pam/receipt	Fri Dec 16 23:50:33 2011 +0100
     1.3 @@ -14,17 +14,24 @@
     1.4  # Rules to gen a SliTaz package suitable for Tazpkg.
     1.5  genpkg_rules()
     1.6  {
     1.7 -    mkdir -p $fs/bin
     1.8 -    cp -a $src/busybox-pam $fs/bin/busybox
     1.9 -    cp -a $stuff/* $fs
    1.10 +	mkdir -p $fs/bin
    1.11 +	cp -a $src/busybox-pam $fs/bin/busybox
    1.12 +	cp -a $stuff/* $fs
    1.13  }
    1.14  
    1.15  pre_remove()
    1.16  {
    1.17 -    tazpkg get-install  ${PACKAGE%-pam}
    1.18 +	# We install non-pam busybox to replace busybox-pam.
    1.19 +	tazpkg get-install ${PACKAGE%-pam} --forced
    1.20 +
    1.21 +	# We remove /bin/busybox from the file.list of busybox-pam.
    1.22 +	# This way, the non-pam busybox we just installed will not be
    1.23 +	# removed.
    1.24 +	sed '/\/bin\/busybox/d' \
    1.25 +		-i /var/lib/tazpkg/installed/busybox-pam/files.list
    1.26  }
    1.27  
    1.28  post_install()
    1.29  {
    1.30 -    chmod 4755 $1/bin/busybox
    1.31 +	chmod 4755 $1/bin/busybox
    1.32  }
     2.1 --- a/pam/receipt	Fri Dec 16 20:31:59 2011 +0100
     2.2 +++ b/pam/receipt	Fri Dec 16 23:50:33 2011 +0100
     2.3 @@ -37,3 +37,13 @@
     2.4  	rm -f $fs/lib/security/*.la
     2.5  	cp -a $stuff/* $fs	
     2.6  }
     2.7 +
     2.8 +pre_remove()
     2.9 +{
    2.10 +	# If busybox-pam is installed, trigger its removal right now. Once pam shared
    2.11 +	# library will be removed, it will be too late. Don't worry about this, while
    2.12 +	# removing busybox-pam will replace itself by a non-pam busybox.
    2.13 +	if [ -d /var/lib/tazpkg/installed/busybox-pam ]; then
    2.14 +		tazpkg remove busybox-pam --auto
    2.15 +	fi
    2.16 +}