From: Michael Schroeder Date: Tue, 9 Apr 2019 14:30:47 +0000 (+0200) Subject: pool_conda_matchspec: return a simple dependency if we can X-Git-Tag: 0.7.5~36 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=11494d71459ae9b852948ad6a3f79d25458a8cba;p=thirdparty%2Flibsolv.git pool_conda_matchspec: return a simple dependency if we can --- diff --git a/src/conda.c b/src/conda.c index 63da8f87..8db098ee 100644 --- a/src/conda.c +++ b/src/conda.c @@ -559,6 +559,7 @@ pool_conda_matchspec(Pool *pool, const char *name) char *p, *pp; char *build, *buildend, *version, *versionend; Id nameid, evrid = 1; + int haveglob = 0; /* ignore channel and namespace for now */ if ((p2 = strrchr(name, ':'))) @@ -566,19 +567,27 @@ pool_conda_matchspec(Pool *pool, const char *name) name2 = solv_strdup(name); /* find end of name */ for (p = name2; *p && *p != ' ' && *p != '=' && *p != '<' && *p != '>' && *p != '!' && *p != '~'; p++) - if (*p >= 'A' && *p <= 'Z') - *(char *)p += 'a' - 'A'; /* lower case the name */ + { + if (*p >= 'A' && *p <= 'Z') + *(char *)p += 'a' - 'A'; /* lower case the name */ + else if (*p == '*') + haveglob = 1; + } if (p == name2) { solv_free(name2); - return 0; /* error: no package name */ + return 0; /* error: empty package name */ } nameid = pool_strn2id(pool, name2, p - name2, 1); while (*p == ' ') p++; if (!*p) { - solv_free(name2); + if (*name2 != '^' && !haveglob) + { + solv_free(name2); + return nameid; /* return a simple dependency if no glob/regex */ + } return pool_rel2id(pool, nameid, evrid, REL_CONDA, 1); } /* have version */