Commit 492b09b0 authored by Charles Ferguson's avatar Charles Ferguson
Browse files

Try to fix the usage of sed with fish and the exported variables on OSX.

On OSX there are different limitations, such as not being able to have
empty sub-expressions in the regular expressions passed to sed.
Additionally, having a different version of local::lib installed which
understands fish, and generates the exports differently broke the
automated translater. Working with 'any version' is hard, but I think
we may be nearly there.
parent 25e127e3
......@@ -211,7 +211,7 @@ function install_requirements() {
# to complete.
local still_sorting=true
local iterations=20
while $still_sorting && [ "$iterations" -gt 0 ] ; do
while $still_sorting && [ "$iterations" -gt 0 ] && [ "${#required_defs[@]}" != 0 ] ; do
local -a new_required_defs
......@@ -343,7 +343,7 @@ sed -E "s/^#.*//; /^ *$/d;" "${tmpinput}" \
# Ensure that our environment is set up properly
mkdir -p "${environment}"
eval "$(perl -f -M"local::lib=${environment}")"
eval "$(SHELL=/bin/bash perl -f -M"local::lib=${environment}" 2> /dev/null)"
if [ $? != 0 ] ; then
echo "Failed to create local::lib environment"
exit 1
......@@ -554,12 +554,17 @@ function _perllib_setup
if [ "$var" = 'PATH' ]
eval (sed -E '/^(export |)'$var'=/ ! d;
s/^(export |)'$var'="(.*)"(;|)/set -gx "'$var'" \2/;
s/:/ /g' "$tmpfile")
eval (sed -E '/^(export )?'$var'=/ ! d;
s/export '$var';//g;
s/^(export )?'$var'="(.*)";?/set -gx "'$var'" \2/;
s/:/ /g' "$tmpfile")
eval (sed -E '/^(export |)'$var'=/ ! d;
s/^(export |)'$var'="(.*)"(;|)/set -gx "$var" "\2"/;' "$tmpfile")
eval (sed -E '/^(export )?'$var'=/ ! d;
s/export '$var';//g;
s/^(export )?'$var'="(.*)";?/set -gx "'$var'" "\2"/;
s/:/ /g' "$tmpfile")
rm -f "$tmpfile"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment