diff --git a/make-align-check-work-in-interactive-mode.patch b/make-align-check-work-in-interactive-mode.patch new file mode 100644 index 0000000..11daf15 --- /dev/null +++ b/make-align-check-work-in-interactive-mode.patch @@ -0,0 +1,40 @@ +Index: parted-2.2/parted/parted.c +=================================================================== +--- parted-2.2.orig/parted/parted.c 2010-05-27 17:34:55.000000000 +0200 ++++ parted-2.2/parted/parted.c 2010-05-27 17:35:27.000000000 +0200 +@@ -2135,18 +2135,29 @@ do_align_check (PedDevice **dev) + { + PedDisk *disk = ped_disk_new (*dev); + if (!disk) +- return 0; ++ goto error; + +- enum AlignmentType align_type; ++ enum AlignmentType align_type = PA_OPTIMUM; + PedPartition *part = NULL; +- bool aligned = +- (command_line_get_align_type (_("alignment type(min/opt)"), &align_type) +- && command_line_get_partition (_("Partition number?"), disk, &part) +- && partition_align_check (disk, part, align_type)); ++ ++ if (!command_line_get_align_type (_("alignment type(min/opt)"), &align_type)) ++ goto error_destroy_disk; ++ if (!command_line_get_partition (_("Partition number?"), disk, &part)) ++ goto error_destroy_disk; ++ ++ bool aligned = partition_align_check (disk, part, align_type); ++ if (!opt_script_mode) ++ printf(aligned ? _("%d aligned\n") : _("%d not aligned\n"), part->num); + + ped_disk_destroy (disk); + ++ /* FIXME: perhaps we should always return 1 when in interactive mode??? */ + return aligned ? 1 : 0; ++ ++error_destroy_disk: ++ ped_disk_destroy (disk); ++error: ++ return 0; + } + + static int diff --git a/parted.changes b/parted.changes index a4b189a..48c2241 100644 --- a/parted.changes +++ b/parted.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu May 27 15:36:51 UTC 2010 - puzel@novell.com + +- add make-align-check-work-in-interactive-mode.patch (bnc#608704) + ------------------------------------------------------------------- Fri Apr 2 08:41:02 UTC 2010 - puzel@novell.com diff --git a/parted.spec b/parted.spec index 31efa84..c819039 100644 --- a/parted.spec +++ b/parted.spec @@ -42,6 +42,8 @@ Patch10: fix-dm-partition-name.patch Patch11: do-not-create-dm-nodes.patch #PATCH-FIX-UPSTREAM parted-remove-experimental-warning.patch Patch12: parted-remove-experimental-warning.patch +#PATCH-FIX-UPSTREAM make-align-check-work-in-interactive-mode.patch bnc#608704 petr.uzel@centrum.cz +Patch13: make-align-check-work-in-interactive-mode.patch Requires: /sbin/udevadm BuildRequires: check-devel @@ -96,6 +98,7 @@ to develop applications that require these. %patch10 -p1 %patch11 -p1 %patch12 -p1 +%patch13 -p1 %build AUTOPOINT=true autoreconf --force --install