* Carlos O'Donell:
# All of the bin and certain sbin files go into the common package
except
-# glibc_post_upgrade.* and iconvconfig which need to go in glibc. Likewise
-# nscd is excluded because it goes in nscd.
+# iconvconfig which needs to go in glibc. Likewise nscd is excluded because
+# it goes in nscd.
Maybe add “because it is used in post scriptlet below”?
+-- We use lua's posix.exec because there may be no shell that we
can
+-- run during glibc upgrade.
+function post_exec (program, ...)
+ local pid = posix.fork ()
+ if pid == 0 then
+ assert (posix.exec (program, ...))
+ elseif pid > 0 then
+ posix.wait (pid)
+ end
+end
Hehe. GNU-style Lua.
+-- (1) Remove multilib libraries from previous installs.
+-- In order to support in-place upgrades, we must immediately remove
+-- obsolete platform directories after installing a new glibc
+-- version. RPM only deletes files removed by updates near the end
+-- of the transaction. If we did not remove the obsolete platform
+-- directories here, they may be preferred by the dynamic linker
+-- during the execution of subsequent RPM scriptlets, likely
+-- resulting in process startup failures.
+
+-- We are going to remove these libraries. Generally speaking we remove
+-- all core libraries in the multilib directory.
+-- We employ a tight match on libc-X.Y.so where X > 2 and Y > 2?, and
+-- related libraries so we would match "libc-2.20.so" and higher.
+remove_regexps = { "libc%%-[2-9][0-9]*%%.[2-9][0-9]+%%.so",
+ "libm%%-[2-9][0-9]*%%.[2-9][0-9]+%%.so",
+ "librt%%-[2-9][0-9]*%%.[2-9][0-9]+%%.so",
+ "libpthread%%-[2-9][0-9]*%%.[2-9][0-9]+%%.so",
+ "librtkaio%%-[2-9][0-9]*%%.[2-9][0-9]+%%.so",
+ "libthread_db%%-[1-9][0-9]*%%.[0-9]+%%.so" }
Untested:
local remove_regexps = {"c", "m", "rt", "pthread",
"rtkaio", "thread_db",
"nss_compat", "nss_db", "nss_dns",
"nss_hesiod",
"nss_files", "nss_nis"}
for i = 1, #remove_regexps do
remove_regexps[i] = ("lib" .. remove_regexps[i]
.. "%%-[2-9][0-9]*%%.[0-9]+%%.so$")
done
remove_regexps[#remove_regexps + 1] = "libthread_db%%-1%%.0%%.so"
Note: No [2-9] group in the second version component, as that is not
future-proof. And added $ at the end. And list the irregular
libthread_db name separately.
+ if string.match (line, "^include
ld.so.conf.d/%*%.conf$") ~= nil then
Should this use %%*%%?
Rest looks okay to me.
Thanks,
Florian