tazpkg rev 432 4.3

Let recharge display an error if mirror is not accessible; Avoid ID being a symlink
author Antoine Bodin <gokhlayeh@slitaz.org>
date Fri Mar 04 03:35:58 2011 +0100 (2011-03-04)
parents 3719533763de
children 2969b58a89c1
files tazpkg
line diff
     1.1 --- a/tazpkg	Thu Mar 03 23:56:29 2011 +0100
     1.2 +++ b/tazpkg	Fri Mar 04 03:35:58 2011 +0100
     1.3 @@ -2244,7 +2244,7 @@
     1.4  
     1.5  			# Quietly check if recharging is needed.
     1.6  			[ -f ID ] && mv ID ID.bak
     1.7 -			download_from "$(cat mirror)" ID >/dev/null 2>&1
     1.8 +			download_from "$(cat mirror)" ID >/dev/null
     1.9  			if [ -f ID ] && fgrep -q `cat ID.bak` ID; then
    1.10  				if [ "$path" = "$LOCALSTATE" ]; then
    1.11  					repository_name=Main
    1.12 @@ -2255,7 +2255,13 @@
    1.13  				rm ID.bak
    1.14  				continue
    1.15  			fi
    1.16 -			[ -f ID ] && rm -f ID.bak
    1.17 +
    1.18 +			# Don't let ID be a symlink when using local repository.
    1.19 +			if [ -f ID ]; then
    1.20 +				mv -f ID ID.bak
    1.21 +				cat ID.bak > ID
    1.22 +				rm ID.bak
    1.23 +			fi
    1.24  
    1.25  			echo ""
    1.26  			if [ "$path" != "$LOCALSTATE" ]; then