mirror of
https://github.com/moparisthebest/pacman
synced 2025-02-28 17:31:52 -05:00
Allow to include a path containing wildcards
Dan: line wrapping and man page touchup. Signed-off-by: Marc-A. Dahlhaus <mad@wol.de> Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
parent
a6ace987a9
commit
5752e276fb
@ -155,7 +155,7 @@ fi
|
||||
AM_CONDITIONAL(INTERNAL_DOWNLOAD, test "x$internaldownload" = "xyes")
|
||||
|
||||
# Checks for header files.
|
||||
AC_CHECK_HEADERS([fcntl.h libintl.h limits.h locale.h string.h strings.h sys/ioctl.h sys/param.h sys/statvfs.h sys/syslimits.h sys/time.h syslog.h wchar.h])
|
||||
AC_CHECK_HEADERS([fcntl.h glob.h libintl.h limits.h locale.h string.h strings.h sys/ioctl.h sys/param.h sys/statvfs.h sys/syslimits.h sys/time.h syslog.h wchar.h])
|
||||
|
||||
# Checks for typedefs, structures, and compiler characteristics.
|
||||
AC_C_INLINE
|
||||
|
@ -98,7 +98,8 @@ Options
|
||||
|
||||
*Include =* path::
|
||||
Include another config file. This file can include repositories or
|
||||
general configuration options.
|
||||
general configuration options. Wildcards in the specified paths will get
|
||||
expanded based on linkman:glob[7] rules.
|
||||
|
||||
*Architecture =* auto | i686 | x86_64 | ...::
|
||||
If set, pacman will only allow installation of packages of the given
|
||||
|
@ -39,6 +39,7 @@
|
||||
#include <locale.h> /* setlocale */
|
||||
#include <time.h> /* time_t */
|
||||
#include <errno.h>
|
||||
#include <glob.h>
|
||||
#if defined(PACMAN_DEBUG) && defined(HAVE_MCHECK_H)
|
||||
#include <mcheck.h> /* debug tracing (mtrace) */
|
||||
#endif
|
||||
@ -967,9 +968,35 @@ static int _parseconfig(const char *file, const char *givensection,
|
||||
ret = 1;
|
||||
goto cleanup;
|
||||
}
|
||||
pm_printf(PM_LOG_DEBUG, "config: including %s\n", value);
|
||||
/* Ignore include failures... assume non-critical */
|
||||
_parseconfig(value, section, db);
|
||||
int globret;
|
||||
glob_t globbuf;
|
||||
globret = glob(value, GLOB_NOCHECK, NULL, &globbuf);
|
||||
switch(globret) {
|
||||
case GLOB_NOSPACE:
|
||||
pm_printf(PM_LOG_DEBUG,
|
||||
"config file %s, line %d: include globing out of space\n",
|
||||
file, linenum);
|
||||
break;
|
||||
case GLOB_ABORTED:
|
||||
pm_printf(PM_LOG_DEBUG,
|
||||
"config file %s, line %d: include globing read error for %s\n",
|
||||
file, linenum, value);
|
||||
break;
|
||||
case GLOB_NOMATCH:
|
||||
pm_printf(PM_LOG_DEBUG,
|
||||
"config file %s, line %d: no include found for %s\n",
|
||||
file, linenum, value);
|
||||
break;
|
||||
default:
|
||||
for(int gindex = 0; gindex < globbuf.gl_pathc; gindex++) {
|
||||
pm_printf(PM_LOG_DEBUG, "config file %s, line %d: including %s\n",
|
||||
file, linenum, globbuf.gl_pathv[gindex]);
|
||||
_parseconfig(globbuf.gl_pathv[gindex], section, db);
|
||||
}
|
||||
break;
|
||||
}
|
||||
globfree(&globbuf);
|
||||
continue;
|
||||
}
|
||||
if(strcmp(section, "options") == 0) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user