From 73b874f1c21f89623f0fc13f5ea0484b4bd02639 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Mon, 3 Apr 2017 14:31:43 +0530 Subject: [PATCH 1/6] parted: Don't warn partition busy in script mode Script mode promises not to ask for input interactively. However, during 'rm' and 'resizepart' operations, then a partition is mounted, parted asks for confirmation on the terminal. Since upon confirmation parted allows the actual operations to proceed allow scripts to do this as well by assuming 'yes' in both the cases. Fixes the following issues: - #22167 - #24215 - lpbug #1270203 Signed-off-by: Sunil Mohan Adapa --- parted/parted.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/parted/parted.c b/parted/parted.c index 7e6c266..27e3615 100644 --- a/parted/parted.c +++ b/parted/parted.c @@ -1549,7 +1549,7 @@ do_resizepart (PedDevice** dev, PedDisk** diskp) if (!command_line_get_partition (_("Partition number?"), disk, &part)) goto error; - if (!_partition_warn_busy (part)) + if (!opt_script_mode && !_partition_warn_busy (part)) goto error; start = part->geom.start; @@ -1597,7 +1597,7 @@ do_rm (PedDevice** dev, PedDisk** diskp) if (!command_line_get_partition (_("Partition number?"), *diskp, &part)) goto error; - if (!_partition_warn_busy (part)) + if (!opt_script_mode && !_partition_warn_busy (part)) goto error; ped_disk_delete_partition (*diskp, part); -- 2.11.0