You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by fe...@apache.org on 2006/06/27 19:24:17 UTC
svn commit: r417532 - /spamassassin/trunk/sa-update.raw
Author: felicity
Date: Tue Jun 27 10:24:17 2006
New Revision: 417532
URL: http://svn.apache.org/viewvc?rev=417532&view=rev
Log:
bug 4958: when looking for GPG, look for 'gpg' except on Windows where it'll be 'gpg.exe'. Also, use M::SA::Util::find_executable_in_env_path() instead of the not-as-good rewrite version.
Modified:
spamassassin/trunk/sa-update.raw
Modified: spamassassin/trunk/sa-update.raw
URL: http://svn.apache.org/viewvc/spamassassin/trunk/sa-update.raw?rev=417532&r1=417531&r2=417532&view=diff
==============================================================================
--- spamassassin/trunk/sa-update.raw (original)
+++ spamassassin/trunk/sa-update.raw Tue Jun 27 10:24:17 2006
@@ -988,16 +988,17 @@
}
sub find_gpg_path {
- dbg("gpg: Searching for 'gpg' in ".$ENV{'PATH'});
- my $path;
- foreach my $dir (split(/:/, $ENV{'PATH'})) {
- $dir = File::Spec->catfile($dir, 'gpg');
- if (-x $dir) {
- $path = $dir;
- last;
- }
+ # bug 4958: for *NIX it's "gpg", in Windows it's "gpg.exe"
+ my $gpg = 'gpg';
+ if (Mail::SpamAssassin::Util::am_running_on_windows()) {
+ $gpg .= '.exe';
}
- die "fatal: couldn't find GPG in \$PATH\n" unless ($path);
+
+ dbg("gpg: Searching for '$gpg'");
+
+ my $path = Mail::SpamAssassin::Util::find_executable_in_env_path($gpg) ||
+ die "fatal: couldn't find GPG\n";
+
dbg("gpg: found $path");
return $path;
}
Re: svn commit: r417532 - /spamassassin/trunk/sa-update.raw
Posted by Radoslaw Zielinski <ra...@gmail.com>.
felicity@apache.org <fe...@apache.org> [27-06-2006 19:24]:
[...]
> bug 4958: when looking for GPG, look for 'gpg' except on Windows where
> it'll be 'gpg.exe'. Also, use M::SA::Util::find_executable_in_env_path()
> instead of the not-as-good rewrite version.
[...]
> + # bug 4958: for *NIX it's "gpg", in Windows it's "gpg.exe"
> + my $gpg = 'gpg';
> + if (Mail::SpamAssassin::Util::am_running_on_windows()) {
> + $gpg .= '.exe';
Cosmetic change (SA probably won't run on Stratus VOS anyway ;-) :
require Config;
my $gpg = "gpg$Config::Config{_exe}";
...instead?
--
Radosław Zieliński <ra...@pld-linux.org>