Re: RPM API: parseSpec and macroContext

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2/11/20 8:04 PM, Matwey V. Kornilov wrote:
Hello,

I would like to read a number of spec files in a row in my
application. However, I've found that RPM maintains global macro
context inside rpmSpec type.
This way, a macro from the first spec are visible for other spec
files, leading to parsing issues. What should be a proper way to
revert macro context to the initial state before subsequent calling
parseSpec()?


Being quite familiar with this problem, I was about to point you to rpmspec.c source for an example, but seems I never actually got to fix the problem there :(

So I'll have to point you to a freshly created pull-request instead:
https://github.com/rpm-software-management/rpm/pull/1067

But to summarise, simply call rpmFreeMacros() and rpmReadConfigFiles() after each attempted spec parse. This is a shotgun solution of course but there's no better way to reset the state at the moment.

	- Panu -

_______________________________________________
Rpm-list mailing list
Rpm-list@xxxxxxxxxxxxx
http://lists.rpm.org/mailman/listinfo/rpm-list



[Index of Archives]     [RPM Ecosystem]     [Linux Kernel]     [Red Hat Install]     [PAM]     [Red Hat Watch]     [Red Hat Development]     [Red Hat]     [Gimp]     [Yosemite News]     [IETF Discussion]

  Powered by Linux