diff options
author | Phillip Susi <psusi@ubuntu.com> | 2013-01-08 19:40:35 -0500 |
---|---|---|
committer | Phillip Susi <psusi@ubuntu.com> | 2014-06-15 15:16:33 -0400 |
commit | 56bfbe21ecca0cb6466c78baed192dc2e5401676 (patch) | |
tree | 0374be475d34d6107dab6f4af3b5de663ba06e94 /parted | |
parent | 360d6277d674c6f92135c8b6bf274c48675ef168 (diff) | |
download | parted-56bfbe21ecca0cb6466c78baed192dc2e5401676.tar.gz |
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.
Diffstat (limited to 'parted')
-rw-r--r-- | parted/parted.c | 16 |
1 files changed, 16 insertions, 0 deletions
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 ( |