(opt_script_mode
? PED_EXCEPTION_CANCEL
: PED_EXCEPTION_YES_NO),
- _("You requested a partition from %s to %s.\n"
+ _("You requested a partition from %s to %s "
+ "(sectors %llu..%llu).\n"
"The closest location we can manage is "
- "%s to %s.%s"),
- start_usr, end_usr, start_sol, end_sol,
+ "%s to %s (sectors %llu..%llu).%s"),
+ start_usr, end_usr,
+ start, end,
+ start_sol, end_sol,
+ part->geom.start, part->geom.end,
(opt_script_mode ? ""
: _("\nIs this still acceptable to you?"))))
{
# Often, when parted cannot use the specified size or start/endpoints
# of a partition, it outputs a warning or error like this:
#
-# Error: You requested a partition from 512B to 50.7kB.
-# The closest location we can manage is 17.4kB to 33.8kB.
+# Error: You requested a partition from 512B to 50.7kB (...).
+# The closest location we can manage is 17.4kB to 33.8kB (...).
#
# But those numbers depend on sector size, so
# replace the specific values with place-holders,
normalize_part_diag_()
{
local file=$1
- sed 's/ [0-9.k]*B to [0-9.k]*B\.$/ X to Y./' $file > $file.t \
+ sed 's/ [0-9.k]*B to [0-9.k]*B (sectors .*$/ X to Y./' $file > $file.t \
&& mv $file.t $file && return 0
return 1
}
|| skip_ "configured without readline support"
# The failure messages.
-cat << EOF > errS || fail=1
-Error: You requested a partition from 512B to 50.7kB.
-The closest location we can manage is 17.4kB to 33.8kB.
+cat << EOF > err.expected || fail=1
+Error: You requested a partition from 512B to 50.7kB (sectors 0..0).
+The closest location we can manage is 17.4kB to 33.8kB (sectors 0..0).
EOF
-normalize_part_diag_ errS || fail=1
+normalize_part_diag_ err.expected || fail=1
{ emit_superuser_warning
- sed s/Error/Warning/ errS
+ sed s/Error/Warning/ err.expected
printf 'Is this still acceptable to you?\nYes/No?'; } >> errI || fail=1
for mkpart in mkpart; do
# Compare the real error and the expected one
normalize_part_diag_ out || fail=1
- compare out errS || fail=1
+ compare out err.expected || fail=1
# Test mkpart interactive mode.
# Create the test file