From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1477284-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits))
	(No client certificate requested)
	by finch.gentoo.org (Postfix) with ESMTPS id 7F2FD15800F
	for <garchives@archives.gentoo.org>; Sat, 14 Jan 2023 16:45:42 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id C646EE0718;
	Sat, 14 Jan 2023 16:45:41 +0000 (UTC)
Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id A7739E0718
	for <gentoo-commits@lists.gentoo.org>; Sat, 14 Jan 2023 16:45:41 +0000 (UTC)
Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id D3D60335C38
	for <gentoo-commits@lists.gentoo.org>; Sat, 14 Jan 2023 16:45:40 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id 737D2836
	for <gentoo-commits@lists.gentoo.org>; Sat, 14 Jan 2023 16:45:39 +0000 (UTC)
From: "Ulrich Müller" <ulm@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Ulrich Müller" <ulm@gentoo.org>
Message-ID: <1673597094.12f1e30e82a0ecedd91e77edfbb519366edb17b0.ulm@gentoo>
Subject: [gentoo-commits] proj/policy-guide:master commit in: /
X-VCS-Repository: proj/policy-guide
X-VCS-Files: ebuild-format.rst
X-VCS-Directories: /
X-VCS-Committer: ulm
X-VCS-Committer-Name: Ulrich Müller
X-VCS-Revision: 12f1e30e82a0ecedd91e77edfbb519366edb17b0
X-VCS-Branch: master
Date: Sat, 14 Jan 2023 16:45:39 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
X-Archives-Salt: 9131c422-7688-481d-ac4f-9b807f938417
X-Archives-Hash: fdf13ab4a2d936e8bda7620bd76305ea

commit:     12f1e30e82a0ecedd91e77edfbb519366edb17b0
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Fri Jan 13 07:49:00 2023 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Fri Jan 13 08:04:54 2023 +0000
URL:        https://gitweb.gentoo.org/proj/policy-guide.git/commit/?id=12f1e30e

ebuild-format: Restrict D to src_install and pkg_preinst

This used to be specified in PMS (see commit ede65b5 in proj/pms.git),
but makes more sense as a tree policy.

Also exclude pkg_postinst, because nothing in the Gentoo repository
appears to use D there, and in the postinst phase the directory will
be empty of files anyway.

Bug: https://bugs.gentoo.org/890624
Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>

 ebuild-format.rst | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/ebuild-format.rst b/ebuild-format.rst
index 041c088..a381e07 100644
--- a/ebuild-format.rst
+++ b/ebuild-format.rst
@@ -126,3 +126,21 @@ allowed.
 *Rationale*: since license names do not contain dynamic parts (such as
 package versions), using variables there has little advantage.  On the
 other hand, variables reduce the usefulness of plain tools such as grep.
+
+
+.. index:: d; variable
+
+D must be used only in src_install and pkg_preinst
+--------------------------------------------------
+:PG: 0107
+:Source: QA
+:Reported: no
+
+The ``D`` and ``ED`` variables must be used only in the ``src_install``
+and ``pkg_preinst`` phase functions.  Exceptions to this policy can be
+granted by the QA team.
+
+*Rationale*: using ``D`` in other phases (e.g. ``src_configure``) is
+error-prone and may lead to the path being embedded in files of the
+installed image.  In addition, the directory pointed to by ``${D}``
+does not exist in other phases.