diff options
author | az <az@FreeBSD.org> | 2013-09-23 20:37:58 +0800 |
---|---|---|
committer | az <az@FreeBSD.org> | 2013-09-23 20:37:58 +0800 |
commit | a2b73d1e94d03bd0478cf9462de4092493a53256 (patch) | |
tree | a1a77384b71aa8a35c2c5b56984e7193e424bf85 /lang/perl5.14 | |
parent | c558dbe64b3aba11d4ac39f360b9e143714e65a3 (diff) | |
download | freebsd-ports-gnome-a2b73d1e94d03bd0478cf9462de4092493a53256.tar.gz freebsd-ports-gnome-a2b73d1e94d03bd0478cf9462de4092493a53256.tar.zst freebsd-ports-gnome-a2b73d1e94d03bd0478cf9462de4092493a53256.zip |
- Now use.perl don't spam /etc/make.conf and using ${LOCALBASE}/etc/perl5_version instead
You must switch to DEFAULT_VERSIONS (see ports/UPDATING entry 20130920 by bapt@)
if you are still using PERL_VERSION to define a specific version requirement.
- bump portrevision
Reviewed by: bapt@
Diffstat (limited to 'lang/perl5.14')
-rw-r--r-- | lang/perl5.14/Makefile | 4 | ||||
-rw-r--r-- | lang/perl5.14/files/use.perl | 37 |
2 files changed, 17 insertions, 24 deletions
diff --git a/lang/perl5.14/Makefile b/lang/perl5.14/Makefile index 2aeb1091badb..2b0bfe5bb09c 100644 --- a/lang/perl5.14/Makefile +++ b/lang/perl5.14/Makefile @@ -3,7 +3,7 @@ PORTNAME= perl PORTVERSION= ${PERL_VERSION} -PORTREVISION= 0 +PORTREVISION= 1 CATEGORIES= lang devel perl5 MASTER_SITES= CPAN \ ${MASTER_SITE_LOCAL:S/$/:local/} \ @@ -169,7 +169,7 @@ post-patch: -e 's|%%PERL_VERSION%%|${PERL_VERSION}|g;' \ -e 's|%%PERL_VER%%|${PERL_VER}|g;' \ -e 's|%%PERL_ARCH%%|${PERL_ARCH}|g;' \ - -e 's|%%MAKE_CONF%%|${__MAKE_CONF}|g;' \ + -e 's|%%PERL5_SIGNATURE%%|${LOCALBASE}/etc/perl5_version|g;' \ -e 's|%%LINK_USRBIN%%|${LINK_USRBIN}|g;' \ ${FILESDIR}/use.perl \ > ${WRKDIR}/use.perl diff --git a/lang/perl5.14/files/use.perl b/lang/perl5.14/files/use.perl index 2d1dde6fcda0..338832f597a3 100644 --- a/lang/perl5.14/files/use.perl +++ b/lang/perl5.14/files/use.perl @@ -5,7 +5,7 @@ this=`echo -n $0 | /usr/bin/sed -e 's!^.*/!!'` PERL_VERSION="%%PERL_VERSION%%" PERL_VER="%%PERL_VER%%" -MAKE_CONF=%%MAKE_CONF%% +PERL5_SIGNATURE=%%PERL5_SIGNATURE%% banner=`date +"%F %T"` banner="# added by use.perl $banner" if [ -z "${OSVERSION}" ]; then @@ -21,8 +21,8 @@ fi if [ "$2" = "POST-INSTALL" ] ; then need_remove_links=%%LINK_USRBIN%% need_create_links=%%LINK_USRBIN%% - need_cleanup_make_conf=yes - need_spam_make_conf=yes + need_remove_perl5_signature=yes + need_create_perl5_signature=yes need_post_install=yes if [ "${osreldate}" -lt 900022 ]; then need_cleanup_manpath=yes @@ -30,7 +30,7 @@ if [ "$2" = "POST-INSTALL" ] ; then fi elif [ "$2" = "POST-DEINSTALL" ] ; then need_remove_links=%%LINK_USRBIN%% - need_cleanup_make_conf=yes + need_remove_perl5_signature=yes if [ "${osreldate}" -lt 900022 ]; then need_cleanup_manpath=yes fi @@ -96,19 +96,11 @@ do_post_install() cd ${INCLUDEDIR} && ${PKG_PREFIX}/bin/h2ph *.h machine/*.h sys/*.h >/dev/null } -do_cleanup_make_conf() +do_remove_perl5_signature() { - echo -n "Cleaning up ${MAKE_CONF}..." - if [ -f ${MAKE_CONF} ] ; then - /bin/cp -p ${MAKE_CONF} ${MAKE_CONF}.new - /usr/bin/awk 's=0; - /^#.*use.perl/ { s=1; mode=1 } - /^#/ { s=1; if (mode != 1) { mode=0 } } - /.*PERL.*=/ { s=1; if (mode == 1) { mode=2 } } - /^$/ { s=1; if (mode != 2) { mode = 0 } } - { if (s != 1) { mode = 0 } if (mode == 0) print }' ${MAKE_CONF} >${MAKE_CONF}.new - /bin/mv ${MAKE_CONF} ${MAKE_CONF}.bak - /bin/mv ${MAKE_CONF}.new ${MAKE_CONF} + echo -n "Removing ${PERL5_SIGNATURE}..." + if [ -f ${PERL5_SIGNATURE} ] ; then + /bin/rm ${PERL5_SIGNATURE} fi echo " Done." } @@ -130,11 +122,12 @@ do_cleanup_manpath() fi } -do_spam_make_conf() +do_create_perl5_signature() { - echo -n "Spamming ${MAKE_CONF}..." - echo "$banner" >>${MAKE_CONF} - echo "PERL_VERSION=%%PERL_VERSION%%" >>${MAKE_CONF} + echo -n "Creating ${PERL5_SIGNATURE}..." + echo "$banner" >>${PERL5_SIGNATURE} + echo "# Do not modify PERL_VERSION here, instead use DEFAULT_VERSIONS= perl5=${PERL_VER}" >>${PERL5_SIGNATURE} + echo "PERL_VERSION=%%PERL_VERSION%%" >>${PERL5_SIGNATURE} echo " Done." } @@ -152,8 +145,8 @@ do_spam_manpath() [ "$need_remove_links" = "yes" ] && do_remove_links [ "$need_create_links" = "yes" ] && do_create_links [ "$need_post_install" = "yes" ] && do_post_install -[ "$need_cleanup_make_conf" = "yes" ] && do_cleanup_make_conf -[ "$need_spam_make_conf" = "yes" ] && do_spam_make_conf +[ "$need_remove_perl5_signature" = "yes" ] && do_remove_perl5_signature +[ "$need_create_perl5_signature" = "yes" ] && do_create_perl5_signature [ "$need_cleanup_manpath" = "yes" ] && do_cleanup_manpath [ "$need_spam_manpath" = "yes" ] && do_spam_manpath |