13386670d0
- libparted: Add support for partition resize - parted: add resizepart command
51 lines
1.5 KiB
Diff
51 lines
1.5 KiB
Diff
From 56bfbe21ecca0cb6466c78baed192dc2e5401676 Mon Sep 17 00:00:00 2001
|
|
From: Phillip Susi <psusi@ubuntu.com>
|
|
Date: Tue, 8 Jan 2013 19:40:35 -0500
|
|
Subject: [PATCH 131/134] parted: Add stub resize command for backward
|
|
compatibility
|
|
|
|
To make sure that older scripts trying to use the resize command do not
|
|
accidentally run the new resizepart command by mistake, this undocumented
|
|
stub command will throw an error if called.
|
|
---
|
|
parted/parted.c | 16 ++++++++++++++++
|
|
1 file changed, 16 insertions(+)
|
|
|
|
diff --git a/parted/parted.c b/parted/parted.c
|
|
index ec9e04e..f27a035 100644
|
|
--- a/parted/parted.c
|
|
+++ b/parted/parted.c
|
|
@@ -1505,6 +1505,16 @@ error:
|
|
}
|
|
|
|
static int
|
|
+do_resize (PedDevice **dev, PedDisk** diskp)
|
|
+{
|
|
+ ped_exception_throw (
|
|
+ PED_EXCEPTION_ERROR,
|
|
+ PED_EXCEPTION_CANCEL,
|
|
+ _("The resize command has been removed in parted 3.0"));
|
|
+ return 0;
|
|
+}
|
|
+
|
|
+static int
|
|
do_resizepart (PedDevice** dev, PedDisk** diskp)
|
|
{
|
|
PedDisk *disk = *diskp;
|
|
@@ -1987,6 +1997,12 @@ NULL),
|
|
str_list_create (_(start_end_msg), NULL), 1));
|
|
|
|
command_register (commands, command_create (
|
|
+ str_list_create_unique ("resize", _("resize"), NULL),
|
|
+ do_resize,
|
|
+ NULL,
|
|
+ str_list_create (_(N_("The resize command was removed in parted 3.0\n")), NULL), 1));
|
|
+
|
|
+command_register (commands, command_create (
|
|
str_list_create_unique ("resizepart", _("resizepart"), NULL),
|
|
do_resizepart,
|
|
str_list_create (
|
|
--
|
|
1.9.3
|
|
|