Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 24 Sep 2009 19:12:47 -0400 (EDT)
From:      Greg Larkin <glarkin@FreeBSD.org>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/139121: [PATCH] Correct a 'permission denied' error in rmport and other cleanups
Message-ID:  <200909242312.n8ONClro015212@fbsd70.entropy.prv>
Resent-Message-ID: <200909242320.n8ONK2VU042956@freefall.freebsd.org>

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

>Number:         139121
>Category:       ports
>Synopsis:       [PATCH] Correct a 'permission denied' error in rmport and other cleanups
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Sep 24 23:20:01 UTC 2009
>Closed-Date:
>Last-Modified:
>Originator:     Greg Larkin
>Release:        FreeBSD 7.0-RELEASE i386
>Organization:
The FreeBSD Project
>Environment:
System: FreeBSD fbsd70.entropy.prv 7.0-RELEASE FreeBSD 7.0-RELEASE #0: Sun Feb 24 19:59:52 UTC 2008 root@logan.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386


	
>Description:
	I recently attempted to use rmport to remove the www/cakephp
	and www/cakephp-devel ports after they were repomoved. During
	the script execution, a diff file is generated and should be
	shown to the user before the final commit. I kept receiving
	an error message like "/tmp/rmport.XXXXX/diff: permission denied".

	This was caused by the script attempting to execute the return
	value of the "diff" function (a temporary filename containing
	the diff output). [1]

	I also added some flags to the cvs update to control its
	behavior regardless of the contents of the user's .cvsrc file.
	In my configuration, the cvs update command started building
	the entire ports tree because I have "update -dP" in my .cvsrc. [2]
	
>How-To-Repeat:
	[1] Attempt to remove a port
	[2] Add "update -dP" to ~/.cvsrc and attempt to remove a port
>Fix:

	

--- rmport.diff begins here ---
Index: Tools/scripts/rmport
===================================================================
RCS file: /home/pcvs/ports/Tools/scripts/rmport,v
retrieving revision 1.19
diff -u -r1.19 rmport
--- Tools/scripts/rmport	19 Jun 2008 22:09:01 -0000	1.19
+++ Tools/scripts/rmport	24 Sep 2009 23:04:15 -0000
@@ -390,6 +390,7 @@
 	${PCVS} diff -u ports > ${diffout} 2>&1 || :
 
 	read -p "hit <enter> to view cvs diff output" dummy
+	${PAGER:-less} ${diffout}
 
 	# give this to the outside world so it can be showed to the committer
 	# and removed when we are done
@@ -400,7 +401,7 @@
 commit()
 {
 	log "running cvs update"
-	${PCVS} up ports 2>&1 |${PAGER:-less}
+	${PCVS} -fnq up ports 2>&1 |${PAGER:-less}
 
 	answer=`ask "do you want to commit?"`
 
@@ -528,7 +529,7 @@
 # the diff afterwards
 answer=y
 while [ "${answer}" = "y" ] ; do
-	diffout=`diff`
+	diffout=diff
 
 	# EDITOR instead of PAGER because vim has nice syntax highlighting ;-)
 	${EDITOR} ${diffout}
--- rmport.diff ends here ---


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



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