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
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bissonex
Copy link

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
Member

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

@manchoz
Copy link
Contributor

manchoz commented Feb 26, 2020

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
Copy link
Contributor

manchoz commented Feb 26, 2020

Here's the PR #57

@facchinm
Copy link
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
Copy link
Author

bissonex commented Feb 29, 2020

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
Copy link
Contributor

manchoz commented Mar 2, 2020

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
Copy link
Author

bissonex commented Mar 2, 2020

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

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