From ca43fdd92f06a6997c53e45bfed6fb27f3044de5 Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Sat, 2 Jul 2011 02:01:38 +1000 Subject: Prefix alpm_loglevel_t members with ALPM Signed-off-by: Allan McRae --- lib/libalpm/diskspace.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'lib/libalpm/diskspace.c') diff --git a/lib/libalpm/diskspace.c b/lib/libalpm/diskspace.c index 7ca72c3c..f0e22a68 100644 --- a/lib/libalpm/diskspace.c +++ b/lib/libalpm/diskspace.c @@ -77,11 +77,11 @@ static alpm_list_t *mount_point_list(alpm_handle_t *handle) while((mnt = getmntent(fp))) { if(!mnt) { - _alpm_log(handle, PM_LOG_WARNING, _("could not get filesystem information\n")); + _alpm_log(handle, ALPM_LOG_WARNING, _("could not get filesystem information\n")); continue; } if(statvfs(mnt->mnt_dir, &fsp) != 0) { - _alpm_log(handle, PM_LOG_WARNING, + _alpm_log(handle, ALPM_LOG_WARNING, _("could not get filesystem information for %s: %s\n"), mnt->mnt_dir, strerror(errno)); continue; @@ -126,7 +126,7 @@ static alpm_list_t *mount_point_list(alpm_handle_t *handle) mount_point_cmp); for(ptr = mount_points; ptr != NULL; ptr = ptr->next) { mp = ptr->data; - _alpm_log(handle, PM_LOG_DEBUG, "mountpoint: %s\n", mp->mount_dir); + _alpm_log(handle, ALPM_LOG_DEBUG, "mountpoint: %s\n", mp->mount_dir); } return mount_points; } @@ -171,7 +171,7 @@ static int calculate_removed_size(alpm_handle_t *handle, mp = match_mount_point(mount_points, path); if(mp == NULL) { - _alpm_log(handle, PM_LOG_WARNING, + _alpm_log(handle, ALPM_LOG_WARNING, _("could not determine mount point for file %s\n"), filename); continue; } @@ -233,7 +233,7 @@ static int calculate_installed_size(alpm_handle_t *handle, mp = match_mount_point(mount_points, path); if(mp == NULL) { - _alpm_log(handle, PM_LOG_WARNING, + _alpm_log(handle, ALPM_LOG_WARNING, _("could not determine mount point for file %s\n"), filename); continue; } @@ -244,7 +244,7 @@ static int calculate_installed_size(alpm_handle_t *handle, mp->used |= USED_INSTALL; if(archive_read_data_skip(archive)) { - _alpm_log(handle, PM_LOG_ERROR, _("error while reading package %s: %s\n"), + _alpm_log(handle, ALPM_LOG_ERROR, _("error while reading package %s: %s\n"), pkg->name, archive_error_string(archive)); handle->pm_errno = PM_ERR_LIBARCHIVE; break; @@ -269,12 +269,12 @@ int _alpm_check_diskspace(alpm_handle_t *handle) numtargs = alpm_list_count(trans->add); mount_points = mount_point_list(handle); if(mount_points == NULL) { - _alpm_log(handle, PM_LOG_ERROR, _("could not determine filesystem mount points\n")); + _alpm_log(handle, ALPM_LOG_ERROR, _("could not determine filesystem mount points\n")); return -1; } root_mp = match_mount_point(mount_points, handle->root); if(root_mp == NULL) { - _alpm_log(handle, PM_LOG_ERROR, _("could not determine root mount point %s\n"), + _alpm_log(handle, ALPM_LOG_ERROR, _("could not determine root mount point %s\n"), handle->root); return -1; } @@ -321,7 +321,7 @@ int _alpm_check_diskspace(alpm_handle_t *handle) for(i = mount_points; i; i = alpm_list_next(i)) { alpm_mountpoint_t *data = i->data; if(data->used && data->read_only) { - _alpm_log(handle, PM_LOG_ERROR, _("Partition %s is mounted read only\n"), + _alpm_log(handle, ALPM_LOG_ERROR, _("Partition %s is mounted read only\n"), data->mount_dir); error = 1; } else if(data->used & USED_INSTALL) { @@ -330,12 +330,12 @@ int _alpm_check_diskspace(alpm_handle_t *handle) long twentymb = (20 * 1024 * 1024 / (long)data->fsp.f_bsize) + 1; long cushion = fivepc < twentymb ? fivepc : twentymb; - _alpm_log(handle, PM_LOG_DEBUG, "partition %s, needed %ld, cushion %ld, free %ld\n", + _alpm_log(handle, ALPM_LOG_DEBUG, "partition %s, needed %ld, cushion %ld, free %ld\n", data->mount_dir, data->max_blocks_needed, cushion, (unsigned long)data->fsp.f_bfree); if(data->max_blocks_needed + cushion >= 0 && (unsigned long)(data->max_blocks_needed + cushion) > data->fsp.f_bfree) { - _alpm_log(handle, PM_LOG_ERROR, _("Partition %s too full: %ld blocks needed, %ld blocks free\n"), + _alpm_log(handle, ALPM_LOG_ERROR, _("Partition %s too full: %ld blocks needed, %ld blocks free\n"), data->mount_dir, data->max_blocks_needed + cushion, (unsigned long)data->fsp.f_bfree); error = 1; -- cgit v1.2.3-24-g4f1b From bd88a8d5511c24db55dd2a5c04161918571dbfbd Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Sat, 2 Jul 2011 02:01:39 +1000 Subject: Prefix alpm_transprog_t members with ALPM Signed-off-by: Allan McRae --- lib/libalpm/diskspace.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/libalpm/diskspace.c') diff --git a/lib/libalpm/diskspace.c b/lib/libalpm/diskspace.c index f0e22a68..0ce4332d 100644 --- a/lib/libalpm/diskspace.c +++ b/lib/libalpm/diskspace.c @@ -285,7 +285,7 @@ int _alpm_check_diskspace(alpm_handle_t *handle) for(targ = trans->remove; targ; targ = targ->next, current++) { alpm_pkg_t *local_pkg; int percent = (current * 100) / numtargs; - PROGRESS(trans, PM_TRANS_PROGRESS_DISKSPACE_START, "", percent, + PROGRESS(trans, ALPM_TRANS_PROGRESS_DISKSPACE_START, "", percent, numtargs, current); local_pkg = targ->data; @@ -296,7 +296,7 @@ int _alpm_check_diskspace(alpm_handle_t *handle) for(targ = trans->add; targ; targ = targ->next, current++) { alpm_pkg_t *pkg, *local_pkg; int percent = (current * 100) / numtargs; - PROGRESS(trans, PM_TRANS_PROGRESS_DISKSPACE_START, "", percent, + PROGRESS(trans, ALPM_TRANS_PROGRESS_DISKSPACE_START, "", percent, numtargs, current); pkg = targ->data; @@ -315,7 +315,7 @@ int _alpm_check_diskspace(alpm_handle_t *handle) } } - PROGRESS(trans, PM_TRANS_PROGRESS_DISKSPACE_START, "", 100, + PROGRESS(trans, ALPM_TRANS_PROGRESS_DISKSPACE_START, "", 100, numtargs, current); for(i = mount_points; i; i = alpm_list_next(i)) { -- cgit v1.2.3-24-g4f1b From afc96f2ab3d05f14a73e81f871164f01423b5572 Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Sat, 2 Jul 2011 02:01:39 +1000 Subject: Prefix _alpm_errno_t members with ALPM Signed-off-by: Allan McRae --- lib/libalpm/diskspace.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'lib/libalpm/diskspace.c') diff --git a/lib/libalpm/diskspace.c b/lib/libalpm/diskspace.c index 0ce4332d..52364a0e 100644 --- a/lib/libalpm/diskspace.c +++ b/lib/libalpm/diskspace.c @@ -87,7 +87,7 @@ static alpm_list_t *mount_point_list(alpm_handle_t *handle) continue; } - CALLOC(mp, 1, sizeof(alpm_mountpoint_t), RET_ERR(handle, PM_ERR_MEMORY, NULL)); + CALLOC(mp, 1, sizeof(alpm_mountpoint_t), RET_ERR(handle, ALPM_ERR_MEMORY, NULL)); mp->mount_dir = strdup(mnt->mnt_dir); mp->mount_dir_len = strlen(mp->mount_dir); memcpy(&(mp->fsp), &fsp, sizeof(struct statvfs)); @@ -108,7 +108,7 @@ static alpm_list_t *mount_point_list(alpm_handle_t *handle) } for(; entries-- > 0; fsp++) { - CALLOC(mp, 1, sizeof(alpm_mountpoint_t), RET_ERR(PM_ERR_MEMORY, NULL)); + CALLOC(mp, 1, sizeof(alpm_mountpoint_t), RET_ERR(ALPM_ERR_MEMORY, NULL)); mp->mount_dir = strdup(fsp->f_mntonname); mp->mount_dir_len = strlen(mp->mount_dir); memcpy(&(mp->fsp), fsp, sizeof(FSSTATSTYPE)); @@ -193,7 +193,7 @@ static int calculate_installed_size(alpm_handle_t *handle, struct archive_entry *entry; if((archive = archive_read_new()) == NULL) { - handle->pm_errno = PM_ERR_LIBARCHIVE; + handle->pm_errno = ALPM_ERR_LIBARCHIVE; ret = -1; goto cleanup; } @@ -203,7 +203,7 @@ static int calculate_installed_size(alpm_handle_t *handle, if(archive_read_open_filename(archive, pkg->origin_data.file, ARCHIVE_DEFAULT_BYTES_PER_BLOCK) != ARCHIVE_OK) { - handle->pm_errno = PM_ERR_PKG_OPEN; + handle->pm_errno = ALPM_ERR_PKG_OPEN; ret = -1; goto cleanup; } @@ -246,7 +246,7 @@ static int calculate_installed_size(alpm_handle_t *handle, if(archive_read_data_skip(archive)) { _alpm_log(handle, ALPM_LOG_ERROR, _("error while reading package %s: %s\n"), pkg->name, archive_error_string(archive)); - handle->pm_errno = PM_ERR_LIBARCHIVE; + handle->pm_errno = ALPM_ERR_LIBARCHIVE; break; } } @@ -350,7 +350,7 @@ int _alpm_check_diskspace(alpm_handle_t *handle) FREELIST(mount_points); if(error) { - RET_ERR(handle, PM_ERR_DISK_SPACE, -1); + RET_ERR(handle, ALPM_ERR_DISK_SPACE, -1); } return 0; -- cgit v1.2.3-24-g4f1b