Has been deprecated for quite a while now, comes from eutils.eclass
so it blocks EAPI 8+. Just call mktemp directly.
Signed-off-by: Marek Szuba <marecki@gentoo.org>
---
eclass/gnome2-utils.eclass | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/eclass/gnome2-utils.eclass b/eclass/gnome2-utils.eclass
index f7d45090f82..39c4797eedf 100644
--- a/eclass/gnome2-utils.eclass
+++ b/eclass/gnome2-utils.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: gnome2-utils.eclass
@@ -16,10 +16,9 @@
# * scrollkeeper (old Gnome help system) management
[[ ${EAPI} == 5 ]] && inherit multilib
-# eutils.eclass: emktemp
# toolchain-funs.eclass: tc-is-cross-compiler
# xdg-utils.eclass: xdg_environment_reset, xdg_icon_cache_update
-inherit eutils toolchain-funcs xdg-utils
+inherit toolchain-funcs xdg-utils
case ${EAPI} in
5|6|7) ;;
@@ -379,7 +378,7 @@ gnome2_gdk_pixbuf_update() {
fi
ebegin "Updating gdk-pixbuf loader cache"
- local tmp_file=$(emktemp)
+ local tmp_file=$(mktemp "${T}"/tmp.XXXXXXXXXX) || die "Failed to create temporary file"
${updater} 1> "${tmp_file}" &&
chmod 0644 "${tmp_file}" &&
cp -f "${tmp_file}" "${EROOT%/}/usr/$(get_libdir)/gdk-pixbuf-2.0/2.10.0/loaders.cache" &&
On 2021-12-09 15:04, Michał Górny wrote:
Why do you need to use random name in the first place? We have
full
control over T, so why not just hardcode a good name?
Having discussed the matter with eclass maintainers on IRC, they are
not
entirely sure whether using a static name in this context is entirely
safe. There were also concerns about making this change too
aggressive
given it affects all supported EAPIs. Therefore, we have decided to
play
it safe and stick as closely to old behaviour as possible, at least
for now.
Anyway, merged a moment ago.
Actually I kind of preferred a static name over straight mktemp,
because emktemp supported other cases than a pure mktemp usage does.
But I don't know if it could ever clash things in some weird
situations.
On 13 December 2021 17:24:18 UTC, Mart Raudsepp <leio@gentoo.org> wrote:
Actually I kind of preferred a static name over straight mktemp,
because emktemp supported other cases than a pure mktemp usage does.
But I don't know if it could ever clash things in some weird
situations.
That last part is the message I tried to convey in my e-mail, sorry if I wasn't clear enough.
Anyway, could anyone with more Postage/PMS experience weigh in on this? If it is indeed safe then the eclass could be modified further, e.g. to use static names with EAPI-8+ but stick with mktemp for older EAPIs just to be safe.
On Sun, 2021-12-26 at 09:44 +0000, Marek Szuba wrote:
On 13 December 2021 17:24:18 UTC, Mart Raudsepp <leio@gentoo.org>
wrote:
Actually I kind of preferred a static name over straight mktemp,
because emktemp supported other cases than a pure mktemp usage
does.
But I don't know if it could ever clash things in some weird
situations.
That last part is the message I tried to convey in my e-mail, sorry
if I wasn't clear enough.
Anyway, could anyone with more Postage/PMS experience weigh in on
this? If it is indeed safe then the eclass could be modified
further, e.g. to use static names with EAPI-8+ but stick with
mktemp for older EAPIs just to be safe.
I suppose it's not specified strictly but T should be safe for all
sane
uses. If it weren't, we'd already be in deep trouble and gnome2-
utils
would be the least of our concerns.
That said, making this EAPI-conditional is just an unnecessary
complexity.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 292 |
Nodes: | 16 (2 / 14) |
Uptime: | 201:08:57 |
Calls: | 6,617 |
Calls today: | 1 |
Files: | 12,168 |
Messages: | 5,316,228 |