From jhelfman@experts-exchange.com  Mon Aug 22 20:16:23 2011
Return-Path: <jhelfman@experts-exchange.com>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CDB0A1065670
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 22 Aug 2011 20:16:23 +0000 (UTC)
	(envelope-from jhelfman@experts-exchange.com)
Received: from mail.experts-exchange.com (mail.experts-exchange.com [72.29.183.251])
	by mx1.freebsd.org (Postfix) with ESMTP id ADFB98FC08
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 22 Aug 2011 20:16:23 +0000 (UTC)
Received: from mail.experts-exchange.com (localhost [127.0.0.1])
	by mail.experts-exchange.com (Postfix) with ESMTP id 5F29D700DA0
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 22 Aug 2011 13:16:23 -0700 (PDT)
Received: from mail.experts-exchange.com ([127.0.0.1])
	by mail.experts-exchange.com (mail.experts-exchange.com [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id NxIskKYZO9Qe for <FreeBSD-gnats-submit@freebsd.org>;
	Mon, 22 Aug 2011 13:16:23 -0700 (PDT)
Received: from experts-exchange.com (unknown [192.168.103.122])
	by mail.experts-exchange.com (Postfix) with SMTP id 3C254700D73
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 22 Aug 2011 13:16:23 -0700 (PDT)
Received: (nullmailer pid 95109 invoked by uid 1001);
	Mon, 22 Aug 2011 20:15:25 -0000
Message-Id: <1314044125.977261.95108.nullmailer@experts-exchange.com>
Date: Mon, 22 Aug 2011 13:15:25 -0700
From: Jason Helfman <jhelfman@experts-exchange.com>
Reply-To: Jason Helfman <jhelfman@experts-exchange.com>
To: FreeBSD-gnats-submit@freebsd.org
Subject: [patch] Mk/bsd.port.mk: cleanup orig files in post-patch-script target
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         160010
>Category:       ports
>Synopsis:       [patch] Mk/bsd.port.mk: cleanup orig files in post-patch-script target
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    portmgr
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Aug 22 20:20:07 UTC 2011
>Closed-Date:    
>Last-Modified:  Tue Aug 23 16:30:03 UTC 2011
>Originator:     Jason Helfman
>Release:        FreeBSD 8.2-RELEASE i386
>Organization:
Experts Exchange, LLC.
>Environment:
System: FreeBSD eggman.experts-exchange.com 8.2-RELEASE FreeBSD 8.2-RELEASE #0: Fri Feb 18 02:24:46 UTC 2011 root@almeida.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386


	
>Description:
.orig files are being cleaned up in www/tomcat55, and now security/p5-Crypt-RandPasswd
put this into bpm (many ways to patch that create .orig files, so it is unconditional if target is not defined)
>How-To-Repeat:
	
>Fix:

Index: Mk/bsd.port.mk
===================================================================
RCS file: /home/jhelfman/ncvs/ports/Mk/bsd.port.mk,v
retrieving revision 1.692
diff -u -r1.692 bsd.port.mk
--- Mk/bsd.port.mk	12 Aug 2011 16:39:23 -0000	1.692
+++ Mk/bsd.port.mk	22 Aug 2011 20:13:22 -0000
@@ -3655,6 +3655,11 @@
 		fi; \
 	fi
 .endif
+.if !target(post-patch-script)
+post-patch-script:
+	@${ECHO_MSG} "===> Removing patched remnants for ${PKGNAME}"
+	@${FIND} ${WRKSRC} -type f \( -name '*.orig' \) -delete
+.endif
 
 .if !target(configure-autotools)
 configure-autotools:
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->portmgr 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Mon Aug 22 20:20:17 UTC 2011 
Responsible-Changed-Why:  
bsd.port.mk is portmgr territory (via the GNATS Auto Assign Tool) 

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

From: Jason Helfman <jhelfman@e-e.com>
To: bug-followup@freebsd.org
Cc:  
Subject: Re: ports/160010: [patch] Mk/bsd.port.mk: cleanup orig files in
 post-patch-script target
Date: Mon, 22 Aug 2011 14:36:54 -0700

 --nmemrqcdn5VTmUEE
 Content-Type: text/plain; charset=us-ascii; format=flowed
 Content-Disposition: inline
 
 Pad makepatch target so .orig files aren't clobbered during process. Here is
 the new patch. wxs@ raised this concern, along with others for this change.
 
 -jgh
 -- 
 Jason Helfman
 System Administrator
 experts-exchange.com
 http://www.experts-exchange.com/M_4830110.html
 E4AD 7CF1 1396 27F6 79DD  4342 5E92 AD66 8C8C FBA5
 
 --nmemrqcdn5VTmUEE
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: attachment; filename="patch.txt"
 
 Index: Mk/bsd.port.mk
 ===================================================================
 RCS file: /home/jhelfman/ncvs/ports/Mk/bsd.port.mk,v
 retrieving revision 1.692
 diff -u -r1.692 bsd.port.mk
 --- Mk/bsd.port.mk	12 Aug 2011 16:39:23 -0000	1.692
 +++ Mk/bsd.port.mk	22 Aug 2011 21:26:04 -0000
 @@ -1144,6 +1144,7 @@
  # ${FILEDIR}/patch-* files from them.
  
  .if !target(makepatch)
 +post-patch-script::
  makepatch:
  	@${MKDIR} ${FILESDIR}
  	@(cd ${PATCH_WRKSRC}; \
 @@ -3655,6 +3656,11 @@
  		fi; \
  	fi
  .endif
 +.if !target(post-patch-script)
 +post-patch-script:
 +	@${ECHO_MSG} "===> Removing patched remnants for ${PKGNAME}"
 +	@${FIND} ${WRKSRC} -type f \( -name '*.orig' \) -delete
 +.endif
  
  .if !target(configure-autotools)
  configure-autotools:
 
 --nmemrqcdn5VTmUEE--

From: Chris Rees <chris@bayofrum.net>
To: bug-followup@FreeBSD.org, jhelfman@experts-exchange.com
Cc:  
Subject: Re: ports/160010: [patch] Mk/bsd.port.mk: cleanup orig files in post-patch-script
 target
Date: Tue, 23 Aug 2011 10:50:58 +0100

 This is unnecessary with the majority of ports and also runs a find over 
 the whole WRKSRC whenever patchfiles are used -- at least make it an 
 optional part with a variable such as PATCH_CLEAN_ORIG=yes.
 
 Chris
 
 -- 
 This message has been scanned for viruses and
 dangerous content by MailScanner, and is
 believed to be clean.
 

From: Jason Helfman <jhelfman@e-e.com>
To: Chris Rees <chris@bayofrum.net>
Cc: bug-followup@FreeBSD.org
Subject: Re: ports/160010: [patch] Mk/bsd.port.mk: cleanup orig files in
 post-patch-script target
Date: Tue, 23 Aug 2011 09:24:49 -0700

 --mJm6k4Vb/yFcL9ZU
 Content-Type: text/plain; charset=us-ascii; format=flowed
 Content-Disposition: inline
 
 On Tue, Aug 23, 2011 at 10:50:58AM +0100, Chris Rees thus spake:
 >This is unnecessary with the majority of ports and also runs a find over
 >the whole WRKSRC whenever patchfiles are used -- at least make it an
 >optional part with a variable such as PATCH_CLEAN_ORIG=yes.
 >
 >Chris
 >
 
 Great point. Here is the updated patch. I needed to remove it from makepatch
 conditional, as target was being overwritten, however functionality is
 still there and doesn't clobber .orig files for makepatch process.
 
 At the moment, over 200 ports use this type of function for removing files.
 
 -jgh
 -- 
 Jason Helfman
 System Administrator
 experts-exchange.com
 http://www.experts-exchange.com/M_4830110.html
 E4AD 7CF1 1396 27F6 79DD  4342 5E92 AD66 8C8C FBA5
 
 --mJm6k4Vb/yFcL9ZU
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: attachment; filename="patch.txt"
 
 Index: Mk/bsd.port.mk
 ===================================================================
 RCS file: /home/jhelfman/ncvs/ports/Mk/bsd.port.mk,v
 retrieving revision 1.692
 diff -u -r1.692 bsd.port.mk
 --- Mk/bsd.port.mk	12 Aug 2011 16:39:23 -0000	1.692
 +++ Mk/bsd.port.mk	23 Aug 2011 16:20:26 -0000
 @@ -3655,6 +3655,13 @@
  		fi; \
  	fi
  .endif
 +.if defined(PATCH_CLEAN_ORIG)
 +.if !target(post-patch-script)
 +post-patch-script:
 +	@${ECHO_MSG} "===>  Removing patched remnants for ${PKGNAME}"
 +	@${FIND} ${WRKSRC} -type f \( -name '*.orig' \) -delete
 +.endif
 +.endif
  
  .if !target(configure-autotools)
  configure-autotools:
 
 --mJm6k4Vb/yFcL9ZU--
>Unformatted:
