omniti-labs/omnipitr

sanity-check.sh - tar version error

Closed this issue · 4 comments

After run:

Tar version
Errors:

  • tar (in $PATH) is either not gnu tar, or gnu tar earlier than required 1.20

but my tar is:
LC_ALL=C tar --version 2>/dev/null | head -n 1
tar (GNU tar) 1.27.1

Hi. You're good to go. The bug is related to how version is checked. Will think about proper fix, and when I'll have it - I'll commit and close this issue, but for now you can just use OmniPITR, and it will be fine (version is checked only in sanity check).

The check itself appears flawed to my limited understanding. The awk command seems to be checking that there are more than 1.2 fields in the input string as opposed to the value of the third field being >= 1.20

grep should be sufficient for the test if you use alternation. You want something like
(1.[2-9][0-9]|[2-9].[0-9]|1[0-9].[0-9]).*

  1. version one dot twenty-or-higher (less than 100)
  2. version two-or-higher dot anything (up to version 9.+)
  3. version 10-or-higher dot anything

Once the version is limited the rest of the string doesn't matter so dot-star it. Subsequent dots for sub-versions, like in the example for this issue, will be swallowed by this.

$NF returns the last word from line, and not number of words/fields.

Anyway - committed just now a28c920, which (in my tests) fixes the problem. Please test and let me know.

Works! :-)