[packages/rpm-pld-macros] Avoid subshell call in _tmppath macro by using lua.
arekm
arekm at pld-linux.org
Tue Jul 1 19:25:28 CEST 2025
commit b3f864e29f706bc48eb6e3f761279ff5f4976a97
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date: Tue Jul 1 19:24:09 2025 +0200
Avoid subshell call in _tmppath macro by using lua.
Should fix:
Updating / installing...
setup-2.10.2-3 ########################################
error: Failed to open shell expansion pipe for command: echo "${TMPDIR:-/var/tmp}": No such file or directory
1< (%)
0< (%_tmppath)
error: Failed to open shell expansion pipe for command: echo "${TMPDIR:-/var/tmp}": No such file or directory
1< (%)
0< (%_tmppath)
/
error: error creating temporary file /: Invalid argument
error: Couldn't create temporary file for %post(setup-2.10.2-3.x86_64): Invalid argument
macros.pld | 9 ++++++++-
rpm-pld-macros.spec | 4 ++--
2 files changed, 10 insertions(+), 3 deletions(-)
---
diff --git a/rpm-pld-macros.spec b/rpm-pld-macros.spec
index 804c5db..ea35915 100644
--- a/rpm-pld-macros.spec
+++ b/rpm-pld-macros.spec
@@ -1,4 +1,4 @@
-%define rpm_macros_rev 2.048
+%define rpm_macros_rev 2.049
%define find_lang_rev 1.42
# split into individual X_prov_ver if there is a reason to desync
%define prov_ver 4.15
@@ -6,7 +6,7 @@ Summary: PLD Linux RPM macros
Summary(pl.UTF-8): Makra RPM dla Linuksa PLD
Name: rpm-pld-macros
Version: %{rpm_macros_rev}
-Release: 2
+Release: 1
License: GPL v2+
Group: Development/Building
Source0: macros.pld
diff --git a/macros.pld b/macros.pld
index 75bf473..8190bc1 100644
--- a/macros.pld
+++ b/macros.pld
@@ -279,7 +279,14 @@ pakietu oraz przy odpluskwianiu samego pakietu.\
fi; \
)}%_topdir
-%_tmppath %(echo "${TMPDIR:-/var/tmp}")
+%_tmppath %{lua:
+local tmpdir = os.getenv("TMPDIR")
+if not tmpdir or tmpdir == "" then
+ tmpdir = "/var/tmp"
+end
+print(tmpdir)
+}
+
%tmpdir %{_tmppath}
# Left for compatibility with rpm < 4.20
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/rpm-pld-macros.git/commitdiff/b3f864e29f706bc48eb6e3f761279ff5f4976a97
More information about the pld-cvs-commit
mailing list