Discussion:
[Sisuite-devel] [PATCH] Fix --unit % in si_prepareclient using parted
Greg Fiumara
2009-07-17 13:36:48 UTC
Permalink
parted 1.8.1 (perhaps older versions as well) place a space before the
partition number when printing partitions. As such, the current
regular expression will never set $end_of_last_partition_on_disk to a
non-zero value, resulting in a perl illegal division by zero error
when running `si_prepareclient' with the `--unit %' switch. This
patch simply allows there to be whitespace before the first digit.
Patch applied to SystemImager 4.1.6.

$ svn diff
Index: lib/SystemImager/Common.pm
===================================================================
--- lib/SystemImager/Common.pm (revision 4469)
+++ lib/SystemImager/Common.pm (working copy)
@@ -504,7 +504,7 @@
#
my $end_of_last_partition_on_disk = 0;
foreach (@partition_tool_output) {
- if (/^\d+\s+/) {
+ if (/^\s*\d+\s+/) {

my($minor_junk, $start_junk,
$end_of_this_partition) = split;
--
Greg Fiumara
(301) 975-3891
Image Group - NIST
***@nist.gov
Loading...