From sem@ciam.ru  Wed Jan 22 14:21:18 2003
Return-Path: <sem@ciam.ru>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id B59A737B401
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 22 Jan 2003 14:21:18 -0800 (PST)
Received: from hueymiccailhuitl.mtu.ru (hueytecuilhuitl.mtu.ru [195.34.32.123])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 58BFB43E4A
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 22 Jan 2003 14:21:17 -0800 (PST)
	(envelope-from sem@ciam.ru)
Received: from sem-home.ciam.ru (ppp133-159.dialup.mtu-net.ru [62.118.133.159])
	by hueymiccailhuitl.mtu.ru (Postfix) with ESMTP id 2F67FFF52D
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 23 Jan 2003 01:21:15 +0300 (MSK)
	(envelope-from sem@ciam.ru)
Received: from sem by sem-home.ciam.ru with local (Exim 4.12)
	id 18bTFA-000HsJ-00
	for FreeBSD-gnats-submit@freebsd.org; Thu, 23 Jan 2003 01:21:12 +0300
Message-Id: <E18bTFA-000HsJ-00@sem-home.ciam.ru>
Date: Thu, 23 Jan 2003 01:21:12 +0300
From: Sergey Matveychuk <sem@ciam.ru>
Reply-To: Sergey Matveychuk <sem@ciam.ru>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: Ports always depend on Perl5.6.1 even when PERL_VERSION in /etc/make.conf set to 5.8.0 in -CURRENT
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         47377
>Category:       ports
>Synopsis:       Ports always depend on Perl5.6.1 even when PERL_VERSION in /etc/make.conf set to 5.8.0 in -CURRENT
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    portmgr
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jan 22 14:30:02 PST 2003
>Closed-Date:    Sat May 10 15:54:39 PDT 2003
>Last-Modified:  Sat May 10 15:54:39 PDT 2003
>Originator:     Sergey Matveychuk
>Release:        FreeBSD 5.0-RELEASE i386
>Organization:
>Environment:
System: FreeBSD sem-home.ciam.ru 5.0-RELEASE FreeBSD 5.0-RELEASE #2: Mon Jan 20 12:56:36 MSK 2003 root@sem-home.ciam.ru:/usr/obj/usr/src/sys/SEM-HOME i386


	
>Description:
	I guess Perl 5.8.0 is better than 5.6.1. And I use 5.8.0. But when I'v
	installed any port that depends on perl5 I'v got it marked as depends
	on perl 5.6.1. I don't like it.
	Here is a small patch I use to fix this situation.
>How-To-Repeat:
	
>Fix:


--- bsd.port.mk	Thu Jan 23 01:05:30 2003
+++ bsd.port.mk	Thu Jan 23 01:03:07 2003
@@ -1209,10 +1209,18 @@
 PERL5=			${LOCALBASE}/bin/perl${PERL_VERSION}
 PERL=			${LOCALBASE}/bin/perl
 .if defined(USE_PERL5) || defined(USE_PERL5_BUILD)
+.if ${perl_minor} == 8
+BUILD_DEPENDS+=	${PERL5}:${PORTSDIR}/lang/perl5.8
+.else
 BUILD_DEPENDS+=	${PERL5}:${PORTSDIR}/lang/perl5
 .endif
+.endif
 .if defined(USE_PERL5) || defined(USE_PERL5_RUN)
+.if ${perl_minor} == 8
+RUN_DEPENDS+=	${PERL5}:${PORTSDIR}/lang/perl5.8
+.else
 RUN_DEPENDS+=	${PERL5}:${PORTSDIR}/lang/perl5
+.endif
 .endif
 .endif
 

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->tobez 
Responsible-Changed-By: arved 
Responsible-Changed-When: Thu Jan 23 10:08:47 PST 2003 
Responsible-Changed-Why:  
Over to Maintainer 

http://www.freebsd.org/cgi/query-pr.cgi?pr=47377 
Responsible-Changed-From-To: tobez->portmgr 
Responsible-Changed-By: tobez 
Responsible-Changed-When: Wed Feb 5 19:38:07 CET 2003 
Responsible-Changed-Why:  
Portmgr wants it.  :-) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=47377 

From: Kris Kennaway <kris@obsecurity.org>
To: freebsd-gnats-submit@FreeBSD.org, sem@ciam.ru
Cc:  
Subject: Re: ports/47377
Date: Sun, 16 Feb 2003 12:55:56 -0800

 I'm not sure about the use of the ${perl_minor} variable.  The
 makefile style used in bsd.port.mk is that lower-case variables are
 supposed to be for internal use only (e.g. temporary variables).
 External variables that are accessible to the user are capitalized.
 
 Also, it's not guaranteed that all ports will build successfully with
 perl 5.8: I expect that there are some ports that do not work with the
 newer version (and vice versa).  That's something that would have to
 be tested either way.
 
 The best possibility would be to be consistent with how we handle
 multiple versions of automake, etc, and have a USE_PERL5_VER variable
 set in port makefiles that chooses which version is used (for those
 ports that require the older perl).
 
 For the user to specify their desired default value (analogous to what
 your patch does), PERL_VERSION could be used instead (like we use
 XFREE86_VERSION for the user to specify a preference of XFree86 3.x or
 4.x).  If it is not set, then the default value is used.  If it is
 set, but a port wants a different version (sets USE_PERL5_VER to a
 different value), then we can either fail with an error, or just use
 the version the port wants.
 
 Kris

From: Anton Berezin <tobez@tobez.org>
To: freebsd-gnats-submit@FreeBSD.org, sem@ciam.ru,
	kris@obsecurity.org
Cc:  
Subject: Re: ports/47377
Date: Thu, 20 Feb 2003 00:57:55 +0100

 Hi,
 
 > I'm not sure about the use of the ${perl_minor} variable.  The
 > makefile style used in bsd.port.mk is that lower-case variables are
 > supposed to be for internal use only (e.g. temporary variables).
 > External variables that are accessible to the user are capitalized.
 
 Er, Kris...  This variable is not used in a way `accessible to the
 user'.  The author of the PR simply re-used one existing internal
 variable for another purpose, still within the framework of bsd.port.mk.
 
 > Also, it's not guaranteed that all ports will build successfully with
 > perl 5.8: I expect that there are some ports that do not work with the
 > newer version (and vice versa).  That's something that would have to
 > be tested either way.
 
 This is true, but I can almost assure you that ports that build fine
 with 5.005_03 *and* 5.6.1 will have no troubles with 5.8.0.  At the same
 time, ports that do *not* work with 5.005_03 but work with 5.6.1 *and*
 do not work with 5.8.0 should simply specify the dependency on
 lang/perl5, and the same goes for ports that work only with 5.8.0.
 
 In any case, the fix in the PR is vastly preferable to the situtation we
 have now.  I am no great fun of 5.8.0 as such, it caused too much grief
 to me already, but it seems that more and more people are starting to
 use it as their primary perl.  I think we should let them shoot
 themselves in the foot in the most graceful manner possible.
 
 > The best possibility would be to be consistent with how we handle
 > multiple versions of automake, etc, and have a USE_PERL5_VER variable
 > set in port makefiles that chooses which version is used (for those
 > ports that require the older perl).
 
 To make this possible, I (or anybody else) should first make two perls
 peacefully coexist on a single system, something which we do not have
 now.  In any case I would object making 5.8.0 the default.
 
 > For the user to specify their desired default value (analogous to what
 > your patch does), PERL_VERSION could be used instead (like we use
 > XFREE86_VERSION for the user to specify a preference of XFree86 3.x or
 > 4.x).  If it is not set, then the default value is used.  If it is
 > set, but a port wants a different version (sets USE_PERL5_VER to a
 > different value), then we can either fail with an error, or just use
 > the version the port wants.
 
 Yes, this sounds reasonable.  You might also want to look at the
 PR 48465, http://www.freebsd.org/cgi/query-pr.cgi?pr=48465, which takes
 slightly different, but similar, approach to the same problem.
 
 =Anton.
 -- 
 | Anton Berezin                |      FreeBSD: The power to serve |
 | catpipe Systems ApS   _ _ |_ |           http://www.FreeBSD.org |
 | tobez@catpipe.net    (_(_||  |                tobez@FreeBSD.org | 
 | +45 7021 0050                |         Private: tobez@tobez.org |

From: Kris Kennaway <kris@obsecurity.org>
To: Anton Berezin <tobez@tobez.org>,
	freebsd-gnats-submit@FreeBSD.org, sem@ciam.ru, kris@obsecurity.org
Cc:  
Subject: Re: ports/47377
Date: Wed, 19 Feb 2003 18:28:42 -0800

 On Thu, Feb 20, 2003 at 12:57:55AM +0100, Anton Berezin wrote:
 > Hi,
 > 
 > > I'm not sure about the use of the ${perl_minor} variable.  The
 > > makefile style used in bsd.port.mk is that lower-case variables are
 > > supposed to be for internal use only (e.g. temporary variables).
 > > External variables that are accessible to the user are capitalized.
 > 
 > Er, Kris...  This variable is not used in a way `accessible to the
 > user'.  The author of the PR simply re-used one existing internal
 > variable for another purpose, still within the framework of bsd.port.mk.
 
 It looked like he was hoping to use perl_minor as a way for the user
 to select which version of perl he/she wants.  I may have
 misinterpreted the intent.
  
 > > Also, it's not guaranteed that all ports will build successfully with
 > > perl 5.8: I expect that there are some ports that do not work with the
 > > newer version (and vice versa).  That's something that would have to
 > > be tested either way.
 > 
 > This is true, but I can almost assure you that ports that build fine
 > with 5.005_03 *and* 5.6.1 will have no troubles with 5.8.0.  At the same
 > time, ports that do *not* work with 5.005_03 but work with 5.6.1 *and*
 > do not work with 5.8.0 should simply specify the dependency on
 > lang/perl5, and the same goes for ports that work only with 5.8.0.
 > 
 > In any case, the fix in the PR is vastly preferable to the situtation we
 > have now.  I am no great fun of 5.8.0 as such, it caused too much grief
 > to me already, but it seems that more and more people are starting to
 > use it as their primary perl.  I think we should let them shoot
 > themselves in the foot in the most graceful manner possible.
 > 
 > > The best possibility would be to be consistent with how we handle
 > > multiple versions of automake, etc, and have a USE_PERL5_VER variable
 > > set in port makefiles that chooses which version is used (for those
 > > ports that require the older perl).
 > 
 > To make this possible, I (or anybody else) should first make two perls
 > peacefully coexist on a single system, something which we do not have
 > now.  In any case I would object making 5.8.0 the default.
 
 Yeah, that's something we also need.
 
 > > For the user to specify their desired default value (analogous to what
 > > your patch does), PERL_VERSION could be used instead (like we use
 > > XFREE86_VERSION for the user to specify a preference of XFree86 3.x or
 > > 4.x).  If it is not set, then the default value is used.  If it is
 > > set, but a port wants a different version (sets USE_PERL5_VER to a
 > > different value), then we can either fail with an error, or just use
 > > the version the port wants.
 > 
 > Yes, this sounds reasonable.  You might also want to look at the
 > PR 48465, http://www.freebsd.org/cgi/query-pr.cgi?pr=48465, which takes
 > slightly different, but similar, approach to the same problem.
 
 Thanks, I'll take a look.
 
 Kris

From: "Scot Hetzel" <hetzels@westbend.net>
To: "FreeBSD-GNATS" <FreeBSD-gnats-submit@FreeBSD.ORG>
Cc: <sem@ciam.ru>
Subject: Re: ports/47377: Ports always depend on Perl5.6.1 even when PERL_VERSION in /etc/make.conf set to 5.8.0 in -CURRENT
Date: Wed, 19 Feb 2003 20:46:28 -0600

 I had created a similar patch to Sergey Matveychuk in PR 48465 (see second
 patch in PR), except mine uses PERL_LEVEL to determine which perl port is
 installed.
 
 Scot
 

From: "Sergey Matveychuk" <sem@ciam.ru>
To: <freebsd-gnats-submit@FreeBSD.org>
Cc:  
Subject: Re: ports/47377: Ports always depend on Perl5.6.1 even when PERL_VERSION in /etc/make.conf set to 5.8.0 in -CURRENT
Date: Fri, 21 Feb 2003 14:53:18 +0300

 This is a multi-part message in MIME format.
 
 ------=_NextPart_000_0039_01C2D9B8.F8ABBE50
 Content-Type: text/plain;
 	charset="koi8-r"
 Content-Transfer-Encoding: 7bit
 
 I'v remade a patch according with Kris Kennaway wishes.
 If port depend on fixed perl version, port authors can set a new variable
 USE_PERL5_VER in minor version number (something like XFREE86_VERSION).
 Installed perl version is default for USE_PERL5_VER if unsetted.
 
 ----
 Sem.
 
 ------=_NextPart_000_0039_01C2D9B8.F8ABBE50
 Content-Type: application/octet-stream;
 	name="perl5_8-2.patch"
 Content-Transfer-Encoding: quoted-printable
 Content-Disposition: attachment;
 	filename="perl5_8-2.patch"
 
 --- bsd.port.mk.1_440	Mon Feb 17 02:23:01 2003
 +++ bsd.port.mk	Wed Feb 19 02:17:25 2003
 @@ -245,6 +245,7 @@
  # USE_PERL5		- Says that the port uses perl5 for building and running.
  # USE_PERL5_BUILD	- Says that the port uses perl5 for building.
  # USE_PERL5_RUN		- Says that the port uses perl5 for running.
 +# USE_PERL5_VER - Says that the port requires this version of perl5
  # PERL5			- Set to full path of perl5, either in the system or
  #				  installed from a port.
  # PERL			- Set to full path of perl5, either in the system or
 @@ -1215,23 +1216,34 @@
  USE_PERL5=3D	yes
  .endif
 =20
 -.if exists(/usr/bin/perl5) && ${OSVERSION} >=3D 300000 && ${OSVERSION} =
 < 500036
 -.if !exists(/usr/bin/perl${PERL_VERSION}) && ( defined(USE_PERL5) || \
 -	defined(USE_PERL5_BUILD) || defined(USE_PERL5_RUN) )
 +USE_PERL5_VER?=3D${PERL_VERSION:C|^([1-9]+)\.([0-9]+).*|\2|}
 +.if ${OSVERSION} > 500036 && ${USE_PERL5_VER} =3D=3D 5
  pre-everything::
 -	@${ECHO_CMD} "Error: you don't have the right version of perl in =
 /usr/bin."
 +	@${ECHO_CMD} "Error: port require ancient perl that's absent in =
 ports."
  	@${FALSE}
  .endif
 +.if exists(/usr/bin/perl5) && ${OSVERSION} >=3D 300000 && ${OSVERSION} =
 < 500036 && ${USE_PERL5_VER} =3D=3D 5
  PERL5=3D			/usr/bin/perl${PERL_VERSION}
  PERL=3D			/usr/bin/perl
  .else
 -PERL5=3D			${LOCALBASE}/bin/perl${PERL_VERSION}
 +PERL5!=3D			${LS} ${LOCALBASE}/bin/perl5.${USE_PERL5_VER}* 2>/dev/null =
 || ${TRUE}
 +.if empty(PERL5)
 +PERL5=3D			${LOCALBASE}/bin/perl5.${USE_PERL5_VER}
 +.endif
  PERL=3D			${LOCALBASE}/bin/perl
  .if defined(USE_PERL5) || defined(USE_PERL5_BUILD)
 +.if ${USE_PERL5_VER} =3D=3D 8
 +BUILD_DEPENDS+=3D	${PERL5}:${PORTSDIR}/lang/perl5.8
 +.else
  BUILD_DEPENDS+=3D	${PERL5}:${PORTSDIR}/lang/perl5
  .endif
 +.endif
  .if defined(USE_PERL5) || defined(USE_PERL5_RUN)
 +.if ${USE_PERL5_VER} =3D=3D 8
 +RUN_DEPENDS+=3D	${PERL5}:${PORTSDIR}/lang/perl5.8
 +.else
  RUN_DEPENDS+=3D	${PERL5}:${PORTSDIR}/lang/perl5
 +.endif
  .endif
  .endif
 =20
 
 ------=_NextPart_000_0039_01C2D9B8.F8ABBE50--
 
 
State-Changed-From-To: open->closed 
State-Changed-By: kris 
State-Changed-When: Sat May 10 15:52:09 PDT 2003 
State-Changed-Why:  
After comparing this port and 48465, we decided to go 
with the latter solution, which is a bit simpler for now. 

The approach of allowing individual ports to specify 
a preferred version of perl is a good one in principle, but 
currently the different perl ports cannot coexist on a 
system, so this is not useful in practise.  If the perl ports 
are ever fixed so you can have multiple versions installed at 
once then we should revisit this approach.  Thanks for your 
work on the submission. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=47377 
>Unformatted:
