commit: d2967b3ce61fed3a7cc6d36d45371641c0d2eaee
Author: Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Thu May 26 15:03:08 2022 +0000
Commit: Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Mon Jul 18 16:04:08 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d2967b3c
eutils.eclass: Remove emktemp
Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>
eclass/eutils.eclass | 37 +++----------------------------------
1 file changed, 3 insertions(+), 34 deletions(-)
diff --git a/eclass/eutils.eclass b/eclass/eutils.eclass
index e2b3ce0482a9..e7fae2c656c6 100644
--- a/eclass/eutils.eclass
+++ b/eclass/eutils.eclass
@@ -30,41 +30,10 @@ case ${EAPI} in
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
-# @FUNCTION: emktemp
-# @USAGE: [temp dir]
-# @DESCRIPTION:
-# Cheap replacement for when coreutils (and thus mktemp) does not exist
-# on the user's system.
emktemp() {
- eqawarn "emktemp is deprecated. Create a temporary file in \${T}
instead."
-
- local exe="touch"
- [[ $1 == -d ]] && exe="mkdir" && shift
- local topdir=$1
-
- if [[ -z ${topdir} ]] ; then
- [[ -z ${T} ]] \
- && topdir="/tmp" \
- || topdir=${T}
- fi
-
- if ! type -P mktemp > /dev/null ; then
- # system lacks `mktemp` so we have to fake it
- local tmp=/
- while [[ -e ${tmp} ]] ; do
- tmp=${topdir}/tmp.${RANDOM}.${RANDOM}.${RANDOM}
- done
- ${exe} "${tmp}" || ${exe} -p "${tmp}"
- echo "${tmp}"
- else
- # the args here will give slightly wierd names on BSD,
- # but should produce a usable file on all userlands
- if [[ ${exe} == "touch" ]] ; then
- TMPDIR="${topdir}" mktemp -t tmp.XXXXXXXXXX
- else
- TMPDIR="${topdir}" mktemp -dt tmp.XXXXXXXXXX
- fi
- fi
+ eerror "emktemp has been removed."
+ eerror "Create a temporary file in \${T} instead."
+ die "emktemp is banned"
}
path_exists() {