Export our own version of glob_pattern_p() as rpmIsGlob()

- Further preliminaries to hiding the glob() implementation
This commit is contained in:
Panu Matilainen 2012-05-31 15:40:51 +03:00
parent a6821de783
commit 38932d1d17
3 changed files with 14 additions and 2 deletions

View File

@ -1597,7 +1597,7 @@ static rpmRC processBinaryFile(Package pkg, FileList fl, const char * fileName)
if (trailing_slash && !fl->cur.isDir)
fl->cur.isDir = -1;
doGlob = glob_pattern_p(fileName, quote);
doGlob = rpmIsGlob(fileName, quote);
/* Check that file starts with leading "/" */
if (*fileName != '/') {

View File

@ -108,6 +108,14 @@ char * rpmGenPath (const char * urlroot,
*/
char * rpmGetPath (const char * path, ...) RPM_GNUC_NULL_TERMINATED;
/** \ingroup rpmfileutil
* Check whether pattern contains any glob metacharacters.
* @param pattern glob pattern
* @param quote allow backslash quoting of metacharacters?
* @return 1 if pattern contains globs, 0 otherwise
*/
int rpmIsGlob(const char * pattern, int quote);
/** \ingroup rpmfileutil
* Return URL path(s) from a (URL prefixed) pattern glob.
* @param patterns glob pattern

View File

@ -54,7 +54,7 @@ int rpmGlob(const char * patterns, int * argcPtr, ARGV_t * argvPtr)
int dir_only = (plen > 0 && path[plen-1] == '/');
glob_t gl;
if (!local || (!glob_pattern_p(av[j], 0) && strchr(path, '~') == NULL)) {
if (!local || (!rpmIsGlob(av[j], 0) && strchr(path, '~') == NULL)) {
argvAdd(&argv, av[j]);
continue;
}
@ -146,3 +146,7 @@ exit:
return rc;
}
int rpmIsGlob(const char * pattern, int quote)
{
return glob_pattern_p(pattern, quote);
}