Skip to content

Commit

Permalink
Remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
j-mracek committed Nov 30, 2017
1 parent 4691a3a commit 8457669
Showing 1 changed file with 0 additions and 76 deletions.
76 changes: 0 additions & 76 deletions libdnf/dnf-sack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -354,82 +354,6 @@ dnf_sack_recompute_considered(DnfSack *sack)
priv->considered_uptodate = TRUE;
}

static void
queue_di(Pool *pool, Queue *queue, const char *str, int di_key, int flags)
{
Dataiterator di;
int di_flags = SEARCH_STRING;

if (flags & HY_ICASE)
di_flags |= SEARCH_NOCASE;
if (flags & HY_GLOB)
di_flags |= SEARCH_GLOB;

dataiterator_init(&di, pool, 0, 0, di_key, str, di_flags);
while (dataiterator_step(&di))
if (is_package(pool, pool_id2solvable(pool, di.solvid)))
queue_push(queue, di.solvid);
dataiterator_free(&di);
return;
}

static void
queue_pkg_name(DnfSack *sack, Queue *queue, const char *provide, int flags)
{
Pool *pool = dnf_sack_get_pool(sack);
if (!flags) {
Id id = pool_str2id(pool, provide, 0);
if (id == 0)
return;
Id p, pp;
FOR_PKG_PROVIDES(p, pp, id) {
Solvable *s = pool_id2solvable(pool, p);
if (s->name == id)
queue_push(queue, p);
}
return;
}

queue_di(pool, queue, provide, SOLVABLE_NAME, flags);
return;
}

static void
queue_provides(DnfSack *sack, Queue *queue, const char *provide, int flags)
{
Pool *pool = dnf_sack_get_pool(sack);
if (!flags) {
Id id = pool_str2id(pool, provide, 0);
if (id == 0)
return;
Id p, pp;
FOR_PKG_PROVIDES(p, pp, id)
queue_push(queue, p);
return;
}

queue_di(pool, queue, provide, SOLVABLE_PROVIDES, flags);
return;
}

static void
queue_filter_version(DnfSack *sack, Queue *queue, const char *version)
{
Pool *pool = dnf_sack_get_pool(sack);
int j = 0;
for (int i = 0; i < queue->count; ++i) {
Id p = queue->elements[i];
Solvable *s = pool_id2solvable(pool, p);
char *e, *v, *r;
const char *evr = pool_id2str(pool, s->evr);

pool_split_evr(pool, evr, &e, &v, &r);
if (!strcmp(v, version))
queue->elements[j++] = p;
}
queue_truncate(queue, j);
}

static gboolean
load_ext(DnfSack *sack, HyRepo hrepo, _hy_repo_repodata which_repodata,
const char *suffix, int which_filename,
Expand Down

0 comments on commit 8457669

Please sign in to comment.