]> git.pld-linux.org Git - packages/rpm.git/commitdiff
- %remove_etc_shells with -p skips code if upgraded
authorElan Ruusamäe <glen@pld-linux.org>
Sun, 10 Feb 2008 12:44:19 +0000 (12:44 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    rpm.macros -> 1.428

rpm.macros

index 03f9d5d275a7335f6309e62a1bfb4e7cf0c5a61b..5a97446b7e9b499da1cc50d9e8e01cd5ecbadd90 100644 (file)
@@ -1420,20 +1420,22 @@ end\
 %{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
This page took 0.048145 seconds and 4 git commands to generate.