!445 use locale-archive to prevent basic command performance regression
From: @liqingqing_1229 Reviewed-by: @yang_yanchao Signed-off-by: @yang_yanchao
This commit is contained in:
commit
4dbaec4a98
68
glibc.spec
68
glibc.spec
@ -65,7 +65,7 @@
|
|||||||
##############################################################################
|
##############################################################################
|
||||||
Name: glibc
|
Name: glibc
|
||||||
Version: 2.35
|
Version: 2.35
|
||||||
Release: 9
|
Release: 10
|
||||||
Summary: The GNU libc libraries
|
Summary: The GNU libc libraries
|
||||||
License: %{all_license}
|
License: %{all_license}
|
||||||
URL: http://www.gnu.org/software/glibc/
|
URL: http://www.gnu.org/software/glibc/
|
||||||
@ -540,7 +540,15 @@ $olddir/build-%{target}/elf/ld.so \
|
|||||||
# Due to the change of the packing mode, the locale-archive fails to be
|
# Due to the change of the packing mode, the locale-archive fails to be
|
||||||
# replaced during the upgrade. Therefore, a backup file is required to
|
# replaced during the upgrade. Therefore, a backup file is required to
|
||||||
# replace the locale-archive.
|
# replace the locale-archive.
|
||||||
ln locale-archive locale-archive.update
|
mv locale-archive locale-archive.update
|
||||||
|
|
||||||
|
$olddir/build-%{target}/elf/ld.so \
|
||||||
|
--library-path $olddir/build-%{target}/ \
|
||||||
|
$olddir/build-%{target}/locale/localedef \
|
||||||
|
--alias-file=$olddir/intl/locale.alias \
|
||||||
|
--prefix $RPM_BUILD_ROOT --add-to-archive \
|
||||||
|
zh_* en_*
|
||||||
|
mv locale-archive locale-archive.default
|
||||||
popd
|
popd
|
||||||
mv $RPM_BUILD_ROOT%{_prefix}/lib/locale/libc.lang .
|
mv $RPM_BUILD_ROOT%{_prefix}/lib/locale/libc.lang .
|
||||||
|
|
||||||
@ -1103,27 +1111,35 @@ else
|
|||||||
io.stdout:write ("Error: Missing " .. iconv_cache .. " file.\n")
|
io.stdout:write ("Error: Missing " .. iconv_cache .. " file.\n")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
%postun common
|
||||||
|
archive_path="%{_prefix}/lib/locale/locale-archive"
|
||||||
|
if [ -f "$archive_path" ];then
|
||||||
|
unlink "$archive_path"
|
||||||
|
fi
|
||||||
|
|
||||||
|
%posttrans common
|
||||||
|
archive_path="%{_prefix}/lib/locale/locale-archive"
|
||||||
|
default_path="%{_prefix}/lib/locale/locale-archive.default"
|
||||||
|
if [ -f "$archive_path" ];then
|
||||||
|
unlink "$archive_path"
|
||||||
|
fi
|
||||||
|
ln "$default_path" "$archive_path"
|
||||||
|
|
||||||
|
%postun locale-archive
|
||||||
|
archive_path="%{_prefix}/lib/locale/locale-archive"
|
||||||
|
default_path="%{_prefix}/lib/locale/locale-archive.default"
|
||||||
|
if [ -f "$archive_path" ];then
|
||||||
|
unlink "$archive_path"
|
||||||
|
fi
|
||||||
|
ln "$default_path" "$archive_path"
|
||||||
|
|
||||||
%posttrans locale-archive
|
%posttrans locale-archive
|
||||||
archive_path="%{_prefix}/lib/locale/locale-archive"
|
archive_path="%{_prefix}/lib/locale/locale-archive"
|
||||||
update_path="%{_prefix}/lib/locale/locale-archive.update"
|
update_path="%{_prefix}/lib/locale/locale-archive.update"
|
||||||
save_path="%{_prefix}/lib/locale/locale-archive.rpmsave"
|
if [ -f "$archive_path" ];then
|
||||||
archive_stat=`stat --format="%D %i" "$archive_path" 2>/dev/null || echo "null"`
|
unlink "$archive_path"
|
||||||
update_stat=`stat --format="%D %i" "$update_path" || echo "null"`
|
|
||||||
# When the hard link does not match, use locale-archive.update
|
|
||||||
if [ "$archive_stat" != "null" ] &&
|
|
||||||
[ "$update_stat" != "null" ] &&
|
|
||||||
[ "$archive_stat" != "$update_stat" ];then
|
|
||||||
unlink $archive_path
|
|
||||||
archive_stat="null"
|
|
||||||
fi
|
|
||||||
# Regenerate a file if it does not exist
|
|
||||||
if [ "$archive_stat" == "null" ];then
|
|
||||||
ln "$update_path" "$archive_path"
|
|
||||||
fi
|
|
||||||
# Delete the .rpmsave
|
|
||||||
if [ -f "$save_path" ];then
|
|
||||||
unlink $save_path
|
|
||||||
fi
|
fi
|
||||||
|
ln "$update_path" "$archive_path"
|
||||||
|
|
||||||
%pre devel
|
%pre devel
|
||||||
# this used to be a link and it is causing nightmares now
|
# this used to be a link and it is causing nightmares now
|
||||||
@ -1171,20 +1187,14 @@ fi
|
|||||||
%dir %{_prefix}/lib/locale
|
%dir %{_prefix}/lib/locale
|
||||||
%dir %{_prefix}/lib/locale/C.utf8
|
%dir %{_prefix}/lib/locale/C.utf8
|
||||||
%{_prefix}/lib/locale/C.utf8/*
|
%{_prefix}/lib/locale/C.utf8/*
|
||||||
%{_prefix}/lib/locale/zh*
|
%attr(0644,root,root) %config(noreplace) %{_prefix}/lib/locale/locale-archive.default
|
||||||
%{_prefix}/lib/locale/en*
|
|
||||||
%{_prefix}/share/locale/zh*
|
|
||||||
%{_prefix}/share/locale/en*
|
|
||||||
|
|
||||||
%files -f libc.lang all-langpacks
|
%files -f libc.lang all-langpacks
|
||||||
%{_prefix}/lib/locale
|
%{_prefix}/lib/locale
|
||||||
%exclude %{_prefix}/lib/locale/locale-archive
|
%exclude %{_prefix}/lib/locale/locale-archive
|
||||||
%exclude %{_prefix}/lib/locale/locale-archive.update
|
%exclude %{_prefix}/lib/locale/locale-archive.update
|
||||||
|
%exclude %{_prefix}/lib/locale/locale-archive.default
|
||||||
%exclude %{_prefix}/lib/locale/C.utf8
|
%exclude %{_prefix}/lib/locale/C.utf8
|
||||||
%exclude %{_prefix}/lib/locale/zh*
|
|
||||||
%exclude %{_prefix}/lib/locale/en*
|
|
||||||
%exclude %{_prefix}/share/locale/zh*
|
|
||||||
%exclude %{_prefix}/share/locale/en*
|
|
||||||
|
|
||||||
%files locale-source
|
%files locale-source
|
||||||
%dir %{_prefix}/share/i18n/locales
|
%dir %{_prefix}/share/i18n/locales
|
||||||
@ -1193,7 +1203,6 @@ fi
|
|||||||
%{_prefix}/share/i18n/charmaps/*
|
%{_prefix}/share/i18n/charmaps/*
|
||||||
|
|
||||||
%files locale-archive
|
%files locale-archive
|
||||||
%attr(0644,root,root) %{_prefix}/lib/locale/locale-archive
|
|
||||||
%attr(0644,root,root) %{_prefix}/lib/locale/locale-archive.update
|
%attr(0644,root,root) %{_prefix}/lib/locale/locale-archive.update
|
||||||
|
|
||||||
%files -f devel.filelist devel
|
%files -f devel.filelist devel
|
||||||
@ -1245,6 +1254,9 @@ fi
|
|||||||
%endif
|
%endif
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Wed Jun 1 2022 Qingqing Li <liqingqing3@huawei.com> - 2.35-10
|
||||||
|
- use locale-archive to prevent basic command performance regression
|
||||||
|
|
||||||
* Thu May 12 2022 jiangheng <jiangheng14@huawei.com> - 2.35-9
|
* Thu May 12 2022 jiangheng <jiangheng14@huawei.com> - 2.35-9
|
||||||
- restore nscd
|
- restore nscd
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user