# svn://svn.debian.org/pgp-tools/trunk/
# http://svn.debian.org/wsvn/pgp-tools/trunk/
-delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV', 'PATH'};
+delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'};
$|=1; # Always flush buffers
my $version = '3.0 ($Id$)';
-# Where to find GnuPG's options file.
-# Full path to the dialog and whiptail executeable.
-my $Dialog = '/usr/bin/dialog';
-my $Whiptail = '/usr/bin/whiptail';
-
# Strings to use in the dialog|whiptail frontend
my $TITLE = 'Import Keys';
my $BACKTITLE = 'KeyLookup $Revision$';
while (<KID>) {
chomp;
+ if ( $_ eq "" ) { next; }
my ($type, undef) = split /:/;
if ($type eq 'pub') {
my ($type, $keyid, $algo, $bits, $created, undef, $revoked) = split /:/;
$frontend = 'dialog' unless (defined $frontend);
if ($frontend eq 'dialog') {
- unless (-x $Dialog) {
- warn("Dialog ($Dialog) not executeable/installed. Falling back to Whiptail\n");
+ unless (`which dialog` && $? == 0) {
+ warn("Dialog not executeable/installed. Falling back to Whiptail\n");
$frontend = 'whiptail';
}
};
if ($frontend eq 'whiptail') {
- unless (-x $Whiptail ) {
- warn("Whiptail ($Whiptail) not executeable/installed. Falling back to plain\n");
+ unless (`which whiptail` && $? == 0 ) {
+ warn("Whiptail not executeable/installed. Falling back to plain\n");
$frontend = 'plain';
}
};
if ( $frontend eq 'dialog' ) {
calcDialogSize;
my @ARGS = (
- $Dialog,
+ 'dialog',
'--backtitle',
$BACKTITLE,
'--separate-output',
} elsif ( $frontend eq 'whiptail' ) {
calcDialogSize;
my @ARGS = (
- $Whiptail,
+ 'whiptail',
'--backtitle',
$BACKTITLE,
'--separate-output',