-
Notifications
You must be signed in to change notification settings - Fork 233
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
Replace env var crunching with neat xargs trick #194
Comments
This is a neat trick too: https://stackoverflow.com/a/30969768 Might be relevant! |
The file pointed too has since changed quite a lot. I'll try to get a reference as to the one you were mentioning 6+ years ago. Edit: https://github.com/kerl/kerl/blob/1.4.2/kerl#L51-L138 (?) Edit: the trick @sanmiguel references, though, has already gone through multiple iterations, too... |
I could simplify it via act_on_kerl_cfgs() {
# $1: action - cache | restore (default)
for _KERL_CFG in ${_KERL_CFGS_AUX}; do
if [ $1 == cache ]; then
eval "_KERL_CFG_VAR=\$${_KERL_CFG}"
eval "_KERL_TARGET_VAR=__${_KERL_CFG}"
elif [ $1 == restore ]; then
eval "_KERL_CFG_VAR=\$__${_KERL_CFG}"
eval "_KERL_TARGET_VAR=${_KERL_CFG}"
fi
if [ -n "${_KERL_CFG_VAR}" ]; then
eval "$_KERL_TARGET_VAR=$_KERL_CFG_VAR"
fi
done
} instead of hand-picked variable names we save them with a _KERL_CFGS="\
OTP_GITHUB_URL=https://github.com/erlang/otp \
KERL_CONFIGURE_OPTIONS= \
KERL_CONFIGURE_APPLICATIONS= \
KERL_CONFIGURE_DISABLE_APPLICATIONS= \
KERL_SASL_STARTUP= \
KERL_DEPLOY_SSH_OPTIONS= \
KERL_DEPLOY_RSYNC_OPTIONS= \
KERL_INSTALL_MANPAGES= \
KERL_INSTALL_HTMLDOCS= \
KERL_BUILD_PLT= \
KERL_BUILD_DOCS= \
KERL_DOC_TARGETS=chunks \
KERL_BUILD_BACKEND= \
KERL_RELEASE_TARGET= \
" which hopefully is much simpler to read. I'll pr soon, when the outstanding requests are dealt with. |
Use the trick here: https://gist.github.com/judy2k/7656bfe3b322d669ef75364a46327836
to be able to avoid having to manually touch every single env var in https://github.com/kerl/kerl/blob/master/kerl#L51-L138
The text was updated successfully, but these errors were encountered: