--- trunk/apt-iselect 2004/07/27 11:51:10 4 +++ trunk/apt-iselect 2006/06/24 15:01:09 25 @@ -25,6 +25,8 @@ # 2003-10-09 allow multi-selection of packages to view details # 2003-11-13 fix for RedHat 9.0 mktemp bug suggested by Dobes Vandermeer # 2004-07-27 allow multi-selection of packages to install +# 2004-12-04 add quick install options +# 2004-12-06 fixed multi-word search # # I know it's ugly, but it's still faster than aptitude :-) # @@ -81,19 +83,21 @@ trap 'rmtemp; exit 1' INT QUIT TERM SEGV apt_cache_search() { - search_words="$@" + search_words="$*" echo "Searching apt-cache for \"$search_words\"..." - apt-cache search "$search_words" | head -1020 > $res + apt-cache search "$@" | head -1020 > $res nr=`wc -l $res | sed 's/^ *//' | cut -d" " -f1` if [ $nr = 0 ] ; then echo "No results for \"$search_words\"" > $res2 - nr="no" + nr=0 else echo "$nr results for \"$search_words\", enter new search {s:search=%[Search for]S}" > $res2 echo >> $res2 cat $res | sed 's/^/{s}/' >> $res2 + echo >> $res2 + echo "{s:_quick_install_}Install all selected" >> $res2 fi echo >> $res2 echo "Enter new apt-cache search {s:search=%[Search for]S}" >> $res2 @@ -114,6 +118,9 @@ elif tmp=`grep search= <$sel 2>/dev/null` ; then apt_cache_search `echo $tmp | grep search= | cut -d= -f2` loop=1 + elif tmp=`grep -i ':_quick_install_' $sel` ; then + debs=`grep -v ':_quick_install_' $sel | cut -d: -f2 | cut -d" " -f1 | xargs echo` + do_sudo "Installing '$debs'" apt-get install $debs else # not search, find packages info