add checks to post and pretrans
This commit is contained in:
parent
4f0c047284
commit
f02139cd19
@ -3,7 +3,7 @@
|
|||||||
Name: hunspell
|
Name: hunspell
|
||||||
Summary: A spell checker and morphological analyzer library
|
Summary: A spell checker and morphological analyzer library
|
||||||
Version: 1.7.0
|
Version: 1.7.0
|
||||||
Release: 14%{?dist}
|
Release: 15%{?dist}
|
||||||
Source: https://github.com/hunspell/hunspell/archive/v%{version}.tar.gz
|
Source: https://github.com/hunspell/hunspell/archive/v%{version}.tar.gz
|
||||||
URL: https://github.com/hunspell/hunspell
|
URL: https://github.com/hunspell/hunspell
|
||||||
License: LGPLv2+ or GPLv2+ or MPLv1.1
|
License: LGPLv2+ or GPLv2+ or MPLv1.1
|
||||||
@ -106,15 +106,18 @@ mkdir $RPM_BUILD_ROOT/%{_datadir}/myspell
|
|||||||
%pretrans -p <lua>
|
%pretrans -p <lua>
|
||||||
-- Rename dir from myspell to hunspell
|
-- Rename dir from myspell to hunspell
|
||||||
-- DO NOT add a trailing slash at the end.
|
-- DO NOT add a trailing slash at the end.
|
||||||
old_path = "/usr/share/myspell"
|
old_path = "%{_datadir}/myspell"
|
||||||
new_path = "/usr/share/hunspell"
|
new_path = "%{_datadir}/hunspell"
|
||||||
st = posix.stat(old_path)
|
old_st = posix.stat(old_path)
|
||||||
if st and st.type == "directory" then
|
new_st = posix.stat(new_path)
|
||||||
status = os.rename(old_path, new_path)
|
if old_st and old_st.type == "directory" and not new_st then
|
||||||
|
os.rename(old_path, new_path)
|
||||||
end
|
end
|
||||||
|
|
||||||
%post
|
%post -p <lua>
|
||||||
%__ln_s %{_datadir}/hunspell %{_datadir}/myspell
|
if not posix.stat("%{_datadir}/myspell") then
|
||||||
|
posix.symlink("%{_datadir}/hunspell", "%{_datadir}/myspell")
|
||||||
|
end
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%files -f %{name}.lang
|
%files -f %{name}.lang
|
||||||
@ -153,6 +156,11 @@ end
|
|||||||
%endif
|
%endif
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Wed Jan 26 2022 Jens Petersen <petersen@redhat.com> - 1.7.0-15
|
||||||
|
- improve the filesystem pretrans and post scripts:
|
||||||
|
- pretrans now checks if /usr/share/hunspell exists first
|
||||||
|
- post checks that /usr/share/myspell does not exist
|
||||||
|
|
||||||
* Wed Jan 26 2022 Jens Petersen <petersen@redhat.com> - 1.7.0-14
|
* Wed Jan 26 2022 Jens Petersen <petersen@redhat.com> - 1.7.0-14
|
||||||
- requires coreutils for post script (#2045568)
|
- requires coreutils for post script (#2045568)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user