[packages/rpm-build-macros] - explictly close files opened in lua because implict closing happens too late this causing /etc/she

arekm arekm at pld-linux.org
Sat Jul 6 21:14:56 CEST 2013


commit 05277d59c9eb5e49e0aa8db8dd6c852985cbdb58
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Sat Jul 6 21:14:53 2013 +0200

    - explictly close files opened in lua because implict closing happens too late this causing /etc/shells corruption

 rpm-build-macros.spec | 2 +-
 rpm.macros            | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/rpm-build-macros.spec b/rpm-build-macros.spec
index 8175d73..5faf722 100644
--- a/rpm-build-macros.spec
+++ b/rpm-build-macros.spec
@@ -5,7 +5,7 @@
 %if "%{pld_release}" == "ac"
 %define	with_rpm4	1
 %endif
-%define		rpm_macros_rev	1.666
+%define		rpm_macros_rev	1.667
 %define		find_lang_rev	1.36
 Summary:	PLD Linux RPM build macros
 Summary(pl.UTF-8):	Makra do budowania pakietów RPM dla Linuksa PLD
diff --git a/rpm.macros b/rpm.macros
index 45ac621..d4a3fd4 100644
--- a/rpm.macros
+++ b/rpm.macros
@@ -1609,6 +1609,7 @@ f = io.open("%{_docdir}/%{name}-%{version}/optional-packages.txt", "r") \
 if f then \
 	for l in f:lines() do print(l); end \
 end \
+f:close() \
 %{nil}
 
 
@@ -1988,7 +1989,7 @@ s=""\
 for _, l in pairs(t) do\
 	s=s..l.."\\n"\
 end\
-io.open("/etc/shells", "w"):write(s)\
+f = io.open("/etc/shells", "w"); f:write(s); f:close()\
 %{nil}
 
 # Backwards compat. Use of %lua_ prefixed macros is preferred as these are cleaner to read.
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/rpm-build-macros.git/commitdiff/05277d59c9eb5e49e0aa8db8dd6c852985cbdb58



More information about the pld-cvs-commit mailing list