[packages/xkeyboard-config] Rel 2. %pretrans in lua, dropped the xkbdata migration
arekm
arekm at pld-linux.org
Tue Oct 13 00:58:24 CEST 2026
commit 5dd1554b348bc641ac8a40339c5fe973b4dd843a
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date: Tue Oct 13 00:54:58 2026 +0200
Rel 2. %pretrans in lua, dropped the xkbdata migration
A sh %pretrans needs /bin/sh in the rpmdb already, so installing into
an empty root failed.
xkeyboard-config.spec | 34 ++++++++++++++++++++--------------
1 file changed, 20 insertions(+), 14 deletions(-)
---
diff --git a/xkeyboard-config.spec b/xkeyboard-config.spec
index 32a7567..70b507e 100644
--- a/xkeyboard-config.spec
+++ b/xkeyboard-config.spec
@@ -2,7 +2,7 @@ Summary: X Keyboard Configuration Database
Summary(pl.UTF-8): Baza danych konfiguracji klawiatury pod X
Name: xkeyboard-config
Version: 2.47
-Release: 1
+Release: 2
License: MIT
Group: X11/Development/Libraries
Source0: https://xorg.freedesktop.org/releases/individual/data/xkeyboard-config/%{name}-%{version}.tar.xz
@@ -66,19 +66,25 @@ ln -s /var/lib/xkb $RPM_BUILD_ROOT%{_datadir}/xkeyboard-config-2/compiled
%clean
rm -rf $RPM_BUILD_ROOT
-%pretrans
-# it used to be directory in xkbdata, not it's a file
-if [ -d %{_datadir}/X11/xkb/symbols/pc ]; then
- rm -rf %{_datadir}/X11/xkb/symbols/pc
-fi
-# it's a symlink now
-if [ -d %{_datadir}/X11/xkb/compiled ]; then
- rm -rf %{_datadir}/X11/xkb/compiled
-fi
-# it's a symlink now
-if [ -d %{_datadir}/X11/xkb ]; then
- rm -rf %{_datadir}/X11/xkb
-fi
+%pretrans -p <lua>
+-- %{_datadir}/X11/xkb used to be a directory, it's a symlink now
+local function rmtree(path)
+ local st = posix.stat(path)
+ if st and st.type == "directory" then
+ for _, name in ipairs(posix.dir(path)) do
+ if name ~= "." and name ~= ".." then
+ rmtree(path .. "/" .. name)
+ end
+ end
+ posix.rmdir(path)
+ elseif st then
+ os.remove(path)
+ end
+end
+local st = posix.stat("%{_datadir}/X11/xkb")
+if st and st.type == "directory" then
+ rmtree("%{_datadir}/X11/xkb")
+end
%files -f %{name}.lang
%defattr(644,root,root,755)
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/xkeyboard-config.git/commitdiff/5dd1554b348bc641ac8a40339c5fe973b4dd843a
More information about the pld-cvs-commit
mailing list