From 344f938670b8f7400ef177945cef5552783d450f Mon Sep 17 00:00:00 2001 From: Lubos Kardos Date: Fri, 10 Apr 2015 17:28:17 +0200 Subject: [PATCH] Fix adding of sources to lua variables during recursive parsing of spec - Before this fix sources and patches weren't added to lua variables "sources" and "patches" if they were located in spec file after tag "BuildArch". Now it works.(rhbz:#1084309) Adjusted for rpm 4.8.0 --- a/build/spec.c +++ b/build/spec.c @@ -346,7 +346,7 @@ addMacro(spec->macros, buf, NULL, p->fullSource, RMIL_SPEC); free(buf); #ifdef WITH_LUA - if (!spec->recursing) { + { rpmlua lua = NULL; /* global state */ const char * what = (flag & RPMBUILD_ISPATCH) ? "patches" : "sources"; rpmluaPushTable(lua, what); @@ -449,6 +449,8 @@ { /* make sure patches and sources tables always exist */ rpmlua lua = NULL; /* global state */ + rpmluaDelVar(lua, "patches"); + rpmluaDelVar(lua, "sources"); rpmluaPushTable(lua, "patches"); rpmluaPushTable(lua, "sources"); rpmluaPop(lua);