tazpkg annotate modules/reconfigure @ rev 849

Fix working of modules/reconfigure (thank Robertux for bugreport); small changes.
author Aleksej Bobylev <al.bobylev@gmail.com>
date Tue Oct 20 10:24:52 2015 +0300 (2015-10-20)
parents 8a73a58ed3cb
children ea951624ec43
rev   line source
al@844 1 #!/bin/sh
al@844 2 # TazPkg - Tiny autonomous zone packages manager, hg.slitaz.org/tazpkg
al@844 3 # reconfigure - TazPkg module
al@844 4 # Replay post_install from receipt
al@844 5
al@844 6
al@844 7 # Connect function libraries
al@844 8 . /lib/libtaz.sh
al@844 9
al@844 10 # Get TazPkg working environment
al@844 11 . @@MODULES@@/getenv
al@844 12
al@844 13
al@844 14
al@844 15
al@844 16 PACKAGE="$1"
al@844 17
al@846 18 # Receipt function caller
al@846 19 # Why? "Bad" receipt sourcing can redefine some vital TazPkg variables.
al@846 20 # Few receipts function should be patched now.
al@846 21
al@846 22 # Check for post_install function
al@846 23 if grep -q '^post_install()' "$INSTALLED/$PACKAGE/receipt"; then
al@846 24 action 'Execute post-install commands...'
al@846 25 tmp="$(mktemp)"
al@849 26 cp "$INSTALLED/$PACKAGE/receipt" "$tmp"
al@846 27 sed -i 's|$1/*$INSTALLED|$INSTALLED|g' "$tmp"
al@846 28 ( . "$tmp"; post_install "$root" )
al@846 29 status
al@846 30 rm "$tmp"
al@844 31 # Log this activity
al@844 32 tazpkg call log_pkg Reconfigured
al@844 33 else
al@844 34 newline
al@844 35 _ 'Nothing to do for package "%s".' "$PACKAGE"
al@844 36 fi