From owner-svn-src-head@freebsd.org Mon Jul 23 18:20:38 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 524401051C25; Mon, 23 Jul 2018 18:20:38 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DD2B488BD7; Mon, 23 Jul 2018 18:20:37 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 14B2042C; Mon, 23 Jul 2018 14:20:36 -0400 (EDT) Received: from web6 ([10.202.2.216]) by compute5.internal (MEProxy); Mon, 23 Jul 2018 14:20:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=BfNcJT 1BTNZjSZ0bhniYpPiogiiYx9rmHYhhjXX0meo=; b=gsy6aA8GemAlfVv5QI+dI/ c3A456Aq2WunvjVCvuhSV8xodNUijfHgEI8MwK91Knmo37UMnkxFS4rVNIOJkKb5 kg9kDIW6MmIoQqmWewc0PosgTQXY5O1puTCGNN72Q9GU7AHee1YjLJExmAiZQ30S ynscQ5P9r5Je151nCu2BvMs9wqZj4AOB9IWrjuy+hbI9bFVVf2FEyyILu8+oNCXJ 51Q1CBZ7dT6g/heqCk4YFkcayi24UySLlPLutwIfdIw1CHiJuvC3x/+/Fu2ZNI9j xDzshA58mAvNyYmbzoZqeVS5kK2shcIJ+nAUmIj+3cPJJJuoeyWLUNL3p6Xy0ovQ == X-ME-Proxy: X-ME-Sender: Received: by mailuser.nyi.internal (Postfix, from userid 99) id 5486A412A; Mon, 23 Jul 2018 14:20:35 -0400 (EDT) Message-Id: <1532370035.3251993.1450222760.4825785F@webmail.messagingengine.com> From: Brad Davis To: Ian Lepore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" X-Mailer: MessagingEngine.com Webmail Interface - ajax-0843ff3e References: <201807231611.w6NGB3gh074167@repo.freebsd.org> <1532362918.1344.145.camel@freebsd.org> <1532364494.2401755.1450115552.31CB163C@webmail.messagingengine.com> <1532364842.1344.164.camel@freebsd.org> In-Reply-To: <1532364842.1344.164.camel@freebsd.org> Date: Mon, 23 Jul 2018 12:20:35 -0600 Subject: Re: svn commit: r336640 - head/share/mk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jul 2018 18:20:38 -0000 On Mon, Jul 23, 2018, at 10:54 AM, Ian Lepore wrote: > On Mon, 2018-07-23 at 10:48 -0600, Brad Davis wrote: > > On Mon, Jul 23, 2018, at 10:21 AM, Ian Lepore wrote: > > >=20 > > > On Mon, 2018-07-23 at 16:11 +0000, Brad Davis wrote: > > > >=20 > > > > Author: brd > > > > Date: Mon Jul 23 16:11:03 2018 > > > > New Revision: 336640 > > > > URL: https://svnweb.freebsd.org/changeset/base/336640 > > > >=20 > > > > Log: > > > > =C2=A0 Add the initial DIRS infrastructure for creating directories > > > > with the > > > > =C2=A0 necessary owner, group, mode and flags. > > > > =C2=A0=C2=A0 > > > > =C2=A0 Approved by: bapt (mentor) > > > > =C2=A0 Differential Revision: https://reviews.freebsd.org/D1640 > > > > 5 > > > >=20 > > > > Added: > > > > =C2=A0 head/share/mk/bsd.dirs.mk=C2=A0=C2=A0=C2=A0(contents, props = changed) > > > > Modified: > > > > =C2=A0 head/share/mk/bsd.README > > > >=20 > > > > Modified: head/share/mk/bsd.README > > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > > > --- head/share/mk/bsd.README Mon Jul 23 15:36:55 2018=09 > > > > (r336639) > > > > +++ head/share/mk/bsd.README Mon Jul 23 16:11:03 2018=09 > > > > (r336640) > > > > @@ -22,6 +22,7 @@ bsd.confs.mk - install of > > > > configuration files > > > > =C2=A0bsd.cpu.mk - sets CPU/arch-related variables > > > > (included from sys.mk) > > > > =C2=A0bsd.crunchgen.mk - building crunched binaries using > > > > crunchgen(1) > > > > =C2=A0bsd.dep.mk - handle Makefile dependencies > > > > +bsd.dirs.mk - handle directory creation > > > > =C2=A0bsd.doc.mk - building troff system documents > > > > =C2=A0bsd.endian.mk - TARGET_ENDIAN=3D1234(little) or > > > > 4321 (big) for target > > > > =C2=A0bsd.files.mk - install of general purpose files > > > > @@ -291,6 +292,18 @@ CFLAGS Flags to the compiler > > > > when creating C objects. > > > > =C2=A0CLEANDIRS Additional files (CLEANFILES) and directories > > > > (CLEANDIRS) to > > > > =C2=A0CLEANFILES remove during clean and cleandir targets.=C2=A0=C2= =A0"rm > > > > -rf" and > > > > =C2=A0 "rm -f" are used, respectively. > > > > + > > > > +DIRS A list of variables referring to > > > > directories.=C2=A0=C2=A0For example: > > > > + > > > > + DIRS+=3D FOO > > > > + FOO=3D /usr/share/foo > > > > + > > > > + Owner, Group, Mode and Flags are handled by > > > > FOO_OWN, > > > > + FOO_GRP, FOO_MODE and FOO_FLAGS, respectively. > > > > + > > > > + This allows FILESDIR to be set to FOO, and the > > > > directory > > > > + will be created before the files are installed > > > > and the > > > > + dependencies will be set correctly. > > > > =C2=A0 > > > > =C2=A0DPADD Additional dependencies for the > > > > program.=C2=A0=C2=A0Usually used for > > > > =C2=A0 libraries.=C2=A0=C2=A0For example, to depend on the > > > > compatibility and > > > >=20 > > > > Added: head/share/mk/bsd.dirs.mk > > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > > > --- /dev/null 00:00:00 1970 (empty, because file is > > > > newly added) > > > > +++ head/share/mk/bsd.dirs.mk Mon Jul 23 16:11:03 2018=09 > > > > (r336640) > > > > @@ -0,0 +1,42 @@ > > > > +# $FreeBSD$ > > > > +# > > > > +# Directory permissions management. > > > > + > > > > +.if !target(____) > > > > +____: > > > > +# List of directory variable names to install.=C2=A0=C2=A0Each var= iable > > > > name's value > > > > +# must be a full path.=C2=A0=C2=A0If non-default permissions are d= esired, > > > > _MODE, > > > > +# _OWN, and _GRP may be specified. > > > > +DIRS?=3D > > > > + > > > > +.=C2=A0=C2=A0for dir in ${DIRS:O:u} > > > > +.=C2=A0=C2=A0=C2=A0=C2=A0if defined(${dir}) && !empty(${dir}) > > > > +# Set default permissions for a directory > > > > +${dir}_MODE?=3D 0755 > > > > +${dir}_OWN?=3D root > > > > +${dir}_GRP?=3D wheel > > > > +.=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0if defined(${dir}_FLAGS) && != empty(${dir}_FLAGS) > > > > +${dir}_FLAG=3D -f ${${dir}_FLAGS} > > > > +.=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0endif > > > > + > > > > +.=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0if defined(NO_ROOT) > > > > +.=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0if !defined(${dir= }TAGS) || ! ${${dir}TAGS:Mpackage=3D*} > > > > +${dir}TAGS+=3D package=3D${${dir}PACKAGE:Uruntime} > > > > +.=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0endif > > > > +${dir}TAG_ARGS=3D -T ${${dir}TAGS:[*]:S/ /,/g} > > > > +.=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0endif > > > > + > > > > +installdirs: installdirs-${dir} > > > > + > > > > +installdirs-${dir}: ${DESTDIR}${${dir}} > > > > + > > > > +${DESTDIR}${${dir}}: > > > > + @${ECHO} installing DIRS ${dir} > > > > + ${INSTALL} ${${dir}TAG_ARGS} -d -m ${${dir}_MODE} -o > > > > ${${dir}_OWN} \ > > > > + -g ${${dir}_GRP} ${${dir}_FLAG} > > > > ${DESTDIR}${${dir}} > > > > +.=C2=A0=C2=A0=C2=A0=C2=A0endif > > > > + > > > > +realinstall: installdirs-${dir} > > > > +.=C2=A0=C2=A0endfor > > > > + > > > > +.endif > > > >=20 > > > Having a variable named DIRS seems like asking for name clashes > > > with > > > peoples' existing makefiles (people do use the freebsd build > > > infrastructure to build out-of-tree code). Could it be named maybe > > > CREATEDIRS (taking a precedent-clue from CLEANDIRS)? > > I suppose that is possible, but it seems like other people could be > > using CREATEDIRS, or anything else we might choose as well.=C2=A0=C2=A0= Do you > > have an example of someone using DIRS already? > >=20 > > So I am kind of doubtful that changing this to something else would > > avoid the problem entirely.. > >=20 > >=20 > > Regards, > > Brad Davis > >=20 >=20 > The only way to avoid it entirely would be to declare that anything > starting with FREEBSD belongs to us and consistantly use it. That ship > sailed about 30 years ago. >=20 > My theory is that the longer the name is, the less likely it is to > clash. Of course, any name you come up with that's good and sensible > and self-documenting is exactly the kind of name that someone else is > likely to come up with as well. Good point. But unless someone has an active example, I think I'll just le= ave it for now. Regards, Brad Davis