mirror of
https://github.com/moparisthebest/pacman
synced 2025-02-28 09:21:53 -05:00
Allow unreadable Include files to be non-fatal
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com> [Dan: remove unused variable, make parseconfig static] Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
parent
e5cdac7d48
commit
a4b8138797
@ -643,12 +643,9 @@ static int _parseconfig(const char *file, const char *givensection,
|
|||||||
} else {
|
} else {
|
||||||
/* directives with settings */
|
/* directives with settings */
|
||||||
if(strcmp(key, "Include") == 0 || strcmp(upperkey, "INCLUDE") == 0) {
|
if(strcmp(key, "Include") == 0 || strcmp(upperkey, "INCLUDE") == 0) {
|
||||||
int ret;
|
|
||||||
pm_printf(PM_LOG_DEBUG, "config: including %s\n", ptr);
|
pm_printf(PM_LOG_DEBUG, "config: including %s\n", ptr);
|
||||||
ret = _parseconfig(ptr, section, db);
|
_parseconfig(ptr, section, db);
|
||||||
if(ret != 0) {
|
/* Ignore include failures... assume non-critical */
|
||||||
return(ret);
|
|
||||||
}
|
|
||||||
} else if(strcmp(section, "options") == 0) {
|
} else if(strcmp(section, "options") == 0) {
|
||||||
if(strcmp(key, "NoUpgrade") == 0
|
if(strcmp(key, "NoUpgrade") == 0
|
||||||
|| strcmp(upperkey, "NOUPGRADE") == 0) {
|
|| strcmp(upperkey, "NOUPGRADE") == 0) {
|
||||||
@ -736,7 +733,7 @@ static int _parseconfig(const char *file, const char *givensection,
|
|||||||
* @param file path to the config file.
|
* @param file path to the config file.
|
||||||
* @return 0 on success, non-zero on error
|
* @return 0 on success, non-zero on error
|
||||||
*/
|
*/
|
||||||
int parseconfig(const char *file)
|
static int parseconfig(const char *file)
|
||||||
{
|
{
|
||||||
/* call the real parseconfig function with a null section & db argument */
|
/* call the real parseconfig function with a null section & db argument */
|
||||||
return(_parseconfig(file, NULL, NULL));
|
return(_parseconfig(file, NULL, NULL));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user