Skip to content
This repository was archived by the owner on Apr 16, 2021. It is now read-only.

Update mbed-os-to-arduino script - #56

Open
bissonex wants to merge 1 commit into
arduino:masterfrom
bissonex:fix_mbed_os_to_arduino_script_for_macos
Open

Update mbed-os-to-arduino script#56
bissonex wants to merge 1 commit into
arduino:masterfrom
bissonex:fix_mbed_os_to_arduino_script_for_macos

Conversation

@bissonex

Copy link
Copy Markdown

Add support for macOS platform to mbed_os_to_arduino script

Add support for macOS platform to mbed_os_to_arduino script
@facchinm

Copy link
Copy Markdown
Member

@manchoz wasn't the original version already working on macOS without GNU tools? Maybe only a particular version of the OS?

@manchoz

manchoz commented Feb 26, 2020

Copy link
Copy Markdown
Member

Yes, there's been introduced a regression at some point due to a text formatting change which is preventing standard MacOS' sed to work properly.

I will PR to revert ASAP.

@manchoz

manchoz commented Feb 26, 2020

Copy link
Copy Markdown
Member

Here's the PR #57

@facchinm

Copy link
Copy Markdown
Member

Hi @bissonex , can you test #57 and report if it works on OSX? It would be better to not need gnu sed as a prerequisite

@bissonex

bissonex commented Feb 29, 2020

Copy link
Copy Markdown
Author

Hi @facchinm, I can confirm that #57 is fixing the issue with sed. Please note that the check_tools() function is still not working under macOS 10.15.3. And that a check for tac must also be added. On macOS like on many systems (BSDs, Solaris, AIX, IRIX...), the functionality of GNU tac is available in tail with the -r option.

@manchoz

manchoz commented Mar 2, 2020

Copy link
Copy Markdown
Member

I think we can substitute tac with a classic sed one-liner: sed '1!G;h;$!d'.

@bissonex what is not working with check_tools()? I also have macOS 10.15.3 and it's working properly AFAICS. Could you, please, attach a log (running the tool with bash -x)? Thanks!

@bissonex

bissonex commented Mar 2, 2020

Copy link
Copy Markdown
Author

I am setting up check_tools() to fail by changing tool name from jq to jq_should_not_found:

check_tools () {
	echo -n "Checking for prerequisites..."
	if not hash jq_should_not_found &>/dev/null ; then
		echo "Please, install jq."
		exit 1
	fi

	if not hash rsync &>/dev/null ; then
		echo "Please, install rsync."
		exit 1
	fi
	echo " done."
}

output from tool:

+ echo -n 'Checking for prerequisites...'
Checking for prerequisites...
+ not hash jq_should_not_found
+ not hash rsync
+ echo ' done.'

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants