X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=rt%2Fetc%2Fupgrade%2Fgenerate-rtaddressregexp.in;h=48cf14526bc7c231e384da201072abdbbf3ad481;hp=68259ff9452bb28a75250daea58d26cc55352c47;hb=44dd00a3ff974a17999e86e64488e996edc71e3c;hpb=a6fe07e49e3fc12169e801b1ed6874c3a5bd8500 diff --git a/rt/etc/upgrade/generate-rtaddressregexp.in b/rt/etc/upgrade/generate-rtaddressregexp.in index 68259ff94..48cf14526 100644 --- a/rt/etc/upgrade/generate-rtaddressregexp.in +++ b/rt/etc/upgrade/generate-rtaddressregexp.in @@ -3,7 +3,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2019 Best Practical Solutions, LLC # # # (Except where explicitly superseded by other copyright notices) @@ -46,18 +46,15 @@ # those contributions and any derivatives thereof. # # END BPS TAGGED BLOCK }}} +use 5.10.1; use strict; use warnings; use lib "@LOCAL_LIB_PATH@"; use lib "@RT_LIB_PATH@"; -use RT; -RT::LoadConfig(); -RT->Config->Set('LogToScreen' => 'debug'); -RT::Init(); - -$| = 1; +use RT::Interface::CLI qw(Init); +Init(); if (my $re = RT->Config->Get('RTAddressRegexp')) { print "No need to use this script, you already have RTAddressRegexp set to $re\n"; @@ -86,7 +83,7 @@ for my $domain (sort keys %merged) { } } if (@addresses > 1) { - push @domains, "(?:".join("|", @addresses).")\Q\@".$domain."\E"; + push @domains, "(?:".join("|", @addresses).")\Q\@$domain\E"; } else { push @domains, "$addresses[0]\Q\@$domain\E"; }