On 5/17/19 5:56 PM, DJ Delorie wrote:
> grep '%{_prefix}/bin' master.filelist >>
common.filelist
> -grep '%{_prefix}/sbin/[^gi]' master.filelist \
> +grep '%{_prefix}/sbin/iconvconfig' master.filelist \
> | grep -v 'nscd' >> common.filelist
The old source EXCLUDES iconvconfig, the new source REQUIRES it. Use
[^i] instead.
Fixed. Using grep -v and iconvconfig, since that's more explicit.
> -
Er, OK. Or spurious whitespace changes. Your choice :-)
Fixed. Removed spurious change.
> -%post -p %{_prefix}/sbin/glibc_post_upgrade.%{_target_cpu}
> +%post -p <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 would be preferred by the dynamic linker
"may be"
> +-- during the execution of subsequent RPM scriptlets, likely
> +-- resulting in process startup failures. */
Ok.
Fixed. Removed trailing C comment close.
> +-- We are going to remove these libraries. Generally speaking we
remove
> +-- all core libraries in the multilib directory.
> +local remove_prefixes = { "libc-",
> + "libm-",
> + "librt-",
> + "libpthread-",
> + "librtkaio-",
> + "libthread_db-" }
> +
> +-- We are going to search these directories.
> +local remove_dirs = { "/lib/i686",
> + "/lib/i686/nosegneg",
> + "/lib64/power6",
> + "/lib64/power7",
> + "/lib64/power8" }
> +
> +-- Walk all the directories with files we need to remove...
> +for _, rdir in ipairs (remove_dirs) do
> + if posix.access (rdir) then
We're not accounting for $prefix but the original didn't either. So
this is a "if exists" check. Ok.
We should.
Fixed. Uses %{_libdir}.
> +-- (3) Rebuild ld.so.cache early.
> +-- If the format of the cache changes then we need to rebuild
> +-- the cache early to avoid any problems running binaries with
> +-- the new glibc.
> +
> +if posix.access ("%{_prefix}/sbin/ldconfig", "x") then
Inconsistent use of ${prefix} ? The old script used /sbin/ldconfig, and
we're checking /etc not ${prefix}/etc, etc. If this is intentional,
needs explaining in the comment.
Yes, in Fedora we install into %{_prefix} and so the use is intentional,
on your system you'll see /sbin is a symlink to /usr/sbin, and this is
part of the MoveToUsr transition (which glibc never fully completed).
The old script did use /sbin/ldconfig and it was correct, but may not be
correct at some point in the future.
The new lua script uses %{_prefix} and so is more correct (though not
quite perfect with sysroots, but I'll fix that later).
Lastly, we don't apply %{_prefix} to /etc installed files, this is
controlled by sysconfdir.
Fixed. Comment added.
> + local pid = posix.fork ()
> + if pid == 0 then
> + posix.exec ("%{_prefix}/sbin/ldconfig")
> + elseif pid > 0 then
> + posix.wait (pid)
> + end
No error handling.
Fixed. Using assert.
> +-- (4) Update gconv modules cache.
> +-- If the /usr/lib/gconv/gconv-modules.cache exists, then update it
> +-- with the latest set of modules that were just installed.
> +-- We assume that the cache is in %{_libdir}/gconv and called
> +-- "gconv-modules.cache".
> +
> +local iconv_dir = "%{_libdir}/gconv"
> +local iconv_cache = iconv_dir .. "/gconv-modules.cache"
Ok.
> +if posix.utime (iconv_cache) == 0 then
> + local pid = posix.fork ()
> + if pid == 0 then
> + posix.exec ("%{_prefix}/sbin/iconvconfig",
> + "-o", iconv_cache,
> + "--nostdlib",
> + iconv_dir)
> + elseif pid > 0 then
> + posix.wait (pid)
> + end
Again, no error handling.
Fixed. Using assert.
> +else
> + io.stdout:write ("Error: Missing " .. iconv_cache .. "
file.\n")
> +end
Ok.
> +* Thu May 16 2019 Carlos O'Donell <carlos(a)redhat.com> - 2.29.9000-20
Remember to tweak the timestamp as you go ;-)
Fixed.
--
Cheers,
Carlos.