tazpkg view modules/reconfigure @ rev 950
Minor bug fixes due to the change in the behavior of the dot command in Busybox-1.27; support "release checksum" in modules/mkdb.
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Thu Jul 27 13:38:37 2017 +0300 (2017-07-27) |
parents | ea951624ec43 |
children |
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 # Log TazPkg activity
18 log_pkg() {
19 local extra
20 [ -e "$LOG" ] || touch $LOG
21 [ -w "$LOG" ] &&
22 echo "$(date +'%F %T') - $1 - $PACKAGE ($VERSION$EXTRAVERSION)$extra" >> $LOG
23 }
28 PACKAGE="$1"
30 # Receipt function caller
31 # Why? "Bad" receipt sourcing can redefine some vital TazPkg variables.
32 # Few receipts functions should be patched now.
34 # Check for post_install function
35 if grep -q '^post_install()' "$INSTALLED/$PACKAGE/receipt"; then
36 action 'Execute post-install commands...'
37 tmp="$(mktemp)"
38 cp "$INSTALLED/$PACKAGE/receipt" "$tmp"
39 sed -i 's|$1/*$INSTALLED|$INSTALLED|g' "$tmp"
40 ( . "$tmp"; post_install "$root" )
41 status
42 rm "$tmp"
43 # Log this activity
44 log_pkg Reconfigured
45 else
46 newline
47 _ 'Nothing to do for package "%s".' "$PACKAGE"
48 fi