From owner-freebsd-ports Mon Jun 26 5:52: 1 2000 Delivered-To: freebsd-ports@freebsd.org Received: from guru.mired.org (zoom1-048.telepath.com [216.14.1.48]) by hub.freebsd.org (Postfix) with SMTP id E689637B54C for ; Mon, 26 Jun 2000 05:51:56 -0700 (PDT) (envelope-from mwm@mired.org) Received: (qmail 51010 invoked by uid 100); 26 Jun 2000 12:45:11 -0000 From: Mike Meyer MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <14679.20567.876221.287993@guru.mired.org> Date: Mon, 26 Jun 2000 07:45:11 -0500 (CDT) To: freebsd-ports@freebsd.org Subject: localtest target for bsd.ports.mk X-Mailer: VM 6.72 under 21.1 (patch 10) "Capitol Reef" XEmacs Lucid X-face: "5Mnwy%?j>IIV\)A=):rjWL~NB2aH[}Yq8Z=u~vJ`"(,&SiLvbbz2W`;h9L,Yg`+vb1>RG% *h+%X^n0EZd>TM8_IB;a8F?(Fb"lw'IgCoyM.[Lg#r\ Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org I'd like to be able to easily verify that a port didn't install any files in /usr/local that it shouldn't have. The attached patch to bsd.port.mk adds a "localtest" target that is a first pass at this. Right now, it assumes that the port has been installed. This isn't good, but having it depend on any of the cookies means that ports that have been installed and cleaned will be built just to perform this test. So instead, it just warns you if it doesn't have the PLIST (because the port builds one); otherwise it lists files from the PLIST that are in /usr/local. Using "pkg_info -L" might make more sense, but I hate to depend on the output format of pkg_info. I'd be interested in hearing about other ways of getting a list of files to check for. The extension of this to x11test (for dependencies on X11BASE) is obvious, and a "basetest" that does them both might be useful. I've also left the patches to bsd.port.subdir.mk to someone else. Thanx, ' style prompts - override this to turn them off. ECHO_MSG?= ${ECHO} @@ -1924,6 +1926,16 @@ .if !target(package) package: ${PACKAGE_COOKIE} +.endif + +.if !target(localtest) +localtest: +.if !exists(${PLIST}) + @${ECHO} "The port must be built before this test can be performed." +.else + @${ECHO} "Any files listed may have been installed in /usr/local in error." + @-cat ${PKGDIR}/PLIST | ${SED} s:^:/usr/local/: | ${XARGS} ${LS} 2>/dev/null +.endif .endif ${EXTRACT_COOKIE}: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message