lebensterben / awesome-clear-linux

Let's make Clear Linux distribution great
GNU General Public License v3.0
69 stars 20 forks source link

Minor Fix for Pre-Update Script for Version Check #19

Closed ghost closed 3 years ago

ghost commented 3 years ago

Problem

For some reason, the script doesn't like the parameter expansion on the $CURRENT and $LATEST , according to the latest reply on the forum.

Here is a snippet for the error:

pre_update.bash: line 30: s:.:: command not found
pre_update.bash: line 31: s:.:: command not found
pre_update.bash: line 34:  ${CURRENT_ARR[i] >= ${LATEST_ARR[i]}} : bad substitution

Solution

I changed the script so that it reads using IFS, that should make the solution more reliable. (can work across shells?) The pull request is also for checking the first split of the version string. (once nvidia releases >470)

lebensterben commented 3 years ago

oops. I realised that I'm likely writing zsh parameter expansion, not bash's.

ghost commented 3 years ago

That makes sense 😄, i thought it looked odd.

lebensterben commented 3 years ago

just tested this PR and it looks fine. in addition to the zsh expansion I mentioned, I also used zsh's 1-based index. Thanks for your PR.