raven-rhel6/rpm/rpm-4.11.x-sources-to-lua-variables.patch

33 lines
1.1 KiB
Diff
Raw Permalink Normal View History

2024-02-21 20:14:44 +06:00
From 344f938670b8f7400ef177945cef5552783d450f Mon Sep 17 00:00:00 2001
From: Lubos Kardos <lkardos@redhat.com>
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);