[packages/fish] - use lua macros for /etc/shells manipulation

arekm arekm at pld-linux.org
Wed Sep 16 15:47:23 CEST 2015


commit c2765f592a094f9a0f737db3a912331cc9935a8d
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Wed Sep 16 15:47:18 2015 +0200

    - use lua macros for /etc/shells manipulation

 fish.spec | 19 ++++++-------------
 1 file changed, 6 insertions(+), 13 deletions(-)
---
diff --git a/fish.spec b/fish.spec
index 370d830..2008321 100644
--- a/fish.spec
+++ b/fish.spec
@@ -48,20 +48,13 @@ rm -rf $RPM_BUILD_ROOT
 %clean
 rm -rf $RPM_BUILD_ROOT
 
-%post
-umask 022
-if [ ! -f /etc/shells ]; then
-        echo "%{_bindir}/fish" >> /etc/shells
-else
-        grep -q '^%{_bindir}/fish$' /etc/shells || echo "%{_bindir}/fish" >> /etc/shells
-fi
+%post -p <lua>
+%lua_add_etc_shells %{_bindir}/fish
 
-%preun
-if [ "$1" = "0" ]; then
-        umask 022
-        grep -v '^%{_bindir}/fish$' /etc/shells > /etc/shells.new
-        mv -f /etc/shells.new /etc/shells
-fi
+%preun -p <lua>
+if arg[2] == 0 then
+	%lua_remove_etc_shells %{_bindir}/fish
+end
 
 %files -f %{name}.lang
 %defattr(644,root,root,755)
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/fish.git/commitdiff/c2765f592a094f9a0f737db3a912331cc9935a8d



More information about the pld-cvs-commit mailing list