]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
partx: document -d vs. --nr and fix test
authorKarel Zak <kzak@redhat.com>
Wed, 21 Aug 2019 11:42:22 +0000 (13:42 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 21 Aug 2019 11:42:22 +0000 (13:42 +0200)
The commit ab025087f91b66ee8e23a16bc49eb0d9bd421d65 has disabled error
message, but unfortunately it keeps wrong return code. This has been fixed
by commit 53ae7d60cfeacd4e87bfe6fcc015b58b78ef4555.

This commit add hit about it to docs and fix regression test too.

Signed-off-by: Karel Zak <kzak@redhat.com>
disk-utils/partx.8
tests/ts/partx/partx

index 223f209185c4e021ac6277c5b8f5450c2f45eea3..d6ff52f086a01da11fc365476070bd461f159735 100644 (file)
@@ -53,7 +53,10 @@ Add the specified partitions, or read the disk and add all partitions.
 Print the SIZE column in bytes rather than in human-readable format.
 .TP
 .BR \-d , " \-\-delete"
-Delete the specified partitions or all partitions.
+Delete the specified partitions or all partitions.  It is not error to
+remove non-existing partitions, so this option is possible to use together with
+large \fB\-\-nr\fR ranges without care about the current partitions set on
+the device.
 .TP
 .BR \-g , " \-\-noheadings"
 Do not print a header line with \fB\-\-show\fR or \fB\-\-raw\fR.
index b21dc44efa57313ad1ffa54a7c8f68bcd7f1efda..84c286a947b1b30581a7e2b1168e10b4fbc89f58 100755 (executable)
@@ -137,9 +137,14 @@ udevadm settle
 ts_init_subtest "delete-non-existent"
 #attempt to remove it again
 {
+       # remove non-existing partitions (ENXIO) is not error
+       #
+       # see ab025087f91b66ee8e23a16bc49eb0d9bd421d65 and
+       #     53ae7d60cfeacd4e87bfe6fcc015b58b78ef4555
+       #
        $TS_CMD_PARTX -d --nr $PARTS $TS_DEVICE &&
-               echo "partx failed: removed non-existing partition" ||
-               echo "partx: OK"
+               echo "partx: OK" ||
+               echo "partx failed: removed non-existing partition"
 } >$TS_OUTPUT 2>&1
 ts_finalize_subtest