Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib/libalpm/diskspace.c
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-03-20 11:49:42 -0500
committerDan McGee <dan@archlinux.org>2011-03-20 11:49:42 -0500
commitb2fde01c545286bb92f6194603817602bf9dfbe7 (patch)
tree283d93f361b09fa5479bc28db6e649e3732884f7 /lib/libalpm/diskspace.c
parent524b3389746f3ea44042050ba28b975b65e931ad (diff)
parent67c0e9cab39a536f1ca2fbf2a35fe898e3b71ef4 (diff)
Merge branch 'maint'
Diffstat (limited to 'lib/libalpm/diskspace.c')
-rw-r--r--lib/libalpm/diskspace.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/libalpm/diskspace.c b/lib/libalpm/diskspace.c
index 892b1aac..281173a2 100644
--- a/lib/libalpm/diskspace.c
+++ b/lib/libalpm/diskspace.c
@@ -61,7 +61,7 @@ static int mount_point_cmp(const void *p1, const void *p2)
static alpm_list_t *mount_point_list(void)
{
- alpm_list_t *mount_points = NULL;
+ alpm_list_t *mount_points = NULL, *ptr;
alpm_mountpoint_t *mp;
#if defined HAVE_GETMNTENT
@@ -124,6 +124,10 @@ static alpm_list_t *mount_point_list(void)
mount_points = alpm_list_msort(mount_points, alpm_list_count(mount_points),
mount_point_cmp);
+ for(ptr = mount_points; ptr != NULL; ptr = ptr->next) {
+ mp = ptr->data;
+ _alpm_log(PM_LOG_DEBUG, "mountpoint: %s\n", mp->mount_dir);
+ }
return(mount_points);
}
@@ -256,6 +260,7 @@ cleanup:
int _alpm_check_diskspace(pmtrans_t *trans, pmdb_t *db_local)
{
alpm_list_t *mount_points, *i;
+ alpm_mountpoint_t *root_mp;
size_t replaces = 0, current = 0, numtargs;
int abort = 0;
alpm_list_t *targ;
@@ -263,7 +268,13 @@ int _alpm_check_diskspace(pmtrans_t *trans, pmdb_t *db_local)
numtargs = alpm_list_count(trans->add);
mount_points = mount_point_list();
if(mount_points == NULL) {
- _alpm_log(PM_LOG_ERROR, _("could not determine filesystem mount points"));
+ _alpm_log(PM_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(PM_LOG_ERROR, _("could not determine root mount point %s\n"),
+ handle->root);
return(-1);
}