X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?a=blobdiff_plain;f=src%2Ffunctions.sh;h=f68c54bc5a6955a87e246f38106054e75a73d51f;hb=c6c3f07205a4eed5df6cf6d9d30ab27120f3e490;hp=80e18945c3e3dba5c747c52547ef5e43340f6316;hpb=9c8a8adce1151ca789ef01b750ed634240a368f6;p=carnet-upgrade.git diff --git a/src/functions.sh b/src/functions.sh index 80e1894..f68c54b 100644 --- a/src/functions.sh +++ b/src/functions.sh @@ -129,26 +129,27 @@ dist_upgrade () { } remove_bloat() { - local to_remove add_this i j n text to_show cmd tmpfile installed + local to_remove add_this i j text to_show cmd tmpfile installed local update_selections pkgs_to_deselect oldifs text="$msg_remove_bloat" [ "$DEBUG" ] && set -x - n=0 + pkglist=$(mktemp /var/lib/carnet-upgrade/pkglist.XXXXXX) + COLUMNS=200 dpkg -l | awk '$1 ~ /^.i/ { print $2 }' > $pkglist for i in $(echo "$bloats" | sed 's/ */ /g'| awk -F' ' '{print $2}') do - if pkg $i; then + if grep -q "^$i$" $pkglist; then installed="$installed $i" add_this="$(echo "$bloats" | egrep " .*\b${i}\b" | sed 's/ */ /g'| awk -F' ' '{print $1}')" if ! echo "$to_show" | grep -q "$add_this"; then to_show="$to_show \"$add_this\" \"\" on" - n=$(($n+1)) fi fi done + [ "$DEBUG" ] || rm -f $pkglist [ -z "$to_show" ] && return 0 tmpfile=$(mktemp /var/lib/carnet-upgrade/dialog-tmp.XXXXXX) - cmd="dialog --nocancel --backtitle \""$title"\" --checklist \""$text"\" 20 75 $n $to_show" + cmd="dialog --nocancel --backtitle \""$title"\" --checklist \""$text"\" 20 75 8 $to_show" [ "$DEBUG" ] && set +x eval $cmd 2> $tmpfile [ "$DEBUG" ] && set -x @@ -280,10 +281,9 @@ Nakon toga ponovno pozovite ovu skriptu." # if apache is installed make sure it's version 2 check_apache_version () { - if ! pkg apache2-cn && pkg apache-cn; then + if pkg apache-cn && ! pkg apache2-cn; then notice " -Prije prelaska na Debian Etch potrebno je napraviti nadogradnju sa apache 1.3 -na apache 2.0. +Prije prelaska na Debian Etch potrebno je napraviti nadogradnju sa apache 1.3 na apache 2.0. Pokrenite: 'apt-get install apache2-cn'