tazpkg view 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
line source
1 #!/bin/sh
2 # TazPkg - Tiny autonomous zone packages manager, hg.slitaz.org/tazpkg
3 # reconfigure - TazPkg module
4 # Replay post_install from receipt
7 # Connect function libraries
8 . /lib/libtaz.sh
10 # Get TazPkg working environment
11 . @@MODULES@@/getenv
16 PACKAGE="$1"
18 # Receipt function caller
19 # Why? "Bad" receipt sourcing can redefine some vital TazPkg variables.
20 # Few receipts function should be patched now.
22 # Check for post_install function
23 if grep -q '^post_install()' "$INSTALLED/$PACKAGE/receipt"; then
24 action 'Execute post-install commands...'
25 tmp="$(mktemp)"
26 cp "$INSTALLED/$PACKAGE/receipt" "$tmp"
27 sed -i 's|$1/*$INSTALLED|$INSTALLED|g' "$tmp"
28 ( . "$tmp"; post_install "$root" )
29 status
30 rm "$tmp"
31 # Log this activity
32 tazpkg call log_pkg Reconfigured
33 else
34 newline
35 _ 'Nothing to do for package "%s".' "$PACKAGE"
36 fi