tazpkg 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 8e696ea00167
children ea951624ec43
files modules/getenv modules/reconfigure modules/remove
line diff
     1.1 --- a/modules/getenv	Mon Oct 19 08:24:32 2015 +0100
     1.2 +++ b/modules/getenv	Tue Oct 20 10:24:52 2015 +0300
     1.3 @@ -24,7 +24,8 @@
     1.4  debug() {
     1.5  	if [ -n "$debug" ]; then
     1.6  		colorize 036 "$@" >&2
     1.7 -		echo -e "$(date +%f) $@" >> "${LOG/.log/.debug}"
     1.8 +		# $LOG is unavailable at the early stage on 'getenv'
     1.9 +		[ -n "$LOG" ] && echo -e "$(date +%f) $@" >> "${LOG/.log/.debug}"
    1.10  	fi
    1.11  }
    1.12  
     2.1 --- a/modules/reconfigure	Mon Oct 19 08:24:32 2015 +0100
     2.2 +++ b/modules/reconfigure	Tue Oct 20 10:24:52 2015 +0300
     2.3 @@ -23,7 +23,7 @@
     2.4  if grep -q '^post_install()' "$INSTALLED/$PACKAGE/receipt"; then
     2.5  	action 'Execute post-install commands...'
     2.6  	tmp="$(mktemp)"
     2.7 -	cp "$1" "$tmp"
     2.8 +	cp "$INSTALLED/$PACKAGE/receipt" "$tmp"
     2.9  	sed -i 's|$1/*$INSTALLED|$INSTALLED|g' "$tmp"
    2.10  	( . "$tmp"; post_install "$root" )
    2.11  	status
     3.1 --- a/modules/remove	Mon Oct 19 08:24:32 2015 +0100
     3.2 +++ b/modules/remove	Tue Oct 20 10:24:52 2015 +0300
     3.3 @@ -133,13 +133,13 @@
     3.4  			[ $(grep "^$(echo $file | grepesc)$" "$INSTALLED/$mod/files.list" | wc -l) -gt 1 ] && \
     3.5  			continue 2
     3.6  		done
     3.7 -		[ -n "$debug" ] && echo "remove_with_path $root$file"
     3.8 -		remove_with_path $root$file
     3.9 +		debug "remove_with_path ($root$file)"
    3.10 +		remove_with_path "$root$file"
    3.11  	done
    3.12  else
    3.13  	for file in $(cat "$INSTALLED/$PACKAGE/files.list"); do
    3.14 -		[ -n "$debug" ] && echo "remove_with_path $root$file"
    3.15 -		remove_with_path $root$file
    3.16 +		debug "remove_with_path ($root$file)"
    3.17 +		remove_with_path "$root$file"
    3.18  	done
    3.19  fi
    3.20  status
    3.21 @@ -190,7 +190,10 @@
    3.22  	if [ "$answer" -eq 0 ]; then
    3.23  		for i in $REFRESH; do
    3.24  			if [ "$(wc -l < "$INSTALLED/$i")" -gt 1 ]; then
    3.25 -				_ 'Check %s for reinstallation' "$INSTALLED/$i"
    3.26 +				_ 'Package "%s" was modified by "%s" and other packages. It will not be reinstalled.' \
    3.27 +					"${i%/modifiers}" "$PACKAGE"
    3.28 +				_ 'Check "%s" for reinstallation.' "$INSTALLED/$i"
    3.29 +
    3.30  				continue
    3.31  			fi
    3.32  			rm -r "$INSTALLED/$i"