From c6c3f07205a4eed5df6cf6d9d30ab27120f3e490 Mon Sep 17 00:00:00 2001 From: Valentin Vidic Date: Tue, 4 Mar 2008 17:45:14 +0100 Subject: [PATCH] Updated bloat handling and list. --- src/data.sh | 78 ++++++++++++++++++++++++++++++++++++++++++++++-------- src/functions.sh | 16 +++++------ 2 files changed, 75 insertions(+), 19 deletions(-) diff --git a/src/data.sh b/src/data.sh index 0fa7bb9..b36b2fd 100644 --- a/src/data.sh +++ b/src/data.sh @@ -74,18 +74,74 @@ xinetd-cn xinetd # We want to remove these packages, used in remove_bloat() # nice name packages to remove bloats=' -Autoconf autoconf-cn autoconf -Automake automake-cn automake autotools-dev -Bison bison-cn bison -CVS cvs-cn cvs -Expect expect-cn expect -GCC gcc-2.95-cn gcc-2.95 g++-2.95 gcc-2.95-doc gcc-cn gcc g++ gcc-doc gcc-misc-cn gobjc gpc gcj gij chill g77 -GDB gdb-cn gdb -Gettext gettext-cn gettext -Make-cn make-cn -Nessus nessus-cn nessus nessusd -Piwi piwi-cn piwi +aide aide aide-cn +amavis-stats amavis-stats amavis-stats-cn +apt-cn apt-cn +autoconf autoconf autoconf-cn +automake automake automake-cn +bison bison bison-cn +bitchx bitchx bitchx-cn +chkrootkit chkrootkit chkrootkit-cn +cvs cvs cvs-cn +diff-cn diff-cn +elinks elinks elinks-cn +expect expect expect-cn +file-cn file-cn +flex flex flex-cn +gawk gawk gawk-cn +gcc gcc-2.95-cn gcc-2.95 g++-2.95 gcc-2.95-doc gcc-cn gcc g++ gcc-doc gcc-misc-cn gobjc gpc gcj gij chill g77 +gdb gdb gdb-cn +gettext gettext gettext-cn +gnupg gnupg gnupg-cn +grep-cn grep-cn +iptraf iptraf iptraf-cn +jed jed jed-cn +joe joe joe-cn +jre sun-j2re1.4 sun-j2re1.4debian jre-cn +less less less-cn +lftp lftp lftp-cn +logcheck logcheck logcheck-cn +logrotate-cn logrotate-cn +lsof lsof lsof-cn +ltrace ltrace ltrace-cn +lynx-cn lynx-cn +make-cn make-cn +mutt-cn mutt-cn +nessus libnessus2 nessus-cn +netcat netcat netcat-cn +nmap nmap nmap-cn +ntop ntop ntop-cn +oidentd oidentd oidentd-cn +openssh-cn openssh-cn +openssl-cn openssl-cn +perl-cn perl-cn +phpbb2 phpbb2 phpbb2-cn +php4-suhosin php4-suhosin php-suhosin-cn +postgresql postgresql postgresql-cn +prelude piwi piwi piwi-cn libprelude0 prelude-sensors-cn prelude-manager-cn +procmail procmail procmail-cn +proftpd proftpd proftpd-cn +python-cn python-cn +razor razor razor-cn +samba samba-common samba-cn +screen screen screen-cn +slrn slrn slrn-cn +snort snort snort-cn snort-central-cn +spamassassin-cn spamassassin-cn +squid squid squid-cn +strace strace strace-cn +stunnel stunnel stunnel-cn +sudo sudo sudo-cn +sysadmin-cn sysadmin-cn +tcpdump tcpdump tcpdump-cn +unace unace unace-cn +vim vim vim-cn +wget wget wget-cn +wv wv wv-cn +ytalk ytalk ytalk-cn +zsh zsh zsh-cn ' + # php4-gd -> libgd1 -> xlibs -> xfree86-common -> suxx #X Window System xfree86-common 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' -- 1.7.10.4