Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | python/rpmmodules.c: Change the way the python module loads the RPM config |
| 2 | |
| 3 | In order to support the RPM_VENDOR_WINDRIVER enhancement of dynamic |
| 4 | runtime relocation paths, we need to call rpmcliInit instead of |
| 5 | rpmReadConfigFiles. The rpmcliInit will end up calling rpmReadConfigFiles |
| 6 | after the necessary relocation processing (if enabled). |
| 7 | |
| 8 | Code derived from changes suggested by Paul Eggleton. |
| 9 | |
| 10 | Upstream-Status: Pending |
| 11 | |
| 12 | Signed-off-by: Mark Hatle <mark.hatle@windriver.com> |
| 13 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 14 | Index: rpm/python/rpmmodule.c |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 15 | =================================================================== |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 16 | --- 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 Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 21 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 22 | - /* failure to initialize rpm (crypto and all) is rather fatal too... */ |
| 23 | - if (rpmReadConfigFiles(NULL, NULL) == -1) |
| 24 | - return 0; |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 25 | + const char *argv[1] = {"rpmmodule", 0}; |
| 26 | + rpmcliInit(1, argv, NULL); |
| 27 | |
| 28 | d = PyModule_GetDict(m); |
| 29 | |