- local = _alpm_db_get_pkgfromcache(db_local, pkgname);
+ local = _alpm_db_get_pkgfromcache(handle->db_local, pkgname);
if(local) {
const char *localpkgname = alpm_pkg_get_name(local);
const char *localpkgver = alpm_pkg_get_version(local);
@@ -83,23 +83,23 @@ int SYMEXPORT alpm_add_pkg(pmpkg_t *pkg)
if(cmp == 0) {
if(trans->flags & PM_TRANS_FLAG_NEEDED) {
/* with the NEEDED flag, packages up to date are not reinstalled */
- _alpm_log(PM_LOG_WARNING, _("%s-%s is up to date -- skipping
"),
+ _alpm_log(handle, PM_LOG_WARNING, _("%s-%s is up to date -- skipping
"),
localpkgname, localpkgver);
return 0;
} else if(!(trans->flags & PM_TRANS_FLAG_DOWNLOADONLY)) {
- _alpm_log(PM_LOG_WARNING, _("%s-%s is up to date -- reinstalling
"),
+ _alpm_log(handle, PM_LOG_WARNING, _("%s-%s is up to date -- reinstalling
"),
localpkgname, localpkgver);
}
} else if(cmp < 0) {
/* local version is newer */
- _alpm_log(PM_LOG_WARNING, _("downgrading package %s (%s => %s)
"),
+ _alpm_log(handle, PM_LOG_WARNING, _("downgrading package %s (%s => %s)
"),
localpkgname, localpkgver, pkgver);
}
}
/* add the package to the transaction */
pkg->reason = PM_PKG_REASON_EXPLICIT;
- _alpm_log(PM_LOG_DEBUG, "adding package %s-%s to the transaction add list
",
+ _alpm_log(handle, PM_LOG_DEBUG, "adding package %s-%s to the transaction add list
",
pkgname, pkgver);
trans->add = alpm_list_add(trans->add, pkg);
@@ -119,10 +119,10 @@ static int perform_extraction(pmhandle_t *handle, struct archive *archive,
ret = archive_read_extract(archive, entry, archive_flags);
if(ret == ARCHIVE_WARN && archive_errno(archive) != ENOSPC) {
/* operation succeeded but a "non-critical" error was encountered */
- _alpm_log(PM_LOG_WARNING, _("warning given when extracting %s (%s)
"),
+ _alpm_log(handle, PM_LOG_WARNING, _("warning given when extracting %s (%s)
"),
origname, archive_error_string(archive));
} else if(ret != ARCHIVE_OK) {
- _alpm_log(PM_LOG_ERROR, _("could not extract %s (%s)
"),
+ _alpm_log(handle, PM_LOG_ERROR, _("could not extract %s (%s)
"),
origname, archive_error_string(archive));
alpm_logaction(handle, "error: could not extract %s (%s)
",
origname, archive_error_string(archive));
@@ -160,7 +160,7 @@ static int extract_single_file(pmhandle_t *handle, struct archive *archive,
} else if(*entryname == '.') {
/* for now, ignore all files starting with '.' that haven't
* already been handled (for future possibilities) */
- _alpm_log(PM_LOG_DEBUG, "skipping extraction of '%s'
", entryname);
+ _alpm_log(handle, PM_LOG_DEBUG, "skipping extraction of '%s'
", entryname);
archive_read_data_skip(archive);
return 0;
} else {
@@ -170,7 +170,7 @@ static int extract_single_file(pmhandle_t *handle, struct archive *archive,
/* if a file is in NoExtract then we never extract it */
if(alpm_list_find_str(handle->noextract, entryname)) {
- _alpm_log(PM_LOG_DEBUG, "%s is in NoExtract, skipping extraction
",
+ _alpm_log(handle, PM_LOG_DEBUG, "%s is in NoExtract, skipping extraction
",
entryname);
alpm_logaction(handle, "note: %s is in NoExtract, skipping extraction
",
entryname);
@@ -209,20 +209,20 @@ static int extract_single_file(pmhandle_t *handle, struct archive *archive,
if(lsbuf.st_mode != entrymode) {
/* if filesystem perms are different than pkg perms, warn user */
mode_t mask = 07777;
- _alpm_log(PM_LOG_WARNING, _("directory permissions differ on %s
"
+ _alpm_log(handle, PM_LOG_WARNING, _("directory permissions differ on %s
"
"filesystem: %o package: %o
"), entryname, lsbuf.st_mode & mask,
entrymode & mask);
alpm_logaction(handle, "warning: directory permissions differ on %s
"
"filesystem: %o package: %o
", entryname, lsbuf.st_mode & mask,
entrymode & mask);
}
- _alpm_log(PM_LOG_DEBUG, "extract: skipping dir extraction of %s
",
+ _alpm_log(handle, PM_LOG_DEBUG, "extract: skipping dir extraction of %s
",
entryname);
archive_read_data_skip(archive);
return 0;
} else {
/* case 10/11: trying to overwrite dir with file/symlink, don't allow it */
- _alpm_log(PM_LOG_ERROR, _("extract: not overwriting dir with file %s
"),
+ _alpm_log(handle, PM_LOG_ERROR, _("extract: not overwriting dir with file %s
"),
entryname);
archive_read_data_skip(archive);
return 1;
@@ -231,20 +231,20 @@ static int extract_single_file(pmhandle_t *handle, struct archive *archive,
/* case 9: existing symlink, dir in package */
if(S_ISDIR(sbuf.st_mode)) {
/* the symlink on FS is to a directory, so we'll use it */
- _alpm_log(PM_LOG_DEBUG, "extract: skipping symlink overwrite of %s
",
+ _alpm_log(handle, PM_LOG_DEBUG, "extract: skipping symlink overwrite of %s
",
entryname);
archive_read_data_skip(archive);
return 0;
} else {
/* this is BAD. symlink was not to a directory */
- _alpm_log(PM_LOG_ERROR, _("extract: symlink %s does not point to dir
"),
+ _alpm_log(handle, PM_LOG_ERROR, _("extract: symlink %s does not point to dir
"),
entryname);
archive_read_data_skip(archive);
return 1;
}
} else if(S_ISREG(lsbuf.st_mode) && S_ISDIR(entrymode)) {
/* case 6: trying to overwrite file with dir */
- _alpm_log(PM_LOG_DEBUG, "extract: overwriting file with dir %s
",
+ _alpm_log(handle, PM_LOG_DEBUG, "extract: overwriting file with dir %s
",
entryname);
} else if(S_ISREG(entrymode)) {
/* case 4,7: */
@@ -318,10 +318,10 @@ static int extract_single_file(pmhandle_t *handle, struct archive *archive,
backups->data = backup;
}
/* move the existing file to the "pacorig" */
if(rename(filename, newpath)) {
- _alpm_log(PM_LOG_ERROR, _("could not rename %s to %s (%s)
"),
+ _alpm_log(handle, PM_LOG_ERROR, _("could not rename %s to %s (%s)
"),
filename, newpath, strerror(errno));
alpm_logaction(handle, "error: could not rename %s to %s (%s)
",
filename, newpath, strerror(errno));
@@ -340,13 +340,13 @@ static int extract_single_file(pmhandle_t *handle, struct archive *archive,
} else {
/* rename the file we extracted to the real name */
if(rename(checkfile, filename)) {
- _alpm_log(PM_LOG_ERROR, _("could not rename %s to %s (%s)
"),
+ _alpm_log(handle, PM_LOG_ERROR, _("could not rename %s to %s (%s)
"),
checkfile, filename, strerror(errno));
alpm_logaction(handle, "error: could not rename %s to %s (%s)
",
checkfile, filename, strerror(errno));
errors++;
} else {
- _alpm_log(PM_LOG_WARNING, _("%s saved as %s
"), filename, newpath);
+ _alpm_log(handle, PM_LOG_WARNING, _("%s saved as %s
"), filename, newpath);
alpm_logaction(handle, "warning: %s saved as %s
", filename, newpath);
}
}
@@ -360,11 +360,11 @@ static int extract_single_file(pmhandle_t *handle, struct archive *archive,
if(strcmp(hash_orig, hash_local) == 0) {
/* installed file has NOT been changed by user */
if(strcmp(hash_orig, hash_pkg) != 0) {
- _alpm_log(PM_LOG_DEBUG, "action: installing new file: %s
",
+ _alpm_log(handle, PM_LOG_DEBUG, "action: installing new file: %s
",
entryname_orig);
if(rename(checkfile, filename)) {
- _alpm_log(PM_LOG_ERROR, _("could not rename %s to %s (%s)
"),
+ _alpm_log(handle, PM_LOG_ERROR, _("could not rename %s to %s (%s)
"),
checkfile, filename, strerror(errno));
alpm_logaction(handle, "error: could not rename %s to %s (%s)
",
checkfile, filename, strerror(errno));
@@ -373,33 +373,33 @@ static int extract_single_file(pmhandle_t *handle, struct archive *archive,
} else {
/* there's no sense in installing the same file twice, install
* ONLY is the original and package hashes differ */
- _alpm_log(PM_LOG_DEBUG, "action: leaving existing file in place
");
+ _alpm_log(handle, PM_LOG_DEBUG, "action: leaving existing file in place
");
unlink(checkfile);
}
} else if(strcmp(hash_orig, hash_pkg) == 0) {
/* originally installed file and new file are the same - this
* implies the case above failed - i.e. the file was changed by a
* user */
- _alpm_log(PM_LOG_DEBUG, "action: leaving existing file in place
");
+ _alpm_log(handle, PM_LOG_DEBUG, "action: leaving existing file in place
");
unlink(checkfile);
} else if(strcmp(hash_local, hash_pkg) == 0) {
/* this would be magical. The above two cases failed, but the
* user changes just so happened to make the new file exactly the
* same as the one in the package... skip it */
- _alpm_log(PM_LOG_DEBUG, "action: leaving existing file in place
");
+ _alpm_log(handle, PM_LOG_DEBUG, "action: leaving existing file in place
");
unlink(checkfile);
} else {
char newpath[PATH_MAX];
- _alpm_log(PM_LOG_DEBUG, "action: keeping current file and installing"
+ _alpm_log(handle, PM_LOG_DEBUG, "action: keeping current file and installing"
" new one with .pacnew ending
");
snprintf(newpath, PATH_MAX, "%s.pacnew", filename);
if(rename(checkfile, newpath)) {
- _alpm_log(PM_LOG_ERROR, _("could not install %s as %s (%s)
"),
+ _alpm_log(handle, PM_LOG_ERROR, _("could not install %s as %s (%s)
"),
filename, newpath, strerror(errno));
alpm_logaction(handle, "error: could not install %s as %s (%s)
",
filename, newpath, strerror(errno));
} else {
- _alpm_log(PM_LOG_WARNING, _("%s installed as %s
"),
+ _alpm_log(handle, PM_LOG_WARNING, _("%s installed as %s
"),
filename, newpath);
alpm_logaction(handle, "warning: %s installed as %s
",
filename, newpath);
@@ -416,12 +416,12 @@ static int extract_single_file(pmhandle_t *handle, struct archive *archive,
/* we didn't need a backup */
if(notouch) {
/* change the path to a .pacnew extension */
- _alpm_log(PM_LOG_DEBUG, "%s is in NoUpgrade -- skipping
", filename);
- _alpm_log(PM_LOG_WARNING, _("extracting %s as %s.pacnew
"), filename, filename);
+ _alpm_log(handle, PM_LOG_DEBUG, "%s is in NoUpgrade -- skipping
", filename);
+ _alpm_log(handle, PM_LOG_WARNING, _("extracting %s as %s.pacnew
"), filename, filename);
alpm_logaction(handle, "warning: extracting %s as %s.pacnew
", filename, filename);
strncat(filename, ".pacnew", PATH_MAX - strlen(filename));
} else {
- _alpm_log(PM_LOG_DEBUG, "extracting %s
", filename);
+ _alpm_log(handle, PM_LOG_DEBUG, "extracting %s
", filename);
}
/* save the cwd so we can restore it later */
if(getcwd(cwd, PATH_MAX) == NULL) {
- _alpm_log(PM_LOG_ERROR, _("could not get current working directory
"));
+ _alpm_log(handle, PM_LOG_ERROR, _("could not get current working directory
"));
} else {
restore_cwd = 1;
}
/* restore the old cwd if we have it */
if(restore_cwd && chdir(cwd) != 0) {
- _alpm_log(PM_LOG_ERROR, _("could not change directory to %s (%s)
"), cwd, strerror(errno));
+ _alpm_log(handle, PM_LOG_ERROR, _("could not change directory to %s (%s)
"), cwd, strerror(errno));
}
if(errors) {
ret = -1;
if(is_upgrade) {
- _alpm_log(PM_LOG_ERROR, _("problem occurred while upgrading %s
"),
+ _alpm_log(handle, PM_LOG_ERROR, _("problem occurred while upgrading %s
"),
newpkg->name);
alpm_logaction(handle, "error: problem occurred while upgrading %s
",
newpkg->name);
} else {
- _alpm_log(PM_LOG_ERROR, _("problem occurred while installing %s
"),
+ _alpm_log(handle, PM_LOG_ERROR, _("problem occurred while installing %s
"),
newpkg->name);
alpm_logaction(handle, "error: problem occurred while installing %s
",
newpkg->name);
@@ -649,11 +649,11 @@ static int commit_single_pkg(pmhandle_t *handle, pmpkg_t *newpkg,
/* make an install date (in UTC) */
newpkg->installdate = time(NULL);
if(info->origin != PKG_FROM_LOCALDB) {
- _alpm_log(PM_LOG_DEBUG,
+ _alpm_log(db->handle, PM_LOG_DEBUG,
"request to read info for a non-local package '%s', skipping...
",
info->name);
return -1;
@@ -468,7 +469,7 @@ int _alpm_local_db_read(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq)
/* already loaded all of this info, do nothing */
return 0;
}
- _alpm_log(PM_LOG_FUNCTION, "loading package data for %s : level=0x%x
",
+ _alpm_log(db->handle, PM_LOG_FUNCTION, "loading package data for %s : level=0x%x
",
info->name, inforeq);
/* clear out 'line', to be certain - and to make valgrind happy */
@@ -478,7 +479,7 @@ int _alpm_local_db_read(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq)
if(access(pkgpath, F_OK)) {
/* directory doesn't exist or can't be opened */
- _alpm_log(PM_LOG_DEBUG, "cannot find '%s-%s' in db '%s'
",
+ _alpm_log(db->handle, PM_LOG_DEBUG, "cannot find '%s-%s' in db '%s'
",
info->name, info->version, db->treename);
goto error;
}
@@ -487,7 +488,7 @@ int _alpm_local_db_read(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq)
if(inforeq & INFRQ_DESC && !(info->infolevel & INFRQ_DESC)) {
snprintf(path, PATH_MAX, "%sdesc", pkgpath);
if((fp = fopen(path, "r")) == NULL) {
- _alpm_log(PM_LOG_ERROR, _("could not open file %s: %s
"), path, strerror(errno));
+ _alpm_log(db->handle, PM_LOG_ERROR, _("could not open file %s: %s
"), path, strerror(errno));
goto error;
}
while(!feof(fp)) {
@@ -500,7 +501,7 @@ int _alpm_local_db_read(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq)
goto error;
}
if(strcmp(_alpm_strtrim(line), info->name) != 0) {
- _alpm_log(PM_LOG_ERROR, _("%s database is inconsistent: name "
+ _alpm_log(db->handle, PM_LOG_ERROR, _("%s database is inconsistent: name "
"mismatch on package %s
"), db->treename, info->name);
}
} else if(strcmp(line, "%VERSION%") == 0) {
@@ -508,7 +509,7 @@ int _alpm_local_db_read(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq)
goto error;
}
if(strcmp(_alpm_strtrim(line), info->version) != 0) {
- _alpm_log(PM_LOG_ERROR, _("%s database is inconsistent: version "
+ _alpm_log(db->handle, PM_LOG_ERROR, _("%s database is inconsistent: version "
"mismatch on package %s
"), db->treename, info->name);
}
} else if(strcmp(line, "%DESC%") == 0) {
@@ -611,7 +612,7 @@ int _alpm_local_db_read(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq)
if(inforeq & INFRQ_FILES && !(info->infolevel & INFRQ_FILES)) {
snprintf(path, PATH_MAX, "%sfiles", pkgpath);
if((fp = fopen(path, "r")) == NULL) {
- _alpm_log(PM_LOG_ERROR, _("could not open file %s: %s
"), path, strerror(errno));
+ _alpm_log(db->handle, PM_LOG_ERROR, _("could not open file %s: %s
"), path, strerror(errno));
goto error;
}
while(fgets(line, sizeof(line), fp)) {
@@ -670,7 +671,7 @@ int _alpm_local_db_prepare(pmdb_t *db, pmpkg_t *info)
pkgpath = get_pkgpath(db, info);
- _alpm_log(PM_LOG_DEBUG, "starting package load for %s
", pkgfile);
+ _alpm_log(handle, PM_LOG_DEBUG, "starting package load for %s
", pkgfile);
/* If full is false, only read through the archive until we find our needed
* metadata. If it is true, read through the entire archive, which serves
@@ -302,17 +302,17 @@ pmpkg_t *_alpm_pkg_load_internal(pmhandle_t *handle, const char *pkgfile,
if(strcmp(entry_name, ".PKGINFO") == 0) {
/* parse the info file */
- if(parse_descfile(archive, newpkg) != 0) {
- _alpm_log(PM_LOG_ERROR, _("could not parse package description file in %s
"),
+ if(parse_descfile(handle, archive, newpkg) != 0) {
+ _alpm_log(handle, PM_LOG_ERROR, _("could not parse package description file in %s
"),
pkgfile);
goto pkg_invalid;
}
if(newpkg->name == NULL || strlen(newpkg->name) == 0) {
- _alpm_log(PM_LOG_ERROR, _("missing package name in %s
"), pkgfile);
+ _alpm_log(handle, PM_LOG_ERROR, _("missing package name in %s
"), pkgfile);
goto pkg_invalid;
}
if(newpkg->version == NULL || strlen(newpkg->version) == 0) {
- _alpm_log(PM_LOG_ERROR, _("missing package version in %s
"), pkgfile);
+ _alpm_log(handle, PM_LOG_ERROR, _("missing package version in %s
"), pkgfile);
goto pkg_invalid;
}
config = 1;
@@ -328,7 +328,7 @@ pmpkg_t *_alpm_pkg_load_internal(pmhandle_t *handle, const char *pkgfile,
}
-/** Adds the pkg1/pkg2 conflict to the baddeps list
- * @param *baddeps list to add conflict to
+/** Adds the pkg1/pkg2 conflict to the baddeps list.
+ * @param handle the context handle
+ * @param baddeps list to add conflict to
* @param pkg1 first package
* @param pkg2 package causing conflict
+ * @param reason reason for this conflict
*/
-static int add_conflict(alpm_list_t **baddeps, const char *pkg1,
- const char *pkg2, const char *reason)
+static int add_conflict(pmhandle_t *handle, alpm_list_t **baddeps,
+ const char *pkg1, const char *pkg2, const char *reason)
{
pmconflict_t *conflict = conflict_new(pkg1, pkg2, reason);
if(!conflict) {
return -1;
}
- _alpm_log(PM_LOG_DEBUG, "package %s conflicts with %s (by %s)
",
+ _alpm_log(handle, PM_LOG_DEBUG, "package %s conflicts with %s (by %s)
",
pkg1, pkg2, reason);
if(!conflict_isin(conflict, *baddeps)) {
*baddeps = alpm_list_add(*baddeps, conflict);
@@ -121,14 +123,16 @@ static int add_conflict(alpm_list_t **baddeps, const char *pkg1,
* If a conflict (pkg1, pkg2) is found, it is added to the baddeps list
* in this order if order >= 0, or reverse order (pkg2,pkg1) otherwise.
*
+ * @param handle the context handle
* @param list1 first list of packages
* @param list2 second list of packages
- * @param *baddeps list to store conflicts
+ * @param baddeps list to store conflicts
* @param order if >= 0 the conflict order is preserved, if < 0 it's reversed
*/
-static void check_conflict(alpm_list_t *list1, alpm_list_t *list2,
+static void check_conflict(pmhandle_t *handle,
+ alpm_list_t *list1, alpm_list_t *list2,
alpm_list_t **baddeps, int order) {
- alpm_list_t *i, *j, *k;
+ alpm_list_t *i;
/* two checks to be done here for conflicts */
- _alpm_log(PM_LOG_DEBUG, "check targets vs db
");
- check_conflict(packages, dblist, &baddeps, 1);
- _alpm_log(PM_LOG_DEBUG, "check db vs targets
");
- check_conflict(dblist, packages, &baddeps, -1);
+ _alpm_log(db->handle, PM_LOG_DEBUG, "check targets vs db
");
+ check_conflict(db->handle, packages, dblist, &baddeps, 1);
+ _alpm_log(db->handle, PM_LOG_DEBUG, "check db vs targets
");
+ check_conflict(db->handle, dblist, packages, &baddeps, -1);
/* CHECK 2: check every target against the filesystem */
- _alpm_log(PM_LOG_DEBUG, "searching for filesystem conflicts: %s
", p1->name);
+ _alpm_log(handle, PM_LOG_DEBUG, "searching for filesystem conflicts: %s
", p1->name);
dbpkg = _alpm_db_get_pkgfromcache(handle->db_local, p1->name);
/* Do two different checks here. If the package is currently installed,
@@ -439,15 +446,15 @@ alpm_list_t *_alpm_db_find_fileconflicts(pmhandle_t *handle,
if(path[strlen(path)-1] == '/') {
if(S_ISDIR(lsbuf.st_mode)) {
- _alpm_log(PM_LOG_DEBUG, "%s is a directory, not a conflict
", path);
+ _alpm_log(handle, PM_LOG_DEBUG, "%s is a directory, not a conflict
", path);
continue;
} else if(S_ISLNK(lsbuf.st_mode) && S_ISDIR(sbuf.st_mode)) {
- _alpm_log(PM_LOG_DEBUG,
+ _alpm_log(handle, PM_LOG_DEBUG,
"%s is a symlink to a dir, hopefully not a conflict
", path);
continue;
}
}
- _alpm_log(PM_LOG_DEBUG, "checking possible conflict: %s
", path);
+ _alpm_log(handle, PM_LOG_DEBUG, "checking possible conflict: %s
", path);
int resolved_conflict = 0; /* have we acted on this conflict? */
@@ -455,7 +462,7 @@ alpm_list_t *_alpm_db_find_fileconflicts(pmhandle_t *handle,
for(k = remove; k && !resolved_conflict; k = k->next) {
pmpkg_t *rempkg = k->data;
if(rempkg && alpm_list_find_str(alpm_pkg_get_files(rempkg), filestr)) {
- _alpm_log(PM_LOG_DEBUG, "local file will be removed, not a conflict: %s
", filestr);
+ _alpm_log(handle, PM_LOG_DEBUG, "local file will be removed, not a conflict: %s
", filestr);
resolved_conflict = 1;
}
}
@@ -475,7 +482,7 @@ alpm_list_t *_alpm_db_find_fileconflicts(pmhandle_t *handle,
* by its new owner (whether the file is in backup array or not */
handle->trans->skip_remove =
alpm_list_add(handle->trans->skip_remove, strdup(filestr));
- _alpm_log(PM_LOG_DEBUG, "file changed packages, adding to remove skiplist: %s
", filestr);
+ _alpm_log(handle, PM_LOG_DEBUG, "file changed packages, adding to remove skiplist: %s
", filestr);
resolved_conflict = 1;
}
}
@@ -485,7 +492,7 @@ alpm_list_t *_alpm_db_find_fileconflicts(pmhandle_t *handle,
char *dir = malloc(strlen(filestr) + 2);
sprintf(dir, "%s/", filestr);
if(alpm_list_find_str(alpm_pkg_get_files(dbpkg),di r)) {
- _alpm_log(PM_LOG_DEBUG, "check if all files in %s belongs to %s
",
+ _alpm_log(handle, PM_LOG_DEBUG, "check if all files in %s belongs to %s
",
dir, dbpkg->name);
resolved_conflict = dir_belongsto_pkg(handle->root, filestr, dbpkg);
}
@@ -506,8 +513,7 @@ alpm_list_t *_alpm_db_find_fileconflicts(pmhandle_t *handle,
}
/* hmmm, still NULL ?*/
if(!db->pkgcache) {
- _alpm_log(PM_LOG_DEBUG, "warning: pkgcache is NULL for db '%s'
", db->treename);
+ _alpm_log(db->handle, PM_LOG_DEBUG, "warning: pkgcache is NULL for db '%s'
", db->treename);
}
db->pkgcache = _alpm_pkghash_remove(db->pkgcache, pkg, &data);
if(data == NULL) {
/* package not found */
- _alpm_log(PM_LOG_DEBUG, "cannot remove entry '%s' from '%s' cache: not found
",
+ _alpm_log(db->handle, PM_LOG_DEBUG, "cannot remove entry '%s' from '%s' cache: not found
",
alpm_pkg_get_name(pkg), db->treename);
return -1;
}
@@ -588,7 +584,7 @@ pmpkg_t *_alpm_db_get_pkgfromcache(pmdb_t *db, const char *target)
pmpkghash_t *pkgcache = _alpm_db_get_pkgcache_hash(db);
if(!pkgcache) {
- _alpm_log(PM_LOG_DEBUG, "warning: failed to get '%s' from NULL pkgcache
",
+ _alpm_log(db->handle, PM_LOG_DEBUG, "warning: failed to get '%s' from NULL pkgcache
",
target);
return NULL;
}
@@ -606,7 +602,7 @@ int _alpm_db_load_grpcache(pmdb_t *db)
return -1;
}
- _alpm_log(PM_LOG_DEBUG, "loading group cache for repository '%s'
",
+ _alpm_log(db->handle, PM_LOG_DEBUG, "loading group cache for repository '%s'
",
db->treename);
- _alpm_log(PM_LOG_DEBUG, "freeing group cache for repository '%s'
",
+ _alpm_log(db->handle, PM_LOG_DEBUG, "freeing group cache for repository '%s'
",
db->treename);