-
Notifications
You must be signed in to change notification settings - Fork 203
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
Improve install_eb_dep.sh #3314
Conversation
- Use correct paths (stray $HOME instead of $PREFIX) - Use bash parameter expansion instead of `echo | sed` - Correct quoting - Cleanup archive and folder - Reset -e
f7dcead
to
9fe985a
Compare
|
||
CONFIG_OPTIONS= | ||
PRECONFIG_CMD= | ||
|
||
if [ x$PKG_NAME == 'xmodules' ] && [ x$PKG_VERSION == 'x3.2.10' ]; then | ||
if [ "$PKG_NAME" == 'modules' ] && [ "$PKG_VERSION" == '3.2.10' ]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use = and not == for POSIX comformance in all if [ statements comparing strings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The script has a bash shebang and AFAIK == is bash and worked before. Don't really want to change something like that unless you see value in doing so
mkdir -p "${PREFIX}" | ||
if ! wget "${PKG_URL}" && [ -n "$BACKUP_PKG_URL" ]; then | ||
rm -f ./*"${PKG_VERSION}".tar.gz | ||
wget "${BACKUP_PKG_URL}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this fails, should probably bail out. Same for other wget's below
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The script has set -e
which bails out on any error already
if [[ ! -z $PRECONFIG_CMD ]]; then | ||
eval ${PRECONFIG_CMD} | ||
cd "${PKG}" | ||
if [[ -n "$PRECONFIG_CMD" ]]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the [[ here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was there before, didn't change that. Just changed the "not not" to "is" semantic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Going in, thanks @Flamefire! |
echo | sed
This script helped me a lot for #3216, so here some improvements for local use.