#!/bin/sh TF=/tmp/gdialog_apt_search-$UID-$RANDOM.tmp RESULT=$* if [ ! $RESULT ]; then RESULT=`gdialog --title 'GTK+ Apt-Cache Search' --inputbox 'Please enter a search string:' 20 40 2>&1` if [ ! $RESULT ]; then exit; fi fi apt-cache search "$RESULT" > $TF if [ -s $TF ]; then MOREINFO="gdialog --title 'GTK+ Apt-Cache Search Results' --radiolist 'Select a package and press OK for more information.' 20 70 50 "$(perl -e 'while (<>) { s/'\''//g; s/(.+?) - (.+)$/ '\''$1'\'' '\''$2'\'' normal /; print;} ' < $TF) RESULT=$(eval $MOREINFO 2>&1) if [ ! "x$RESULT" = "x" ]; then echo -e "GTK+ Apt-Cache Search Results for \"$RESULT\":\n" > $TF apt-cache show $RESULT >> $TF gdialog --title 'GTK+ Apt-Cache Search Results for '"\"$RESULT\"" \ --textbox $TF 40 60 fi rm $TF; else gdialog --title 'GTK+ Apt-Cache Search Results' \ --msgbox 'No Matches Found.' 20 40 fi