From owner-svn-src-head@freebsd.org Mon Jul 23 16:48:17 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 2F0B8104FBD0; Mon, 23 Jul 2018 16:48:17 +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 BFFD4843A9; Mon, 23 Jul 2018 16:48:16 +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 E4DF733F; Mon, 23 Jul 2018 12:48:14 -0400 (EDT) Received: from web6 ([10.202.2.216]) by compute5.internal (MEProxy); Mon, 23 Jul 2018 12:48:15 -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=6HiQgz on0sCOr25TFDN9N5br0RNs+IzZuqR9XKyx8wY=; b=hv1NDFLkQDI1a6hWRQV18N pQbV/U1QtgbkjdLjOEC4wJ5YWefuDr4xxVeuhjA7dZ6+E7ddHMSZUhyjxVP1GMxs w3y5Tr34VwGmJiXHaC3Oh8VFq3KMCvcYd41lhwZ8+7DE6MNdw/TD09E8cqsl0Pvm jxaBuNWwmLKyZmvlYFstffIyfCr41kTK8ssvR4vZBzp6npbGchCz8LDFP3xvhabQ jzXyg5KvxfplCcIPzDGU1gWcqoAi5fbqdUcNlaBBjm7hgBFXTuEcKUhKQl8YMxmQ 4zw8UaUpJjiMPxZu8Nfy9/aKXThX9pw84nE8dyRQj6k3oyg6DhfG696b8M4+MKvA == X-ME-Proxy: X-ME-Sender: Received: by mailuser.nyi.internal (Postfix, from userid 99) id 21E48412A; Mon, 23 Jul 2018 12:48:14 -0400 (EDT) Message-Id: <1532364494.2401755.1450115552.31CB163C@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 In-Reply-To: <1532362918.1344.145.camel@freebsd.org> References: <201807231611.w6NGB3gh074167@repo.freebsd.org> <1532362918.1344.145.camel@freebsd.org> Date: Mon, 23 Jul 2018 10:48:14 -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 16:48:17 -0000 On Mon, Jul 23, 2018, at 10:21 AM, Ian Lepore wrote: > On Mon, 2018-07-23 at 16:11 +0000, Brad Davis wrote: > > 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 wit= h 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/D16405 > >=20 > > Added: > > =C2=A0 head/share/mk/bsd.dirs.mk=C2=A0=C2=A0=C2=A0(contents, props chan= ged) > > 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 (r336639) > > +++ head/share/mk/bsd.README Mon Jul 23 16:11:03 2018 (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 t= arget > > =C2=A0bsd.files.mk - install of general purpose files > > @@ -291,6 +292,18 @@ CFLAGS Flags to the compiler when creating C obje= cts. > > =C2=A0CLEANDIRS Additional files (CLEANFILES) and directories (CLEANDIR= S) 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 exa= mple: > > + > > + 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=A0Usuall= y used for > > =C2=A0 libraries.=C2=A0=C2=A0For example, to depend on the compatibili= ty 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 (r336640) > > @@ -0,0 +1,42 @@ > > +# $FreeBSD$ > > +# > > +# Directory permissions management. > > + > > +.if !target(____) > > +____: > > +# List of directory variable names to install.=C2=A0=C2=A0Each variabl= e name's value > > +# must be a full path.=C2=A0=C2=A0If non-default permissions are desir= ed, _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) && !empt= y(${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}TAG= S) || ! ${${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 >=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 C= REATEDIRS, or anything else we might choose as well. Do you have an exampl= e of someone using DIRS already? So I am kind of doubtful that changing this to something else would avoid t= he problem entirely.. Regards, Brad Davis