Skip to content

Commit

Permalink
ci: adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
BevryMe committed Feb 2, 2024
1 parent 9b1301e commit 2ed5a9a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions commands/get-devices
Original file line number Diff line number Diff line change
Expand Up @@ -429,8 +429,8 @@ function get_devices() (
# fetch count
if test "$filesystem" = 'btrfs'; then
count_info="$(sudo-helper -- btrfs filesystem show "$node")"
count="$(rg --only-matching --regexp='Total devices ([0-9]+)' --replace='$1' <<< "$count_info" || :)"
count_available="$(grep --fixed-strings --regexp='devid' <<< "$count_info" | echo-count-lines --stdin || :)"
count="$(rg --only-matching --regexp='Total devices ([0-9]+)' --replace='$1' <<<"$count_info" || :)"
count_available="$(grep --fixed-strings --regexp='devid' <<<"$count_info" | echo-count-lines --stdin || :)"
fi

# check filters
Expand All @@ -446,11 +446,11 @@ function get_devices() (
local result_status=0
if test -n "$count"; then
if test "$count" != "$count_available" || rg --quiet --ignore-case --regexp='(warning|error|missing)'; then
echo-style --error="$node: $count_available/$count devices found" $'\n' "$(echo-lines --indent=$'\t' --stdin <<< "$count_info")" > /dev/stderr
echo-style --error="$node: $count_available/$count devices found" $'\n' "$(echo-lines --indent=$'\t' --stdin <<<"$count_info")" >/dev/stderr
result_status=5 # EIO 5 Input/output error
fi
if test -n "$option_count" -a "$option_label" = "$label" -a "$option_count" != "$count"; then
echo-style --error="$node: $count_available/$count devices found, however we expected $option_count devices" $'\n' "$(echo-lines --indent=$'\t' --stdin <<< "$count_info")" > /dev/stderr
echo-style --error="$node: $count_available/$count devices found, however we expected $option_count devices" $'\n' "$(echo-lines --indent=$'\t' --stdin <<<"$count_info")" >/dev/stderr
result_status=5 # EIO 5 Input/output error
fi
fi
Expand Down
2 changes: 1 addition & 1 deletion commands/mount-helper
Original file line number Diff line number Diff line change
Expand Up @@ -950,7 +950,7 @@ function mount_helper() (
eval_capture --statusvar=temp_status --stdoutvar=temp -- get-devices --quiet --result=node --no-mounted --node="$option_share" --filesystem="$mount_type" --label="$option_label" --count="$option_count"
fi
if test -n "$temp" -a "$option_label"; then
option_share="$(echo-first-line --stdin <<< "$temp")"
option_share="$(echo-first-line --stdin <<<"$temp")"
fi
if test "$temp_status" = 0 -a -n "$temp"; then
echo-style --success='Validated' ' ' --invert="$option_share" ' ' --invert="$mount_type" ' ' --invert="$option_label" ' ' --invert="$option_count"
Expand Down

0 comments on commit 2ed5a9a

Please sign in to comment.