aboutsummaryrefslogtreecommitdiffstats
path: root/config/mailscanner/mailscanner.inc
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2013-12-09 09:24:03 -0500
committerjim-p <jimp@pfsense.org>2013-12-09 09:25:51 -0500
commitf50be8942af808ef65b3397552498efd532306ff (patch)
treed65effe59f516ba2a712394b2819183034f722e6 /config/mailscanner/mailscanner.inc
parent6379357ef42d6d42067f3184a92c531405bc9c5a (diff)
downloadpfsense-packages-f50be8942af808ef65b3397552498efd532306ff.tar.gz
pfsense-packages-f50be8942af808ef65b3397552498efd532306ff.tar.bz2
pfsense-packages-f50be8942af808ef65b3397552498efd532306ff.zip
Use a better method for determining the perl version after recent changes to perl in the FreeBSD ports tree
Diffstat (limited to 'config/mailscanner/mailscanner.inc')
-rw-r--r--config/mailscanner/mailscanner.inc12
1 files changed, 6 insertions, 6 deletions
diff --git a/config/mailscanner/mailscanner.inc b/config/mailscanner/mailscanner.inc
index 0b638166..f1eef765 100644
--- a/config/mailscanner/mailscanner.inc
+++ b/config/mailscanner/mailscanner.inc
@@ -678,13 +678,13 @@ Country Sub-Domains List = %etc-dir%/country.domains.conf
$cconf=MAILSCANNER_LOCALBASE. "/sbin/mailscanner";
if (file_exists($cconf)){
#check perl's version
- exec('find '.MAILSCANNER_LOCALBASE. '/lib/perl5/site_perl -name Df.pm',$find_out);
- $perl_bin="perl";
- foreach($find_out as $perl_dir){
- if (preg_match ('@/usr\S+lib/perl5/site_perl/([.0-9]+)/mach/Filesys/Df.pm@',$perl_dir,$perl_match))
- $perl_bin.=$perl_match[1];
+ $perl_bin="perl";
+ $perl_version_file=MAILSCANNER_LOCALBASE . '/etc/perl5_version';
+ if (file_exists($perl_version_file)) {
+ $perl_version = `/usr/bin/grep 'PERL_VERSION=' $perl_version_file | /usr/bin/cut -f2 -d'='`;
+ $perl_bin .= $perl_version;
}
-
+
$cconf_file=file_get_contents($cconf);
$pattern2[0]='@#!/usr\S+bin/perl.*I@';
$pattern2[1]='/\smy .current = config MIME::ToolUtils/';