Blame SOURCES/0045-parted-Add-stub-resize-command-for-backward-compatib.patch

fc4a62
From 575b286502bd7338bfeeafbfc5e6ae6718b269f9 Mon Sep 17 00:00:00 2001
fc4a62
From: Phillip Susi <psusi@ubuntu.com>
fc4a62
Date: Tue, 8 Jan 2013 19:40:35 -0500
fc4a62
Subject: [PATCH 45/48] parted: Add stub resize command for backward
fc4a62
 compatibility
fc4a62
fc4a62
To make sure that older scripts trying to use the resize command do not
fc4a62
accidentally run the new resizepart command by mistake, this undocumented
fc4a62
stub command will throw an error if called.
fc4a62
fc4a62
(cherry picked from commit 56bfbe21ecca0cb6466c78baed192dc2e5401676)
fc4a62
fc4a62
Related: rhbz#1423357
fc4a62
---
fc4a62
 parted/parted.c | 24 ++++++++++++++++++++++++
fc4a62
 1 file changed, 24 insertions(+)
fc4a62
fc4a62
diff --git a/parted/parted.c b/parted/parted.c
fc4a62
index 957789a..d4a397b 100644
fc4a62
--- a/parted/parted.c
fc4a62
+++ b/parted/parted.c
fc4a62
@@ -1478,6 +1478,16 @@ error:
fc4a62
 }
fc4a62
 
fc4a62
 static int
fc4a62
+do_resize (PedDevice **dev, PedDisk** diskp)
fc4a62
+{
fc4a62
+        ped_exception_throw (
fc4a62
+                PED_EXCEPTION_ERROR,
fc4a62
+                PED_EXCEPTION_CANCEL,
fc4a62
+                _("The resize command has been removed in parted 3.0"));
fc4a62
+        return 0;
fc4a62
+}
fc4a62
+
fc4a62
+static int
fc4a62
 do_rm (PedDevice** dev)
fc4a62
 {
fc4a62
         PedDisk*                disk;
fc4a62
@@ -1891,6 +1901,20 @@ NULL),
fc4a62
         str_list_create (_(start_end_msg), NULL), 1));
fc4a62
 
fc4a62
 command_register (commands, command_create (
fc4a62
+        str_list_create_unique ("resize", _("resize"), NULL),
fc4a62
+        do_resize,
fc4a62
+        NULL,
fc4a62
+        str_list_create (_(N_("The resize command was removed in parted 3.0\n")), NULL), 1));
fc4a62
+
fc4a62
+command_register (commands, command_create (
fc4a62
+        str_list_create_unique ("resizepart", _("resizepart"), NULL),
fc4a62
+        do_resizepart,
fc4a62
+        str_list_create (
fc4a62
+_("resizepart NUMBER END                    resize partition NUMBER"),
fc4a62
+NULL),
fc4a62
+        str_list_create (_(number_msg), _(end_msg), NULL), 1));
fc4a62
+
fc4a62
+command_register (commands, command_create (
fc4a62
         str_list_create_unique ("rm", _("rm"), NULL),
fc4a62
         do_rm,
fc4a62
         str_list_create (
fc4a62
-- 
fc4a62
2.9.4
fc4a62