installer: Clean up check_capacity() (UFS) a bit and improve the message.
authorSascha Wildner <saw@online.de>
Fri, 1 Oct 2010 01:12:15 +0000 (03:12 +0200)
committerSascha Wildner <saw@online.de>
Wed, 6 Oct 2010 18:25:29 +0000 (20:25 +0200)
usr.sbin/installer/dfuibe_installer/fn_subpart_ufs.c

index a8b68d7..ebda498 100644 (file)
@@ -277,19 +277,24 @@ check_capacity(struct i_fn_args *a)
 
        for (sp = slice_subpartition_first(storage_get_selected_slice(a->s));
             sp != NULL; sp = subpartition_next(sp)) {
-               if (subpartition_get_capacity(sp) == -1)
+               long subpart_capacity = subpartition_get_capacity(sp);
+               const char *mountpt = subpartition_get_mountpoint(sp);
+
+               if (subpart_capacity == -1)
                        total_capacity++;
                else
-                       total_capacity += subpartition_get_capacity(sp);
+                       total_capacity += subpart_capacity;
                for (mtpt = 0; def_mountpt[mtpt] != NULL; mtpt++) {
-                       if (strcmp(subpartition_get_mountpoint(sp), def_mountpt[mtpt]) == 0 &&
+                       if (strcmp(mountpt, def_mountpt[mtpt]) == 0 &&
                            min_capacity[mtpt] > 0 &&
-                           subpartition_get_capacity(sp) < min_capacity[mtpt]) {
-                               inform(a->c, _("WARNING: the %s subpartition should "
-                                   "be at least %dM in size or you will "
+                           subpart_capacity < min_capacity[mtpt]) {
+                               inform(a->c, _("WARNING: The size (%ldM) specified for "
+                                   "the %s subpartition is too small. It "
+                                   "should be at least %ldM or you will "
                                    "risk running out of space during "
                                    "the installation."),
-                                   subpartition_get_mountpoint(sp), min_capacity[mtpt]);
+                                   subpart_capacity, mountpt,
+                                   min_capacity[mtpt]);
                        }
                }
        }