Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] line 1619 syntax error #410

Closed
mrmte opened this issue Jun 27, 2023 · 4 comments
Closed

[BUG] line 1619 syntax error #410

mrmte opened this issue Jun 27, 2023 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@mrmte
Copy link

mrmte commented Jun 27, 2023

Describe the bug
/Library/Management/erase-install/erase-install.sh: line 1619: [[: 4.1: syntax error: invalid arithmetic operator (error token is ".1")
machines are upgrading ok, its just that it has this error in the script on all machines on what I can see
To Reproduce
using the jam launcher script in the policy
$4=--current-user
$5=--reinstall
$6=--version=13.4.1
$7=--check-power
$8=--no-fs
$9=--rebootdelay 300
$10=--cleanup-after-use

Expected behavior
upgrade without that error in the logs

Code/log output
will have to built up a machine without the cleanup to get the logs

Screenshots
Screenshot 2023-06-27 at 21 15 23

Environment (please complete the following information):

  • OS version Macs were on 13.4,13.3.1
  • erase-install version [e.g. 29.2] - please upgrade to the latest version before submitting a bug report.

Additional context
Add any other context about the problem here.

@mrmte mrmte added the bug Something isn't working label Jun 27, 2023
@mrmte
Copy link
Author

mrmte commented Jun 27, 2023

erase-install.txt

uploaded log and stopped it before it did the full download on a test machine running 13.4

@grahampugh
Copy link
Owner

Can confirm the bug when specifying a version with three parts, e.g. 13.4.1. I'll aim to address in 30.0.

grahampugh added a commit that referenced this issue Jun 27, 2023
@mrmte
Copy link
Author

mrmte commented Jun 28, 2023

if it helps i had to do something similar with something. Its not great but it solves the issue.

FULL_OS_REQUIRED="$8"
OS_MAJOR_REQUIRED=$(echo "$FULL_OS_REQUIRED" | awk -F'.' '{print $1}')

# This is to handle the os minor. Without this then for example an os on 13.3.1 and full os required is 13.4 then this would fail on a greater than comparision. 
# This changes 13.4 to essentially 13.4.0 for the calculations to work!
QUERY_OS_MINOR_REQUIRED=$(echo "$FULL_OS_REQUIRED" | awk -F'.' '{print $3}')
if [ "$QUERY_OS_MINOR_REQUIRED" = "" ]; then
        OS_MINOR_REQUIRED=$(echo "$FULL_OS_REQUIRED" | awk -F'.' '{print $2}')0
else
        OS_MINOR_REQUIRED=$(echo "$FULL_OS_REQUIRED" | awk -F'.' '{print $2$3}')
        
fi

@grahampugh
Copy link
Owner

@mrmte I already pushed what I hope is a fix. I used cut instead of awk, but more-or-less the same :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants