blob: 92ef1dc50e529338ebfb0ec78789521c7dd71fe8 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001python/rpmmodules.c: Change the way the python module loads the RPM config
2
3In order to support the RPM_VENDOR_WINDRIVER enhancement of dynamic
4runtime relocation paths, we need to call rpmcliInit instead of
5rpmReadConfigFiles. The rpmcliInit will end up calling rpmReadConfigFiles
6after the necessary relocation processing (if enabled).
7
8Code derived from changes suggested by Paul Eggleton.
9
10Upstream-Status: Pending
11
12Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
13
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050014Index: rpm/python/rpmmodule.c
Patrick Williamsc124f4f2015-09-15 14:41:29 -050015===================================================================
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050016--- rpm.orig/python/rpmmodule.c
17+++ rpm/python/rpmmodule.c
18@@ -382,9 +382,8 @@ static int initModule(PyObject *m)
19 /* XXX add --noparentdirs --nolinktos to rpmtsCheck() */
20 global_depFlags = (RPMDEPS_FLAG_NOPARENTDIRS | RPMDEPS_FLAG_NOLINKTOS);
Patrick Williamsc124f4f2015-09-15 14:41:29 -050021
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050022- /* failure to initialize rpm (crypto and all) is rather fatal too... */
23- if (rpmReadConfigFiles(NULL, NULL) == -1)
24- return 0;
Patrick Williamsc124f4f2015-09-15 14:41:29 -050025+ const char *argv[1] = {"rpmmodule", 0};
26+ rpmcliInit(1, argv, NULL);
27
28 d = PyModule_GetDict(m);
29