summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorK. Piche <kevin@archlinux.org>2008-04-09 05:14:21 +0200
committerDan McGee <dan@archlinux.org>2008-04-15 00:17:22 +0200
commit9f561370348ce44b2a5453ba63a8bf405c69e6f3 (patch)
tree88844a7c04060cda41ef95af047428d037ab5991 /lib
parentee2bbb39b52e9a62bc295792339ff46e245fad19 (diff)
downloadpacman-9f561370348ce44b2a5453ba63a8bf405c69e6f3.tar.gz
pacman-9f561370348ce44b2a5453ba63a8bf405c69e6f3.tar.xz
add.c: added some tracing and improved some variable locality
Signed-off-by: K. Piche <kevin@archlinux.org> [Dan: removed one logger] Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/libalpm/add.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/libalpm/add.c b/lib/libalpm/add.c
index a0770c51..aadb6e2a 100644
--- a/lib/libalpm/add.c
+++ b/lib/libalpm/add.c
@@ -195,6 +195,9 @@ static int upgrade_remove(pmpkg_t *oldpkg, pmpkg_t *newpkg, pmtrans_t *trans, pm
* with the type PM_TRANS_TYPE_REMOVEUPGRADE. TODO: kill this weird
* behavior. */
pmtrans_t *tr = _alpm_trans_new();
+
+ ALPM_LOG_FUNC;
+
_alpm_log(PM_LOG_DEBUG, "removing old package first (%s-%s)\n",
oldpkg->name, oldpkg->version);
@@ -627,14 +630,13 @@ static int commit_single_pkg(pmpkg_t *newpkg, int pkg_current, int pkg_count,
pmtrans_t *trans, pmdb_t *db)
{
int i, ret = 0, errors = 0;
- struct archive *archive;
- struct archive_entry *entry;
- char cwd[PATH_MAX] = "";
char scriptlet[PATH_MAX+1];
int is_upgrade = 0;
double percent = 0.0;
pmpkg_t *oldpkg = NULL;
+ ALPM_LOG_FUNC;
+
snprintf(scriptlet, PATH_MAX, "%s%s-%s/install", db->path,
alpm_pkg_get_name(newpkg), alpm_pkg_get_version(newpkg));
@@ -687,6 +689,10 @@ static int commit_single_pkg(pmpkg_t *newpkg, int pkg_current, int pkg_count,
}
if(!(trans->flags & PM_TRANS_FLAG_DBONLY)) {
+ struct archive *archive;
+ struct archive_entry *entry;
+ char cwd[PATH_MAX] = "";
+
_alpm_log(PM_LOG_DEBUG, "extracting files\n");
if ((archive = archive_read_new()) == NULL) {
@@ -696,6 +702,7 @@ static int commit_single_pkg(pmpkg_t *newpkg, int pkg_current, int pkg_count,
archive_read_support_compression_all(archive);
archive_read_support_format_all(archive);
+ _alpm_log(PM_LOG_DEBUG, "archive: %s\n", newpkg->origin_data.file);
if(archive_read_open_filename(archive, newpkg->origin_data.file,
ARCHIVE_DEFAULT_BYTES_PER_BLOCK) != ARCHIVE_OK) {
RET_ERR(PM_ERR_PKG_OPEN, -1);