f = io.open("%{_docdir}/%{name}-%{version}/optional-packages.txt", "r") \
if f then \
for l in f:lines() do print(l); end \
+ f.close() \
end \
%{nil}
for _, l in pairs(t) do\
s=s..l.."\\n"\
end\
-io.open("/etc/shells", "w"):write(s)\
+f = io.open("/etc/shells", "w")\
+if f then\
+ write(s)\
+ f:close()\
+end\
%{nil}
# Backwards compat. Use of %lua_ prefixed macros is preferred as these are cleaner to read.