ports/116219: [patch] Add @rmtry to bsd.port.mk

Edwin Groothuis edwin at mavetju.org
Sun Sep 9 06:40:02 UTC 2007


>Number:         116219
>Category:       ports
>Synopsis:       [patch] Add @rmtry to bsd.port.mk
>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:   Sun Sep 09 06:40:01 GMT 2007
>Closed-Date:
>Last-Modified:
>Originator:     Edwin Groothuis
>Release:        FreeBSD 6.2-RELEASE-p4 i386
>Organization:
-
>Environment:
System: FreeBSD k7.mavetju 6.2-RELEASE-p4 FreeBSD 6.2-RELEASE-p4 #0: Thu Apr 26 17:55:55 UTC 2007 root at i386-builder.daemonology.net:/usr/obj/usr/src/sys/SMP i386


>Description:

To make life easier for porters, add a function similar to @dirrmtry
to delete a file if it is possible.

Based on a quick grep ( grep "@unexec rm" | grep %D )  the follogin
categories have this amount of lines which would be replaced by it:

A	  8
C	 13
D	 41
E	  4
F	 12
G	 51
J	 25
L	 26
M	258
N	 40
P	 83
R	  5
S	 15
T	  5
W	 34
X	 37

That is about 657 occurances.

>How-To-Repeat:
>Fix:

Once this is implemented I will provide documentation and migration.

--- bsd.port.orig	Sat Sep  8 22:32:22 2007
+++ bsd.port.mk	Sun Sep  9 16:24:20 2007
@@ -1569,8 +1570,9 @@
 		DATADIR=${DATADIR} DOCSDIR=${DOCSDIR} EXAMPLESDIR=${EXAMPLESDIR} \
 		WWWDIR=${WWWDIR} ETCDIR=${ETCDIR}
 
-PLIST_REINPLACE+=	dirrmtry stopdaemon
+PLIST_REINPLACE+=	dirrmtry stopdaemon rmtry
 PLIST_REINPLACE_DIRRMTRY=s!^@dirrmtry \(.*\)!@unexec rmdir %D/\1 2>/dev/null || true!
+PLIST_REINPLACE_RMTRY=s!^@rmtry \(.*\)!@unexec rm -f %D/\1 2>/dev/null || true!
 PLIST_REINPLACE_STOPDAEMON=s!^@stopdaemon \(.*\)!@unexec %D/etc/rc.d/\1${RC_SUBR_SUFFIX} forcestop 2>/dev/null || true!
 
 .if defined(WITHOUT_CPU_CFLAGS)
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list