From owner-freebsd-ports@FreeBSD.ORG Thu Mar 29 11:44:59 2012 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 07BE1106564A; Thu, 29 Mar 2012 11:44:59 +0000 (UTC) (envelope-from rflynn@acsalaska.net) Received: from mailhub.rachie.is-a-geek.net (rachie.is-a-geek.net [66.230.99.27]) by mx1.freebsd.org (Postfix) with ESMTP id BD7478FC14; Thu, 29 Mar 2012 11:44:58 +0000 (UTC) Received: from [127.0.0.1] (squeeze.lan.rachie.is-a-geek.net [192.168.2.30]) by mailhub.rachie.is-a-geek.net (Postfix) with ESMTP id 07F5A7E821; Thu, 29 Mar 2012 03:44:56 -0800 (AKDT) Message-ID: <4F744B21.2020401@acsalaska.net> Date: Thu, 29 Mar 2012 13:44:33 +0200 From: Mel Flynn User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:11.0) Gecko/20120327 Thunderbird/11.0.1 MIME-Version: 1.0 To: Matthew Seaman , Ports FreeBSD References: <4F6CE755.8020502@FreeBSD.org> <4F6D07C0.5040602@freebsd.org> <4F6D0BF9.2090700@acsalaska.net> <4F6D99F7.2010103@FreeBSD.org> <4F6E676A.70409@acsalaska.net> <4F6EE163.3000804@FreeBSD.org> <4F6F20B7.1060801@acsalaska.net> <4F6F424A.4040608@FreeBSD.org> <4F737CF1.3030008@acsalaska.net> <4F742150.9040207@FreeBSD.org> In-Reply-To: <4F742150.9040207@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Subject: PORTWWW proposal (Was: Re: How useful is %%DATADIR%%, anyway?) X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Mar 2012 11:44:59 -0000 Hi all, so we took this off list for a bit to work out an implementation. On 3/29/2012 10:46, Matthew Seaman wrote: > On 28/03/2012 22:04, Mel Flynn wrote: >> I'm not sure about exclusion. I have an implementation up here: >> http://redports.org/browser/melflynn/net-mgmt/observium/bsd.www.mk >> >> The problem with -not -path $glob is that it isn't the inverse of inclusion: >> PORTWWW= html >> will only find the dir html and everything below it. >> PORTWWWEXCLUDE= html >> will only exclude the html dir but not everything below it. The correct >> way to write this would be: >> PORTWWWEXCLUDE= html html/* >> >> I also can't see a way to do this, since: >> html/* - won't match the file named html and we can't test for -d/-f >> html* - will also match the paths html.php and htmladmin which may be >> undesired. >> >> I suppose one can document it to not abuse the exclusion for directories >> but strictly for files. > > Hmmm... yes. The '-not -path "/foo/bar"' construction (not using > wildcards) really only works with files. To stop find(1) recursing into > a whole directory subtree by naming the top of that subtree you'ld use > -prune. With wildcards, yes, it is different, . Since -prune is always true, it's a whole different beast that requires wrapping any other arguments into -o \( ... -print \). It won't work well here. > There is some precedence for using separate variables for files vs > directories: see PLIST_DIRS, PLIST_DIRSTRY and PLIST_FILES. If we separate exclusion into files and dirs, things get a lot easier, as we can simply use -not -path '${WWWDIR}/${glob}' -not -path '${WWWDIR}/${glob}/*' for a directory. The only question is whether to use PORTWWWEXCLUDE_FILES explicitly or have PORTWWWEXCLUDE be the files one. > There's also the @dirrm vs @dirrmtry question. Yes, I thought about that. I think it can be done with some post-processing, rewriting @dirrm foo to @dirrmtry foo for dirs matching PORTWWW_DIRSTRY. > Anyhow, would you consider publishing your work on freebsd-ports@... so > more interested parties can comment on it? I think it has promise and > I'll have a go trying to apply it to some of my ports over the next week > or so. If it can work correctly with www/rt40 then it should work for > anything. I'll have these changes incorporated later tonight. While there's now a lot of variables to consider, it's hard to loose sight of the fact that the common case will only use PORTWWW=* + the exclusion of one or two configuration files. -- Mel