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

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