ports/177006: [PATCH] lang/perl5.12, lang/perl5.14, lang/perl5.16: Don't write to make.conf unless necessary

Craig Leres leres at ee.lbl.gov
Fri Mar 15 23:10:00 UTC 2013


>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 at 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:


More information about the freebsd-ports-bugs mailing list