Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 15 Mar 2013 16:00:54 -0700 (PDT)
From:      Craig Leres <leres@ee.lbl.gov>
To:        FreeBSD-gnats-submit@freebsd.org
Cc:        leres@ee.lbl.gov
Subject:   ports/177006: [PATCH] lang/perl5.12, lang/perl5.14, lang/perl5.16: Don't write to make.conf unless necessary
Message-ID:  <201303152300.r2FN0soI008861@fun.ee.lbl.gov>
Resent-Message-ID: <201303152310.r2FNA0qg047220@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         177006
>Category:       ports
>Synopsis:       [PATCH] lang/perl5.12, lang/perl5.14, lang/perl5.16: Don't write to make.conf unless necessary
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Mar 15 23:10:00 UTC 2013
>Closed-Date:
>Last-Modified:
>Originator:     Craig Leres
>Release:        FreeBSD 9.1-RELEASE amd64
>Organization:
Lawrence Berkeley National Laboratory
>Environment:
System: FreeBSD fun.ee.lbl.gov 9.1-RELEASE FreeBSD 9.1-RELEASE #4 r13: Fri Feb 1 19:03:16 PST 2013 leres@fun.ee.lbl.gov:/sys/amd64/compile/LBL amd64

	
>Description:
	Reinstalling perl results in a USE_PERL line being appended
	to /etc/make.conf even when the identical definition is
	already present and in effect.

>How-To-Repeat:
	deinstall/install perl and notice make.conf has been changed:

	# co -p /etc/make.conf | diff -u - /etc/make.conf
	/etc/RCS/make.conf,v  -->  standard output
	revision 1.48
	--- -   2013-03-15 15:54:26.831481426 -0700
	+++ /etc/make.conf      2013-03-15 15:54:14.000000000 -0700
	@@ -79,3 +79,5 @@
	 PYTHON_VERSION=python2.7
	 PERL_VERSION=5.16.2
	 WITH_BDB_VER=48
	+# added by use.perl 2013-03-15 15:54:14
	+PERL_VERSION=5.16.2

>Fix:
	Only update when necessary; apply the attached patch to
	files/use.perl in lang/perl5.12, lang/perl5.14 and
	lang/perl5.16.

--- patch.txt begins here ---
--- files/use.perl.orig	2013-03-15 15:43:51.000000000 -0700
+++ files/use.perl	2013-03-15 15:44:40.000000000 -0700
@@ -131,10 +131,19 @@
 
 do_spam_make_conf()
 {
-	echo -n "Spamming ${MAKE_CONF}..."
-	echo "$banner" >>${MAKE_CONF}
-	echo "PERL_VERSION=%%PERL_VERSION%%" >>${MAKE_CONF}
-	echo " Done."
+	# Only update when necessary
+	echo -n "Checking ${MAKE_CONF}..."
+	curver="`egrep '^PERL_VERSION=' ${MAKE_CONF} | tail -1`"
+	newver="PERL_VERSION=%%PERL_VERSION%%"
+	if [ "${curver}" == "${newver}" ]; then
+		echo " Ok."
+	else
+		echo " Needs updating."
+		echo -n "Spamming ${MAKE_CONF}..."
+		echo "$banner" >>${MAKE_CONF}
+		echo "${newver}" >>${MAKE_CONF}
+		echo " Done."
+	fi
 }
 
 do_spam_manpath()
--- patch.txt ends here ---


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



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