Manjaro Tools

  • Status Unconfirmed
  • Percent Complete
    0%
  • Task Type Bug Report
  • Category manjaro-tools
  • Assigned To No-one
  • Operating System Manjaro
  • Severity Medium
  • Priority Very Low
  • Reported Version 0.14-dev
  • Due in Version Undecided
  • Due Date Undecided
  • Votes
  • Private
Attached to Project: Manjaro Tools
Opened by Pietro Francesco Fontana - 20.04.2017

FS#184 - manjaro-chroot wrong choice number

A user reported in December 2016 (only now I’ve time to dig into it) that manjaro-chroot doesn’t work like expected.

Example:

[root@manjaro manjaro]# manjaro-chroot -a
==> Detected systems:
 --> 0) ManjaroLinux
==> Select system to mount [0-0] :

Here choosing 0 runs nothing, choosing 1 mounts the system and chroot to that correctly.

Reading the code I’ve seen this case statement:

for os in ${os_list[@]};do
[...]
  case $last in
    'efi') count=$((count-1)) ;;
    *) info "$i) $(get_os_name $os)"; i=$((i+1)) ;;
  esac
[...]
done

This way if the script prints 0, it could happen that the 0 element in the array is efi.

I could be wrong but something like this should work:

for os in ${os_list[@]};do
[...]
  case $last in
    'efi') i=$((i+1)) ;;
    *) info "$i) $(get_os_name $os)"; i=$((i+1)) ;;
  esac
[...]
done

The only problem is aesthetic, because it can happens that the list is numbered (1,2,3) or (0,2,3).
Probably a better solution exists.

Loading...

Available keyboard shortcuts

Tasklist

Task Details

Task Editing