From glarkin@sourcehosting.net  Thu Sep 24 23:14:08 2009
Return-Path: <glarkin@sourcehosting.net>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CDB5A1065670
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 24 Sep 2009 23:14:08 +0000 (UTC)
	(envelope-from glarkin@sourcehosting.net)
Received: from mail1.sourcehosting.net (113901-app1.sourcehosting.net [72.32.213.11])
	by mx1.freebsd.org (Postfix) with ESMTP id A7C6B8FC1E
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 24 Sep 2009 23:14:08 +0000 (UTC)
Received: from 68-189-245-235.dhcp.oxfr.ma.charter.com ([68.189.245.235] helo=cube.entropy.prv)
	by mail1.sourcehosting.net with esmtp (Exim 4.69 (FreeBSD))
	(envelope-from <glarkin@sourcehosting.net>)
	id 1MqxVi-00032v-Ly
	for FreeBSD-gnats-submit@freebsd.org; Thu, 24 Sep 2009 19:14:07 -0400
Received: from fbsd70.entropy.prv (fbsd70.entropy.prv [192.168.1.14])
	by cube.entropy.prv (Postfix) with ESMTP id B53E03507B6E
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 24 Sep 2009 19:14:02 -0400 (EDT)
Received: from fbsd70.entropy.prv (localhost [127.0.0.1])
	by fbsd70.entropy.prv (8.14.2/8.14.2) with ESMTP id n8ONClAT015213
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 24 Sep 2009 19:12:47 -0400 (EDT)
	(envelope-from glarkin@fbsd70.entropy.prv)
Received: (from glarkin@localhost)
	by fbsd70.entropy.prv (8.14.2/8.14.2/Submit) id n8ONClro015212;
	Thu, 24 Sep 2009 19:12:47 -0400 (EDT)
	(envelope-from glarkin)
Message-Id: <200909242312.n8ONClro015212@fbsd70.entropy.prv>
Date: Thu, 24 Sep 2009 19:12:47 -0400 (EDT)
From: Greg Larkin <glarkin@freebsd.org>
Reply-To: Greg Larkin <glarkin@freebsd.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [PATCH] Correct a 'permission denied' error in rmport and other cleanups
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         139121
>Category:       ports
>Synopsis:       [patch] Correct a 'permission denied' error in Tools/scripts/rmport and other cleanups
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    glarkin
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Sep 24 23:20:01 UTC 2009
>Closed-Date:    Mon Oct 05 20:48:43 EDT 2009
>Last-Modified:  Tue Oct  6 00:50:03 UTC 2009
>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:
Responsible-Changed-From-To: freebsd-ports-bugs->glarkin 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Tue Sep 29 21:54:50 UTC 2009 
Responsible-Changed-Why:  
Scripts under ports/Tools are free to fix. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=139121 
State-Changed-From-To: open->closed 
State-Changed-By: glarkin 
State-Changed-When: Mon Oct 5 20:48:27 EDT 2009 
State-Changed-Why:  
Committed change to ports tree. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=139121 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/139121: commit references a PR
Date: Tue,  6 Oct 2009 00:48:26 +0000 (UTC)

 glarkin     2009-10-06 00:48:13 UTC
 
   FreeBSD ports repository
 
   Modified files:
     Tools/scripts        rmport 
   Log:
   - Fixed "permission denied" error
   - Prevented full ports tree build when operating with ~/.cvsrc
   
   PR:             ports/139121
   
   Revision  Changes    Path
   1.20      +3 -3      ports/Tools/scripts/rmport
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
