Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 23 Jan 2012 15:13:14 -0500 (EST)
From:      Greg Larkin <glarkin@FreeBSD.org>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/164422: [PATCH] Force removal of OPTIONS file dir to avoid spurious warning in Mk/bsd.port.mk
Message-ID:  <201201232013.q0NKDE7i044920@pm.sourcehosting.net>
Resent-Message-ID: <201201232130.q0NLUCk5062254@freefall.freebsd.org>

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

>Number:         164422
>Category:       ports
>Synopsis:       [PATCH] Force removal of OPTIONS file dir to avoid spurious warning in Mk/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:   Mon Jan 23 21:30:12 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     Greg Larkin
>Release:        FreeBSD 8.2-RELEASE-p3 amd64
>Organization:
The FreeBSD Project
>Environment:
System: FreeBSD pm.sourcehosting.net 8.2-RELEASE-p3 FreeBSD 8.2-RELEASE-p3 #0: Tue Sep 27 18:45:57 UTC 2011 root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC amd64


	
>Description:
After using ports-mgmt/portmaster to install and upgrade ports for a while,
I had a number of options directories in /var/db/ports.  I encountered
some errors stating "rmdir: ...: Directory not empty" when running the
following command:

    cd /usr/ports/devel/git && make rmconfig-recursive

The problem is that portmaster placed a file in the options directory to
detect updated distfiles.  The rmconfig-recursive target assumes that the
options directory is empty once the options file is removed and generates
the warning if it isn't.
>How-To-Repeat:
    cd /usr/ports/ports-mgmt/portmaster && make install clean
    cd /usr/ports/devel/git && portmaster -d .
    make rmconfig-recursive
>Fix:

The attached patch simply forces removal of the options directory as well
as any files within it.

--- bsd.port.mk.optionsdir-full-removal.diff begins here ---
--- bsd.port.mk.orig	2012-01-23 15:04:23.000000000 -0500
+++ bsd.port.mk	2012-01-23 15:04:58.000000000 -0500
@@ -6088,12 +6088,10 @@
 	optionsdir=${OPTIONSFILE}; optionsdir=$${optionsdir%/*}; \
 	if [ ${UID} != 0 -a "x${INSTALL_AS_USER}" = "x" ]; then \
 		${ECHO_MSG} "===> Switching to root credentials to remove ${OPTIONSFILE} and $${optionsdir}"; \
-		${SU_CMD} "${RM} -f ${OPTIONSFILE} ; \
-			${RMDIR} $${optionsdir}"; \
+		${SU_CMD} "${RM} -Rf $${optionsdir}"; \
 		${ECHO_MSG} "===> Returning to user credentials"; \
 	else \
-		${RM} -f ${OPTIONSFILE}; \
-		${RMDIR} $${optionsdir}; \
+		${RM} -Rf $${optionsdir}; \
 	fi
 .else
 	@${ECHO_MSG} "===> No user-specified options configured for ${PKGNAME}"
--- bsd.port.mk.optionsdir-full-removal.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?201201232013.q0NKDE7i044920>