diff --git a/Ezmlm/trunk/GpgEzmlm.pm b/Ezmlm/trunk/GpgEzmlm.pm index ac23055..67a157c 100644 --- a/Ezmlm/trunk/GpgEzmlm.pm +++ b/Ezmlm/trunk/GpgEzmlm.pm @@ -73,6 +73,11 @@ $ENV{SHELL} = '/bin/sh' if exists $ENV{SHELL}; delete @ENV{qw(IFS CDPATH ENV BASH_ENV)}; +# check, if gpg-ezmlm is installed +unless (-x "$GPG_EZMLM_BASE/gpg-ezmlm-manage.pl") { + die("Warning: gpg-ezmlm does not seem to be installed - " + . "executable '$GPG_EZMLM_BASE/gpg-ezmlm-manage.pl' not found!"); +} # == Initialiser - Returns a reference to the object == diff --git a/Ezmlm/trunk/GpgKeyRing.pm b/Ezmlm/trunk/GpgKeyRing.pm index 41af499..38e6dee 100644 --- a/Ezmlm/trunk/GpgKeyRing.pm +++ b/Ezmlm/trunk/GpgKeyRing.pm @@ -77,6 +77,13 @@ $GPG_BIN = '/bin/gpg' # == clean up the path == local $ENV{'PATH'} = "/bin"; +# check, if gpg is installed +unless (-x "$GPG_BIN") { + die("Warning: gnupg does not seem to be installed - none of the " + . "executables 'gpg' or 'gpg2' were found at the usual locations!"); +} + + # == Initialiser - Returns a reference to the object == =head2 Setting up a new Mail::Ezmlm::GpgKeyRing object: @@ -306,7 +313,7 @@ sub _get_gpg_object() { my $gpg = new Crypt::GPG(); my $dirname = $self->get_location(); # replace whitespace characters in the keyring directory name - $dirname =~ s/(\s)/\\\1/g; + $dirname =~ s/(\s)/\\$1/g; $gpg->gpgbin($GPG_BIN); $gpg->gpgopts("--lock-multiple --no-tty --no-secmem-warning --batch --quiet --homedir $dirname"); return $gpg;