Skip to content
Permalink
Browse files

p5-mhonarc: fix fatal syntax deprecations

* update homepage, checksums, dependencies
* install files in standard perl5 module paths
  • Loading branch information
dbevans committed May 15, 2020
1 parent c70f233 commit d2072be0b81a92634fc658467bbe3f5afc074469
Showing with 52 additions and 11 deletions.
  1. +26 −11 perl/p5-mhonarc/Portfile
  2. +26 −0 perl/p5-mhonarc/files/mhonarc.patch
@@ -5,9 +5,9 @@ PortGroup perl5 1.0

perl5.branches 5.26 5.28 5.30
perl5.setup MHonArc 2.6.19 ../../authors/id/E/EH/EHOOD/
revision 1
license GPL
maintainers nomaintainer
supported_archs noarch

description MHonArc - mail and news munging
long_description A Perl program for converting mail or news messages into \
@@ -17,22 +17,37 @@ long_description A Perl program for converting mail or news messages into \
platforms darwin

checksums rmd160 6c2edc1574a423719b77acfbbcc378ea79711d9d \
sha256 f8bf2874e6ea37830b0d5155fb99acf788005877df7573f1276344e947da8352
sha256 f8bf2874e6ea37830b0d5155fb99acf788005877df7573f1276344e947da8352 \
size 1992055

homepage http://www.mhonarc.org/
homepage https://www.mhonarc.org/

if {${perl5.major} != ""} {
use_configure no
build {}

destroot {
depends_lib-append \
port:p${perl5.major}-encode \
port:p${perl5.major}-getopt-long \
port:p${perl5.major}-time-local

# fix remaining syntax deprecations fatal since perl 5.22.0
# can't use 'defined(%hash)' (Maybe you should just omit the defined()?) at ./lib/mhamain.pl line 1565.
# can't use 'defined(%hash)' (Maybe you should just omit the defined()?) at ./lib/mhopt.pl line 868.
# https://savannah.nongnu.org/bugs/?49997
# https://perldoc.perl.org/perl5220delta.html#defined(%40array)-and-defined(%25hash)-are-now-fatal-errors
patchfiles mhonarc.patch

use_configure no
build {}

destroot {
xinstall -m 755 -d ${destroot}${perl5.archlib}
system -W ${worksrcpath} "${perl5.bin} install.me \
-prefix=${destroot} \
-binpath ${destroot}${prefix}/bin \
-binpath ${destroot}${prefix}/libexec/perl${perl5.major} \
-libpath ${destroot}${perl5.archlib} \
-docpath ${destroot}${prefix}/share/doc/mhonarc \
-manpath ${destroot}${prefix}/share/man \
-docpath ${destroot}${prefix}/share/doc/p${perl5.major}-mhonarc \
-manpath ${destroot}${prefix}/share/perl${perl5.major}/man \
-perl ${perl5.bin}"
}
}

supported_archs noarch
}
@@ -0,0 +1,26 @@
diff --git a/lib/mhamain.pl b/lib/mhamain.pl
index 80980a2..d04dcc6 100644
--- lib/mhamain.pl
+++ lib/mhamain.pl
@@ -1562,7 +1562,7 @@ sub signal_catch {
##
sub defineIndex2MsgId {
no warnings qw(deprecated);
- if (!defined(%Index2MsgId)) {
+ if (!%Index2MsgId) {
foreach (keys %MsgId) {
$Index2MsgId{$MsgId{$_}} = $_;
}
diff --git a/lib/mhopt.pl b/lib/mhopt.pl
index 02fb05e..939109b 100644
--- lib/mhopt.pl
+++ lib/mhopt.pl
@@ -865,7 +865,7 @@ sub update_data_1_to_2 {
sub update_data_2_1_to_later {
no warnings qw(deprecated);
# we can preserve filter arguments
- if (defined(%main::MIMEFiltersArgs)) {
+ if (%main::MIMEFiltersArgs) {
warn qq/ preserving MIMEARGS...\n/;
%readmail::MIMEFiltersArgs = %main::MIMEFiltersArgs;
$IsDefault{'MIMEARGS'} = 0;

0 comments on commit d2072be

Please sign in to comment.
You can’t perform that action at this time.