Why wrap export values in parentheses?

38 views
Skip to first unread message

ow...@ostephens.com

unread,
Oct 12, 2022, 5:05:38 AM10/12/22
to OpenRefine Development
This PR a while ago https://github.com/OpenRefine/OpenRefine/pull/2401/files included a change to how environment variables were set based on loading data from a source (usually refine.ini).

Originally it was
cat $1 | egrep "^[A-Z]" | sed 's/^\(.*\)$/export \1/' > ${TEMP_CONFIG}
and it was changed to
cat $1 | egrep "^[A-Z]" | sed 's/^\([^=]*\)=\(.*\)$/export \1=(\2)/' > ${TEMP_CONFIG}

So previously the line in refine.ini like:
REFINE_MEMORY=1400M
would have resulted in
export REFINE_MEMORY=1400M
but after the change it results in
export REFINE_MEMORY=(1400M)

What's the reason for wrapping the value in parentheses here?
I ask because since this change when I run the Linux version on Mac (which I know isn't really supported, but has always worked and I prefer as it's more straightforward for troubleshooting than the Mac version), setting the environment variables doesn't work. 

It's not a big issue (it's possible to set the relevant information either by editing the `refine` script directly or by setting options on the command line) but after finally taking the time to work out what had changed I was interested in what the reason for the change was?

Thanks for any insight

Owen

Antonin Delpeuch (lists)

unread,
Oct 13, 2022, 12:17:52 PM10/13/22
to openref...@googlegroups.com

Hi Owen,

The motivation for the change is described in the corresponding issue:

https://github.com/OpenRefine/OpenRefine/issues/2396

Perhaps MacOS uses a different quote character in this context? Potentially, we could add support for that as well.

I do think it is worth making sure OpenRefine can be run using the `refine` script on MacOS - any developer will need that.

Best,

Antonin

--
You received this message because you are subscribed to the Google Groups "OpenRefine Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openrefine-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openrefine-dev/490f6fdf-cb35-4873-8d3e-6887502d66d7n%40googlegroups.com.

ow...@ostephens.com

unread,
Oct 14, 2022, 3:47:47 AM10/14/22
to OpenRefine Development
Thanks Antonin - I'll raise a github issue and see if we can find our way to a solution there...

Owen
Reply all
Reply to author
Forward
0 new messages