diff options
author | Xavier Chantry <chantry.xavier@gmail.com> | 2010-05-17 19:10:50 +0200 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2010-05-17 18:27:01 -0500 |
commit | 3a85f83840888cbab09f2413fa3eb7c3b71055e5 (patch) | |
tree | 11cb4c2356fb7e7eb8bed2fbccee22accbb311a6 /src | |
parent | df842e11cfa4a41f7a333270ab587fe6ee2e8a27 (diff) |
Allow Include directive in any sections
Fix a regression of 51f9e5e40a7 that only allowed Include in repo sections.
Thanks to Marc - A. Dahlhaus for reporting the issue.
Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/pacman/pacman.c | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c index 09a81059..6ecda052 100644 --- a/src/pacman/pacman.c +++ b/src/pacman/pacman.c @@ -959,7 +959,21 @@ static int _parseconfig(const char *file, const char *givensection, ret = 1; goto cleanup; } + /* Include is allowed in both options and repo sections */ + if(strcmp(key, "Include") == 0) { + if(value == NULL) { + pm_printf(PM_LOG_ERROR, _("config file %s, line %d: directive %s needs a value\n"), + file, linenum, key); + ret = 1; + goto cleanup; + } + pm_printf(PM_LOG_DEBUG, "config: including %s\n", value); + /* Ignore include failures... assume non-critical */ + _parseconfig(value, section, db); + continue; + } if(strcmp(section, "options") == 0) { + /* we are either in options ... */ if((ret = _parse_options(key, value)) != 0) { pm_printf(PM_LOG_ERROR, _("config file %s, line %d: problem in options section\n"), file, linenum); @@ -968,18 +982,8 @@ static int _parseconfig(const char *file, const char *givensection, } continue; } else { - /* we are in a repo section */ - if(strcmp(key, "Include") == 0) { - if(value == NULL) { - pm_printf(PM_LOG_ERROR, _("config file %s, line %d: directive %s needs a value\n"), - file, linenum, key); - ret = 1; - goto cleanup; - } - pm_printf(PM_LOG_DEBUG, "config: including %s\n", value); - _parseconfig(value, section, db); - /* Ignore include failures... assume non-critical */ - } else if(strcmp(key, "Server") == 0) { + /* ... or in a repo section */ + if(strcmp(key, "Server") == 0) { if(value == NULL) { pm_printf(PM_LOG_ERROR, _("config file %s, line %d: directive %s needs a value\n"), file, linenum, key); |