From owner-svn-src-user@FreeBSD.ORG Mon Jan 17 14:44:17 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 20811106566B; Mon, 17 Jan 2011 14:44:17 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E8F2E8FC0A; Mon, 17 Jan 2011 14:44:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0HEiGSk003250; Mon, 17 Jan 2011 14:44:16 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0HEiGw0003247; Mon, 17 Jan 2011 14:44:16 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201101171444.p0HEiGw0003247@svn.freebsd.org> From: Nathan Whitehorn Date: Mon, 17 Jan 2011 14:44:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217501 - user/nwhitehorn/bsdinstall/partedit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jan 2011 14:44:17 -0000 Author: nwhitehorn Date: Mon Jan 17 14:44:16 2011 New Revision: 217501 URL: http://svn.freebsd.org/changeset/base/217501 Log: Fix adding of sub-partitions to a geom that has been deleted but where the deletion has yet to be committed. Reported by: jh Modified: user/nwhitehorn/bsdinstall/partedit/gpart_ops.c user/nwhitehorn/bsdinstall/partedit/part_wizard.c Modified: user/nwhitehorn/bsdinstall/partedit/gpart_ops.c ============================================================================== --- user/nwhitehorn/bsdinstall/partedit/gpart_ops.c Mon Jan 17 05:45:55 2011 (r217500) +++ user/nwhitehorn/bsdinstall/partedit/gpart_ops.c Mon Jan 17 14:44:16 2011 (r217501) @@ -667,7 +667,15 @@ gpart_create(struct gprovider *pp, char if (geom == NULL && strcmp(pp->lg_geom->lg_class->lg_name, "PART") == 0) geom = pp->lg_geom; - if (geom == NULL) { + /* Now get the partition scheme */ + scheme = NULL; + if (geom != NULL) { + LIST_FOREACH(gc, &geom->lg_config, lg_config) + if (strcmp(gc->lg_name, "scheme") == 0) + scheme = gc->lg_val; + } + + if (geom == NULL || scheme == NULL || strcmp(scheme, "(none)") == 0) { if (gpart_partition(pp->lg_geom->lg_name, NULL) == 0) dialog_msgbox("", "The partition table has been successfully created." @@ -685,11 +693,6 @@ gpart_create(struct gprovider *pp, char if (geom == NULL) return; - /* Now get the partition scheme */ - LIST_FOREACH(gc, &geom->lg_config, lg_config) - if (strcmp(gc->lg_name, "scheme") == 0) - scheme = gc->lg_val; - size = gpart_max_free(geom, &firstfree); if (size <= 0) { dialog_msgbox("Error", "No free space left on device.", 0, 0, Modified: user/nwhitehorn/bsdinstall/partedit/part_wizard.c ============================================================================== --- user/nwhitehorn/bsdinstall/partedit/part_wizard.c Mon Jan 17 05:45:55 2011 (r217500) +++ user/nwhitehorn/bsdinstall/partedit/part_wizard.c Mon Jan 17 14:44:16 2011 (r217501) @@ -188,7 +188,7 @@ query: dialog_vars.no_label = NULL; dialog_vars.defaultno = FALSE; - if (scheme == NULL || choice == 0) { /* Entire disk */ + if (scheme == NULL || strcmp(scheme, "(none)") == 0 || choice == 0) { if (gpart != NULL) { /* Erase partitioned disk */ choice = dialog_yesno("Confirmation", "This will erase " "the disk. Are you sure you want to proceed?", 0, 0);