Skip to content

Commit

Permalink
Update to libalpm 4.1 API
Browse files Browse the repository at this point in the history
  • Loading branch information
schuay committed Apr 8, 2013
1 parent fbbccb9 commit d5db39a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/package.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ string Package::deplist2str(alpm_list_t *l, string delim) const
{
string res = "";
for (alpm_list_t *deps = l; deps != NULL; deps = alpm_list_next(deps)) {
alpm_depend_t *depend = (alpm_depend_t *)alpm_list_getdata(deps);
alpm_depend_t *depend = (alpm_depend_t *)deps->data;
res += alpm_dep_compute_string(depend);
if (deps->next != NULL) res += delim;
}
Expand All @@ -115,7 +115,7 @@ string Package::list2str(alpm_list_t *l, string delim) const
{
string s, res = "";
for (alpm_list_t *i = l; i != NULL; i = alpm_list_next(i)) {
s = (char *)alpm_list_getdata(i);
s = (char *)i->data;
if (i != l) res += delim;
res += s;
}
Expand Down
10 changes: 5 additions & 5 deletions src/program.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -394,19 +394,19 @@ void Program::loadpkgs()
vector<string> repos = conf.getrepos();
for (uint i = 0; i < repos.size(); i++) {
/* i'm going to be lazy here and remind myself to handle siglevel properly later on */
alpm_db_register_sync(handle, repos[i].c_str(), ALPM_SIG_USE_DEFAULT);
alpm_register_syncdb(handle, repos[i].c_str(), ALPM_SIG_USE_DEFAULT);
}

alpm_db_t *localdb = alpm_option_get_localdb(handle);
alpm_db_t *localdb = alpm_get_localdb(handle);


/* create our package list */
alpm_list_t *dbs = alpm_list_copy(alpm_option_get_syncdbs(handle));
alpm_list_t *dbs = alpm_list_copy(alpm_get_syncdbs(handle));
dbs = alpm_list_add(dbs, localdb);
for (; dbs; dbs = alpm_list_next(dbs)) {
alpm_db_t *db = (alpm_db_t *)alpm_list_getdata(dbs);
alpm_db_t *db = (alpm_db_t *)dbs->data;
for (alpm_list_t *pkgs = alpm_db_get_pkgcache(db); pkgs; pkgs = alpm_list_next(pkgs)) {
alpm_pkg_t *pkg = (alpm_pkg_t *)alpm_list_getdata(pkgs);
alpm_pkg_t *pkg = (alpm_pkg_t *)pkgs->data;
Package *p = new Package(pkg, localdb);
Package *parray[] = { p };
if (!std::includes(packages.begin(), packages.end(),
Expand Down

0 comments on commit d5db39a

Please sign in to comment.