return pool_queuetowhatprovides($self, &q);
}
+ void set_namespaceproviders(DepId ns, DepId evr, bool value=1) {
+ Id dep = pool_rel2id($self, ns, evr, REL_NAMESPACE, 1);
+ pool_set_whatprovides($self, dep, value ? 2 : 1);
+ }
+
+ void flush_namespaceproviders(DepId ns, DepId evr) {
+ pool_flush_namespaceproviders($self, ns, evr);
+ }
+
+
%typemap(out) Queue whatmatchesdep Queue2Array(XSolvable *, 1, new_XSolvable(arg1, id));
%newobject whatmatchesdep;
Queue whatmatchesdep(Id keyname, DepId dep, Id marker = -1) {
.\" Title: Libsolv-Bindings
.\" Author: [see the "Author" section]
.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 11/16/2017
+.\" Date: 01/18/2018
.\" Manual: LIBSOLV
.\" Source: libsolv
.\" Language: English
.\"
-.TH "LIBSOLV\-BINDINGS" "3" "11/16/2017" "libsolv" "LIBSOLV"
+.TH "LIBSOLV\-BINDINGS" "3" "01/18/2018" "libsolv" "LIBSOLV"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.RS 4
.\}
.nf
+\fBvoid set_namespaceproviders(DepId\fR \fIns\fR\fB, DepId\fR \fIevr\fR\fB, bool\fR \fIvalue\fR \fB= 1)\fR
+\fI$pool\fR\fB\->set_namespaceproviders(\fR\fI$ns\fR\fB,\fR \fI$evr\fR\fB, 1)\fR;
+\fIpool\fR\fB\&.set_namespaceproviders(\fR\fIns\fR\fB,\fR \fIevr\fR\fB,\fR \fITrue\fR\fB)\fR
+\fIpool\fR\fB\&.set_namespaceproviders(\fR\fIns\fR\fB,\fR \fIevr\fR\fB,\fR \fItrue\fR\fB)\fR
+.fi
+.if n \{\
+.RE
+.\}
+.sp
+Manually set an namespace provides entry in the whatprovides index\&.
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
+\fBvoid flush_namespaceproviders(DepId\fR \fIns\fR\fB, DepId\fR \fIevr\fR\fB)\fR
+\fI$pool\fR\fB\->flush_namespaceproviders(\fR\fI$ns\fR\fB,\fR \fI$evr\fR\fB)\fR;
+\fI$pool\fR\fB\&.flush_namespaceproviders(\fR\fIns\fR\fB,\fR \fIevr\fR\fB)\fR
+\fI$pool\fR\fB\&.flush_namespaceproviders(\fR\fIns\fR\fB,\fR \fIevr\fR\fB)\fR
+.fi
+.if n \{\
+.RE
+.\}
+.sp
+Flush the cache of all namespacprovudes matching the specified namespace dependency\&. You can use zero as a wildcard argument\&.
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
\fBbool isknownarch(DepId\fR \fIid\fR\fB)\fR
my \fI$bool\fR \fB=\fR \fI$pool\fR\fB\->isknownarch(\fR\fI$id\fR\fB)\fR;
\fIbool\fR \fB=\fR \fIpool\fR\fB\&.isknownarch(\fR\fIid\fR\fB)\fR
'\" t
.\" Title: Libsolv-Pool
.\" Author: [see the "Author" section]
-.\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
-.\" Date: 09/04/2017
+.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
+.\" Date: 01/18/2018
.\" Manual: LIBSOLV
.\" Source: libsolv
.\" Language: English
.\"
-.TH "LIBSOLV\-POOL" "3" "09/04/2017" "libsolv" "LIBSOLV"
+.TH "LIBSOLV\-POOL" "3" "01/18/2018" "libsolv" "LIBSOLV"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.RS 4
.\}
.nf
+\fBvoid pool_set_whatprovides(\fR\fIpool\fR\fB, Id\fR \fIid\fR\fB, Id\fR \fIoffset\fR\fB)\fR;
+.fi
+.if n \{\
+.RE
+.\}
+.sp
+Manually set an entry in the whatprovides index\&. You\(cqll never do this for package dependencies, as those entries are created by calling the pool_createwhatprovides() function\&. But this function is useful for namespace provides if you do not want to use a namespace callback to lazily set the provides\&. The offset argument is a offset in the whatprovides array, thus you can use \(lq1\(rq as a false value and \(lq2\(rq as true value\&.
+.sp
+.if n \{\
+.RS 4
+.\}
+.nf
\fBvoid pool_flush_namespaceproviders(Pool *\fR\fIpool\fR\fB, Id\fR \fIns\fR\fB, Id\fR \fIevr\fR\fB)\fR;
.fi
.if n \{\
create solver jobs working on a specific set of packages. See the Solver class
for more information.
+ void set_namespaceproviders(DepId ns, DepId evr, bool value = 1)
+ $pool->set_namespaceproviders($ns, $evr, 1);
+ pool.set_namespaceproviders(ns, evr, True)
+ pool.set_namespaceproviders(ns, evr, true)
+
+Manually set an namespace provides entry in the whatprovides index.
+
+ void flush_namespaceproviders(DepId ns, DepId evr)
+ $pool->flush_namespaceproviders($ns, $evr);
+ $pool.flush_namespaceproviders(ns, evr)
+ $pool.flush_namespaceproviders(ns, evr)
+
+Flush the cache of all namespacprovudes matching the specified namespace
+dependency. You can use zero as a wildcard argument.
+
bool isknownarch(DepId id)
my $bool = $pool->isknownarch($id);
bool = pool.isknownarch(id)
the meta section of the repositories to speed up the next time the
repository is loaded and addfileprovides is called
+ void pool_set_whatprovides(pool, Id id, Id offset);
+
+Manually set an entry in the whatprovides index. You'll never do this for
+package dependencies, as those entries are created by calling the
+pool_createwhatprovides() function. But this function is useful for
+namespace provides if you do not want to use a namespace callback to
+lazily set the provides. The offset argument is a offset in the
+whatprovides array, thus you can use ``1'' as a false value and ``2''
+as true value.
+
void pool_flush_namespaceproviders(Pool *pool, Id ns, Id evr);
Clear the cache of the providers for namespace dependencies matching
$pool->addfileprovides();
$pool->createwhatprovides();
+$pool->set_namespaceproviders($solv::NAMESPACE_LANGUAGE, $pool->Dep('de'), 1);
my @jobs;
for my $arg (@ARGV) {
pool_set_installed;
pool_set_languages;
pool_set_rootdir;
+ pool_set_whatprovides;
pool_setarch;
pool_setarchpolicy;
pool_setdebugcallback;
continue;
if (evr && rd->evr != evr)
continue;
- pool->whatprovides_rel[d] = 0;
+ if (pool->whatprovides_rel[d])
+ pool_set_whatprovides(pool, MAKERELDEP(d), 0);
}
}
return loc;
}
+void
+pool_set_whatprovides(Pool *pool, Id id, Id providers)
+{
+ int d, nrels = pool->nrels;
+ Reldep *rd;
+ Map m;
+
+ /* set new entry */
+ if (ISRELDEP(id))
+ {
+ d = GETRELID(id);
+ pool->whatprovides_rel[d] = providers;
+ d++;
+ }
+ else
+ {
+ pool->whatprovides[id] = providers;
+ if (id < pool->whatprovidesauxoff)
+ pool->whatprovidesaux[id] = 0; /* sorry */
+ d = 1;
+ }
+ if (!pool->whatprovides_rel)
+ return;
+ /* clear cache of all rels that use it */
+ map_init(&m, 0);
+ for (rd = pool->rels + d; d < nrels; d++, rd++)
+ {
+ if (rd->name == id || rd->evr == id ||
+ (m.size && ISRELDEP(rd->name) && MAPTST(&m, GETRELID(rd->name))) ||
+ (m.size && ISRELDEP(rd->evr) && MAPTST(&m, GETRELID(rd->evr))))
+ {
+ pool->whatprovides_rel[d] = 0; /* clear cache */
+ if (!m.size)
+ map_init(&m, nrels);
+ MAPSET(&m, d);
+ }
+ }
+ map_free(&m);
+}
+
static void
add_new_provider(Pool *pool, Id id, Id p)
{
Queue q;
Id *pp;
+ /* find whatprovides entry */
while (ISRELDEP(id))
{
Reldep *rd = GETRELDEP(pool, id);
id = rd->name;
}
+ /* add new provider to existing list keeping it sorted */
queue_init(&q);
for (pp = pool->whatprovidesdata + pool->whatprovides[id]; *pp; pp++)
{
if (*pp == p)
{
- queue_free(&q);
+ queue_free(&q); /* already have it */
return;
}
if (*pp > p)
}
if (p)
queue_push(&q, p);
- pool->whatprovides[id] = pool_queuetowhatprovides(pool, &q);
- if (id < pool->whatprovidesauxoff)
- pool->whatprovidesaux[id] = 0; /* sorry */
+ pool_set_whatprovides(pool, id, pool_queuetowhatprovides(pool, &q));
queue_free(&q);
}
continue;
s->provides = repo_addid_dep(s->repo, s->provides, id, SOLVABLE_FILEMARKER);
if (pool->whatprovides)
- add_new_provider(pool, fn, p);
- if (pool->whatprovides_rel)
- pool->whatprovides_rel[GETRELID(id)] = 0; /* clear cache */
+ add_new_provider(pool, id, p);
s = pool->solvables + q;
if (!s->repo)
continue;
void pool_whatmatchesdep(Pool *pool, Id keyname, Id dep, Queue *q, int marker);
void pool_whatcontainsdep(Pool *pool, Id keyname, Id dep, Queue *q, int marker);
+void pool_set_whatprovides(Pool *pool, Id id, Id providers);
+
/* search the pool. the following filters are available:
* p - search just this solvable