SOURCES: rpm.macros - %remove_etc_shells with -p skips code if upg...
glen
glen at pld-linux.org
Sun Feb 10 13:44:24 CET 2008
Author: glen Date: Sun Feb 10 12:44:24 2008 GMT
Module: SOURCES Tag: HEAD
---- Log message:
- %remove_etc_shells with -p skips code if upgraded
---- Files affected:
SOURCES:
rpm.macros (1.427 -> 1.428)
---- Diffs:
================================================================
Index: SOURCES/rpm.macros
diff -u SOURCES/rpm.macros:1.427 SOURCES/rpm.macros:1.428
--- SOURCES/rpm.macros:1.427 Sun Feb 10 13:35:52 2008
+++ SOURCES/rpm.macros Sun Feb 10 13:44:19 2008
@@ -1420,20 +1420,22 @@
%{nil}
%remove_etc_shells(p) %{-p:<lua>}\
-t = {}\
-f = io.open("/etc/shells", "r")\
-if f then\
- for l in f:lines() do t[l]=l; end\
- f:close()\
-end\
-for _, l in pairs({%{expand:%%__lua_split %*}}) do\
- t[l] = nil\
-end\
-s=""\
-for _, l in pairs(t) do\
- s=s..l.."\\n"\
-end\
-io.open("/etc/shells", "w"):write(s)\
+%{-p:if arg[2] == "0" then}\
+ t = {}\
+ f = io.open("/etc/shells", "r")\
+ if f then\
+ for l in f:lines() do t[l]=l; end\
+ f:close()\
+ end\
+ for _, l in pairs({%{expand:%%__lua_split %*}}) do\
+ t[l] = nil\
+ end\
+ s=""\
+ for _, l in pairs(t) do\
+ s=s..l.."\\n"\
+ end\
+ io.open("/etc/shells", "w"):write(s)\
+%{-p:end} \
%{nil}
# vim:ts=4 sw=4 noet syn=spec
================================================================
---- CVS-web:
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES/rpm.macros?r1=1.427&r2=1.428&f=u
More information about the pld-cvs-commit
mailing list