fix: unused partition version

This commit is contained in:
Peter Šurda 2021-02-28 10:06:46 +01:00
parent 0b1e670d88
commit ded9b60bf7
Signed by: PeterSurda
GPG Key ID: 0C5F50C0B5F37D87
2 changed files with 3 additions and 2 deletions

View File

@ -79,7 +79,7 @@ function version_from_partnum
local partnum="$2"
version="$(parted -m "$drive" -- print|awk -F: \
-v partnum="$partnum" \
'{if (NR > 2 && $1 == partnum && $1 >= 2 && $1 <= 4 &&
'{if (NR > 2 && $1 == partnum &&
$6 != "root unused") {
print $6
}}')"

View File

@ -25,7 +25,8 @@ function test_partitioning()
find_unused "$img"
assertEquals "find_unused" 3 "$unused"
assertEquals "version_from_partnum unused" "" "$unused"
version_from_partnum "$img" 3
assertEquals "version_from_partnum unused" "" "$version"
rename_partition "$img" 3 "root $min_version"
find_oldest "$img"