On 5/31/19 12:49 PM, Florian Weimer wrote:
* 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”?
Fixed.
> +-- (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"}
This is in controlled by install_different() in glibc.spec, in that
we only install 5 variant libraries, but the removal set must be the superset
of all possible previously deployed libraries, and so should be the full set
of libraries. I've expanded this to more than the above.
Fixed.
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"
Fixed.
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.
Good idea.
Fixed.
> + if string.match (line, "^include
ld.so.conf.d/%*%.conf$") ~= nil then
Should this use %%*%%?
Ha! Yes, works because the degenerate regexp is still valid.
Fixed.
Rest looks okay to me.
v3
- Added comment about why iconvconfig is in glibc rpm.
- Added multilib removal coverage for all installed libs.
- Includes support for irregular named libs.
- Includes support for tighter regexp which is still future proof.
- Fixed ld.so.conf string match.
Retested removal of all libs in a multilib upgrade (simulated with fake files).
Retested locally for multilib upgrades.
Retested locally for ld.so.conf edits.
Retested locally for gconv-modules.cache update.
Retested locally to verify no installed files changed locations.
OK for rawhide?
--
Cheers,
Carlos.