ports/61857: [PATCH] use recent Perl on recent FreeBSD

Dag-Erling Smørgrav des at des.no
Sun Jan 25 01:30:22 UTC 2004


>Number:         61857
>Category:       ports
>Synopsis:       [PATCH] use recent Perl on recent FreeBSD
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jan 24 17:30:19 PST 2004
>Closed-Date:
>Last-Modified:
>Originator:     Dag-Erling Smørgrav
>Release:        FreeBSD 5.2-CURRENT i386
>Organization:
>Environment:
System: FreeBSD dwp.des.no 5.2-CURRENT FreeBSD 5.2-CURRENT #22: Sat Jan 24 20:11:54 CET 2004 des at dwp.des.no:/usr/obj/usr/src/sys/dwp_smp i386

ports-current

>Description:

the ports system still defaults to a three-years-old version of Perl,
even on the most recent FreeBSD version.

while this isn't really a problem for someone relying entirely on the
ports tree, anyone using pre-compiled packages will be screwed because
packages that depend on Perl will forcibly install Perl 5.6.1 on top
of Perl 5.8.2

on top of this, Perl 5.6.1 is by default built to use the system
malloc() despite a known bug causing it to perform very poorly when
not using its own malloc() implementation.

there is also a bug in bsd.ports.mk's Perl support: PERL_LEVEL is
derived from PERL_VERSION before PERL_VERSION is actually defined,
resulting in PERL_LEVEL not being defined at all.  as a result,
the default value of PERL_VERSION is irrelevant since the actual
Perl port to use is selected on the basis of PERL_LEVEL which is
undefined on systems which don't already have Perl.

>How-To-Repeat:

# pkg_add -r perl5.8
# pkg_add -r porteasy

and watch perl5 overwrite (parts of) perl5.8 and forcibly install
symlinks and /etc/make.conf entries making it the only Perl.

>Fix:

apply the attached patch.

--- ports-perl.diff begins here ---
Index: Mk/bsd.port.mk
===================================================================
RCS file: /home/pcvs/ports/Mk/bsd.port.mk,v
retrieving revision 1.483
diff -u -r1.483 bsd.port.mk
--- Mk/bsd.port.mk	24 Jan 2004 01:26:30 -0000	1.483
+++ Mk/bsd.port.mk	25 Jan 2004 00:48:55 -0000
@@ -1133,22 +1133,11 @@
 RUN_DEPENDS+=	${APXS}:${PORTSDIR}/${APACHE_PORT}
 .endif
 
-.if !defined(PERL_LEVEL) && defined(PERL_VERSION)
-perl_major=		${PERL_VERSION:C|^([1-9]+).*|\1|}
-_perl_minor=	00${PERL_VERSION:C|^([1-9]+)\.([0-9]+).*|\2|}
-perl_minor=		${_perl_minor:C|^.*(...)|\1|}
-.if ${perl_minor} >= 100
-perl_minor=		${PERL_VERSION:C|^([1-9]+)\.([0-9][0-9][0-9]).*|\2|}
-perl_patch=		${PERL_VERSION:C|^.*(..)|\1|}
-.else # ${perl_minor} < 100
-_perl_patch=	0${PERL_VERSION:C|^([1-9]+)\.([0-9]+)\.*|0|}
-perl_patch=		${_perl_patch:C|^.*(..)|\1|}
-.endif # ${perl_minor} < 100
-PERL_LEVEL=	${perl_major}${perl_minor}${perl_patch}
+.if ${OSVERSION} >= 501113
+PERL_VERSION?=	5.8.2
+PERL_VER?=	5.8.2
+PERL_ARCH?=	mach
 .else
-PERL_LEVEL=0
-.endif # !defined(PERL_LEVEL) && defined(PERL_VERSION)
-
 .if ${OSVERSION} >= 500032
 PERL_VERSION?=	5.6.1
 PERL_VER?=		5.6.1
@@ -1168,6 +1157,23 @@
 PERL_ARCH?=		${ARCH}-freebsd
 .endif
 .endif
+.endif
+
+.if !defined(PERL_LEVEL) && defined(PERL_VERSION)
+perl_major=		${PERL_VERSION:C|^([1-9]+).*|\1|}
+_perl_minor=	00${PERL_VERSION:C|^([1-9]+)\.([0-9]+).*|\2|}
+perl_minor=		${_perl_minor:C|^.*(...)|\1|}
+.if ${perl_minor} >= 100
+perl_minor=		${PERL_VERSION:C|^([1-9]+)\.([0-9][0-9][0-9]).*|\2|}
+perl_patch=		${PERL_VERSION:C|^.*(..)|\1|}
+.else # ${perl_minor} < 100
+_perl_patch=	0${PERL_VERSION:C|^([1-9]+)\.([0-9]+)\.*|0|}
+perl_patch=		${_perl_patch:C|^.*(..)|\1|}
+.endif # ${perl_minor} < 100
+PERL_LEVEL=	${perl_major}${perl_minor}${perl_patch}
+.else
+PERL_LEVEL=0
+.endif # !defined(PERL_LEVEL) && defined(PERL_VERSION)
 
 .if ${PERL_LEVEL} >= 500800
 PERL_PORT?=	perl5.8
--- ports-perl.diff ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list