spk rev 140

spk: add reconf command
author Christophe Lincoln <pankso@slitaz.org>
date Sat Apr 05 05:01:56 2014 +0200 (2014-04-05)
parents b1e6edfdb9b7
children 1ab690b993b4
files spk
line diff
     1.1 --- a/spk	Wed Apr 02 00:06:47 2014 +0200
     1.2 +++ b/spk	Sat Apr 05 05:01:56 2014 +0200
     1.3 @@ -13,7 +13,7 @@
     1.4  # Functions
     1.5  #
     1.6  
     1.7 -VERSION=1.0
     1.8 +VERSION=1.3
     1.9  
    1.10  # Help and usage
    1.11  usage() {
    1.12 @@ -28,6 +28,7 @@
    1.13    info        $(gettext "Display path, mirror and other stats")
    1.14    activity    $(gettext "Display packages activities")
    1.15    clean       $(gettext "Clean cache and temporary files")
    1.16 +  reconf      $(gettext "Reconfigure an installed packages")
    1.17  
    1.18  $(boldify $(gettext "Options:"))
    1.19    --add       $(gettext "Install packages if mirrored")
    1.20 @@ -90,6 +91,19 @@
    1.21  		rm -rf $(dirname $tmpdir) && status
    1.22  		separator && newline
    1.23  		exit 0 ;;
    1.24 +	reconf|reconfigure)
    1.25 +		packages="$@"
    1.26 +		[ "$all" ] && packages=$(ls $installed)
    1.27 +		for pkg in ${packages}
    1.28 +		do
    1.29 +			receipt="$installed/$pkg/receipt"
    1.30 +			[ ! -f "$receipt" ] && continue
    1.31 +			if grep -q ^post_install ${receipt}; then
    1.32 +				gettext "Configuring packages:"; echo " $pkg"
    1.33 +				. ${receipt}
    1.34 +				post_install
    1.35 +			fi
    1.36 +		done && exit 0 ;;
    1.37  esac
    1.38  
    1.39  #