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

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