Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 27 Oct 1996 01:47:34 -0800 (PST)
From:      "David E. O'Brien" <obrien@NUXI.cs.ucdavis.edu>
To:        FreeBSD-gnats-submit@freebsd.org
Cc:        obrien@Nuxi.com
Subject:   ports/1902: additional clean targets for bsd.port.mk
Message-ID:  <199610270947.BAA26265@relay.nuxi.com>
Resent-Message-ID: <199610270950.BAA17033@freefall.freebsd.org>

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

>Number:         1902
>Category:       ports
>Synopsis:       additional clean targets for bsd.port.mk
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports
>State:          open
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sun Oct 27 01:50:02 PST 1996
>Last-Modified:
>Originator:     David E. O'Brien
>Organization:
University of California, Davis
>Release:        FreeBSD 2.1.5-RELEASE i386
>Environment:

	based on bsd.port.mk from -current

>Description:

	I would like to see additional clean targets added to bsd.port.mk.

	The first is "distclean" that would delete the DISTFILES and
	PATCHFILES, and would rmdir the dist subdir if there is one.
	This target is useful to recover some of the diskspace taken up by
	the distfile(s).  It is even more useful when there is >1 distfile
	or patch files.
	The second target is "deepclean" that inaddition to "distclean"
	deletes the portball.  This is useful as many times I build a port
	because the package either isn't avail, or doesn't match my system.
	After I've installed the port, I have no desire to keep the portball
	around.  The only negitive port to this target, is after building
	this target, you are left in a cwd that doesn't exist anymore.
	But a simple ``cd'' to the next place you wanted to go anyway will
	take care of that.

>How-To-Repeat:

	n/a

>Fix:
	

--- bsd.port.mk.orig	Fri Oct 25 01:58:13 1996
+++ bsd.port.mk	Sun Oct 27 01:34:55 1996
@@ -989,6 +989,34 @@
 .endif
 .endif
 
+.if !target(pre-distclean)
+pre-distclean:
+	@${DO_NADA}
+.endif
+
+.if !target(distclean)
+distclean: pre-distclean clean
+	@${ECHO_MSG} "===>  Dist cleaning for ${PKGNAME}"
+	@(cd ${DISTDIR}; \
+	${RM} -f ${DISTFILES} ${PATCHFILES})
+.if defined(DIST_SUBDIR)
+	@/bin/rmdir ${DISTDIR}	
+.endif
+.endif
+
+.if !target(pre-deepclean)
+pre-deepclean:
+	@${DO_NADA}
+.endif
+
+.if !target(deepclean)
+PORTDIRNAME!= /usr/bin/basename ${.CURDIR}
+realclean: pre-deepclean distclean
+	@${ECHO_MSG} "===>  Deep cleansing for ${PKGNAME}"
+	@(cd ${.CURDIR}/.. ; \
+	${RM} -rf ${PORTDIRNAME})
+.endif
+
 # Prints out a list of files to fetch (useful to do a batch fetch)
 
 .if !target(fetch-list)
>Audit-Trail:
>Unformatted:



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