greadme.eclass: drop "file exists" check on append

In hindsight, this check is too restrictive. The check makes it
impossible to have a completely optional README.gentoo created. For
example, a README.gentoo where all the content is conditional on USE
flags.

To address this, we drop the "file exists" check on append. The rest of
the eclass already correctly handles cases where README.gentoo might not
exist.

Signed-off-by: Florian Schmaus <flow@gentoo.org>
This commit is contained in:
Florian Schmaus 2025-07-26 13:25:25 +02:00
parent e8950facb4
commit 50d9713fb4
No known key found for this signature in database
GPG Key ID: 2239A7E8F5852052

View File

@ -1,4 +1,4 @@
# Copyright 1999-2024 Gentoo Authors
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: greadme.eclass
@ -80,10 +80,6 @@ greadme_stdin() {
[[ $# -eq 0 ]] || die "${FUNCNAME[0]}: Bad parameters: $*"
if [[ -n ${append} ]]; then
if [[ ! -f ${_GREADME_TMP_FILE} ]]; then
die "Gentoo README does not exist when trying to append to it"
fi
cat >> "${_GREADME_TMP_FILE}" || die
else
cat > "${_GREADME_TMP_FILE}" || die