cookutils rev 276
cook: add setup --reinstall
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Fri Jan 06 18:55:08 2012 +0100 (2012-01-06) |
parents | c3c191298381 |
children | ee13a32cecd0 |
files | cook |
line diff
1.1 --- a/cook Sun Dec 25 15:09:40 2011 +0100 1.2 +++ b/cook Fri Jan 06 18:55:08 2012 +0100 1.3 @@ -736,6 +736,21 @@ 1.4 fi 1.5 } 1.6 1.7 +mkinstall_list() { 1.8 + local pkg 1.9 + for pkg in $@ ; do 1.10 + [ -s /home/slitaz/wok/$pkg/receipt ] || continue 1.11 + case " $INSTALL_LIST " in 1.12 + *\ $pkg\ *) ;; 1.13 + *) unset DEPENDS 1.14 + . /home/slitaz/wok/$pkg/receipt 1.15 + INSTALL_LIST="$INSTALL_LIST $pkg" 1.16 + [ -n "$DEPENDS" ] && mkinstall_list $DEPENDS 1.17 + echo $pkg 1.18 + esac 1.19 + done 1.20 +} 1.21 + 1.22 # 1.23 # Commands 1.24 # 1.25 @@ -765,10 +780,19 @@ 1.26 separator && cd $SLITAZ 1.27 init_db_files 1.28 gettext -e "Checking for packages to install...\n" 1.29 - for pkg in $SETUP_PKGS 1.30 - do 1.31 - [ ! -f "$INSTALLED/$pkg/receipt" ] && tazpkg get-install $pkg 1.32 - done 1.33 + case " $@ " in 1.34 + *\ --reinstall\ *) 1.35 + INSTALL_LIST="" 1.36 + for pkg in $(mkinstall_list $SETUP_PKGS); do 1.37 + tazpkg get-install $pkg --forced 1.38 + done ;; 1.39 + *) 1.40 + for pkg in $SETUP_PKGS 1.41 + do 1.42 + [ ! -f "$INSTALLED/$pkg/receipt" ] && 1.43 + tazpkg get-install $pkg 1.44 + done ;; 1.45 + esac 1.46 1.47 # Handle --options 1.48 case "$2" in