Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 15 Oct 2015 14:24:43 +0000 (UTC)
From:      Mathieu Arnold <mat@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r399342 - in head/lang: perl5-devel perl5.16 perl5.18 perl5.20 perl5.22
Message-ID:  <201510151424.t9FEOh8S016553@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mat
Date: Thu Oct 15 14:24:43 2015
New Revision: 399342
URL: https://svnweb.freebsd.org/changeset/ports/399342

Log:
  Try to fix upgrading a non default Perl version that is supposed to be
  the default one.
  
  Sponsored by:	Absolight
  Differential Revision:	https://reviews.freebsd.org/D3704

Modified:
  head/lang/perl5-devel/Makefile
  head/lang/perl5.16/Makefile
  head/lang/perl5.18/Makefile
  head/lang/perl5.20/Makefile
  head/lang/perl5.22/Makefile

Modified: head/lang/perl5-devel/Makefile
==============================================================================
--- head/lang/perl5-devel/Makefile	Thu Oct 15 14:19:52 2015	(r399341)
+++ head/lang/perl5-devel/Makefile	Thu Oct 15 14:24:43 2015	(r399342)
@@ -165,9 +165,12 @@ PLIST_SUB+=	PERL_VERSION=${PERL_VERSION}
 		ARCH_LIB=${_ARCH_LIB}
 PLIST_SUB+=	PORTVERSION=${PORTVERSION} # XXX Remove
 
+_PERL5_DEFAULT_FILE=	/tmp/PERL5_DEFAULT
+
 # bsd.default-versions.mk needs to know LOCALBASE for Perl, so
 # bsd.port.options.mk is needed before including it.
 .include <bsd.port.options.mk>
+.sinclude "${_PERL5_DEFAULT_FILE}"
 .include "${.CURDIR}/../../Mk/bsd.default-versions.mk"
 
 # if this port is default due PERL5_DEFAULT
@@ -238,9 +241,21 @@ pre-everything::
 .endif
 
 # Put a symlink to the future libperl.so.x.yy so that -lperl works.
+# Also, save PERL5_DEFAULT in case someone is not using the default Perl
+# version whilst not having set DEFAULT_VERSIONS=perl5=blah.  While upgrading,
+# portmaster/portupgrade will remove the installed Perl version, and it will
+# remove any way to guess what the default Perl version is needed.
 post-extract:
 	${LN} -s libperl.so.${PORTVERSION} ${WRKSRC}/libperl.so
 	${LN} -s libperl.so.${PORTVERSION} ${WRKSRC}/libperl.so.${PERL_VER}
+.if !defined(PACKAGE_BUILDING)
+	@${ECHO_CMD} "PERL5_DEFAULT=${PERL5_DEFAULT}" > ${_PERL5_DEFAULT_FILE}
+.endif
+
+.if !defined(PACKAGE_BUILDING)
+post-clean:
+	@${RM} ${_PERL5_DEFAULT_FILE}
+.endif
 
 .if !defined(MAKING_PATCHES)
 # make clean patch makepatch MAKING_PATCHES=

Modified: head/lang/perl5.16/Makefile
==============================================================================
--- head/lang/perl5.16/Makefile	Thu Oct 15 14:19:52 2015	(r399341)
+++ head/lang/perl5.16/Makefile	Thu Oct 15 14:24:43 2015	(r399342)
@@ -98,7 +98,10 @@ PKGINSTALL=	${WRKDIR}/use.perl
 PKGDEINSTALL=	${WRKDIR}/use.perl
 INSTALL_TARGET=	install-strip
 
+_PERL5_DEFAULT_FILE=	/tmp/PERL5_DEFAULT
+
 .include <bsd.port.pre.mk>
+.sinclude "${_PERL5_DEFAULT_FILE}"
 .include "${PORTSDIR}/Mk/bsd.default-versions.mk"
 
 # if this port is default due PERL5_DEFAULT
@@ -233,9 +236,21 @@ LINK_USRBIN=	no
 SUB_LIST+=	LINK_USRBIN=${LINK_USRBIN}
 
 # Put a symlink to the future libperl.so.x.yy so that -lperl works.
+# Also, save PERL5_DEFAULT in case someone is not using the default Perl
+# version whilst not having set DEFAULT_VERSIONS=perl5=blah.  While upgrading,
+# portmaster/portupgrade will remove the installed Perl version, and it will
+# remove any way to guess what the default Perl version is needed.
 post-extract:
 	${LN} -s libperl.so.${PERL_VERSION} ${WRKSRC}/libperl.so
 	${LN} -s libperl.so.${PERL_VERSION} ${WRKSRC}/libperl.so.${PERL_VER}
+.if !defined(PACKAGE_BUILDING)
+	@${ECHO_CMD} "PERL5_DEFAULT=${PERL5_DEFAULT}" > ${_PERL5_DEFAULT_FILE}
+.endif
+
+.if !defined(PACKAGE_BUILDING)
+post-clean:
+	@${RM} ${_PERL5_DEFAULT_FILE}
+.endif
 
 post-patch:
 	${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|g' \

Modified: head/lang/perl5.18/Makefile
==============================================================================
--- head/lang/perl5.18/Makefile	Thu Oct 15 14:19:52 2015	(r399341)
+++ head/lang/perl5.18/Makefile	Thu Oct 15 14:24:43 2015	(r399342)
@@ -120,9 +120,12 @@ PKGINSTALL=	${WRKDIR}/use.perl
 PKGDEINSTALL=	${WRKDIR}/use.perl
 INSTALL_TARGET=	install-strip
 
+_PERL5_DEFAULT_FILE=	/tmp/PERL5_DEFAULT
+
 # bsd.default-versions.mk needs to know LOCALBASE for Perl, so
 # bsd.port.options.mk is needed before including it.
 .include <bsd.port.options.mk>
+.sinclude "${_PERL5_DEFAULT_FILE}"
 .include "${.CURDIR}/../../Mk/bsd.default-versions.mk"
 
 # if this port is default due PERL5_DEFAULT
@@ -202,9 +205,21 @@ PLIST_SUB+=	PERL_VERSION=${PERL_VERSION}
 		ARCH_LIB=${_ARCH_LIB}
 
 # Put a symlink to the future libperl.so.x.yy so that -lperl works.
+# Also, save PERL5_DEFAULT in case someone is not using the default Perl
+# version whilst not having set DEFAULT_VERSIONS=perl5=blah.  While upgrading,
+# portmaster/portupgrade will remove the installed Perl version, and it will
+# remove any way to guess what the default Perl version is needed.
 post-extract:
 	${LN} -s libperl.so.${PERL_VERSION} ${WRKSRC}/libperl.so
 	${LN} -s libperl.so.${PERL_VERSION} ${WRKSRC}/libperl.so.${PERL_VER}
+.if !defined(PACKAGE_BUILDING)
+	@${ECHO_CMD} "PERL5_DEFAULT=${PERL5_DEFAULT}" > ${_PERL5_DEFAULT_FILE}
+.endif
+
+.if !defined(PACKAGE_BUILDING)
+post-clean:
+	@${RM} ${_PERL5_DEFAULT_FILE}
+.endif
 
 .if !defined(MAKING_PATCHES)
 # make clean patch makepatch MAKING_PATCHES=

Modified: head/lang/perl5.20/Makefile
==============================================================================
--- head/lang/perl5.20/Makefile	Thu Oct 15 14:19:52 2015	(r399341)
+++ head/lang/perl5.20/Makefile	Thu Oct 15 14:24:43 2015	(r399342)
@@ -148,9 +148,12 @@ PLIST_SUB+=	PERL_VERSION=${PERL_VERSION}
 		PRIV_LIB=${_PRIV_LIB} \
 		ARCH_LIB=${_ARCH_LIB}
 
+_PERL5_DEFAULT_FILE=	/tmp/PERL5_DEFAULT
+
 # bsd.default-versions.mk needs to know LOCALBASE for Perl, so
 # bsd.port.options.mk is needed before including it.
 .include <bsd.port.options.mk>
+.sinclude "${_PERL5_DEFAULT_FILE}"
 .include "${.CURDIR}/../../Mk/bsd.default-versions.mk"
 
 # if this port is default due PERL5_DEFAULT
@@ -197,9 +200,21 @@ pre-everything::
 .endif
 
 # Put a symlink to the future libperl.so.x.yy so that -lperl works.
+# Also, save PERL5_DEFAULT in case someone is not using the default Perl
+# version whilst not having set DEFAULT_VERSIONS=perl5=blah.  While upgrading,
+# portmaster/portupgrade will remove the installed Perl version, and it will
+# remove any way to guess what the default Perl version is needed.
 post-extract:
 	${LN} -s libperl.so.${PERL_VERSION} ${WRKSRC}/libperl.so
 	${LN} -s libperl.so.${PERL_VERSION} ${WRKSRC}/libperl.so.${PERL_VER}
+.if !defined(PACKAGE_BUILDING)
+	@${ECHO_CMD} "PERL5_DEFAULT=${PERL5_DEFAULT}" > ${_PERL5_DEFAULT_FILE}
+.endif
+
+.if !defined(PACKAGE_BUILDING)
+post-clean:
+	@${RM} ${_PERL5_DEFAULT_FILE}
+.endif
 
 .if !defined(MAKING_PATCHES)
 # make clean patch makepatch MAKING_PATCHES=

Modified: head/lang/perl5.22/Makefile
==============================================================================
--- head/lang/perl5.22/Makefile	Thu Oct 15 14:19:52 2015	(r399341)
+++ head/lang/perl5.22/Makefile	Thu Oct 15 14:24:43 2015	(r399342)
@@ -146,9 +146,12 @@ PLIST_SUB+=	PERL_VERSION=${PERL_VERSION}
 		PRIV_LIB=${_PRIV_LIB} \
 		ARCH_LIB=${_ARCH_LIB}
 
+_PERL5_DEFAULT_FILE=	/tmp/PERL5_DEFAULT
+
 # bsd.default-versions.mk needs to know LOCALBASE for Perl, so
 # bsd.port.options.mk is needed before including it.
 .include <bsd.port.options.mk>
+.sinclude "${_PERL5_DEFAULT_FILE}"
 .include "${.CURDIR}/../../Mk/bsd.default-versions.mk"
 
 # if this port is default due PERL5_DEFAULT
@@ -195,9 +198,21 @@ pre-everything::
 .endif
 
 # Put a symlink to the future libperl.so.x.yy so that -lperl works.
+# Also, save PERL5_DEFAULT in case someone is not using the default Perl
+# version whilst not having set DEFAULT_VERSIONS=perl5=blah.  While upgrading,
+# portmaster/portupgrade will remove the installed Perl version, and it will
+# remove any way to guess what the default Perl version is needed.
 post-extract:
 	${LN} -s libperl.so.${PERL_VERSION} ${WRKSRC}/libperl.so
 	${LN} -s libperl.so.${PERL_VERSION} ${WRKSRC}/libperl.so.${PERL_VER}
+.if !defined(PACKAGE_BUILDING)
+	@${ECHO_CMD} "PERL5_DEFAULT=${PERL5_DEFAULT}" > ${_PERL5_DEFAULT_FILE}
+.endif
+
+.if !defined(PACKAGE_BUILDING)
+post-clean:
+	@${RM} ${_PERL5_DEFAULT_FILE}
+.endif
 
 .if !defined(MAKING_PATCHES)
 # make clean patch makepatch MAKING_PATCHES=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201510151424.t9FEOh8S016553>