Skip to content
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

Merged
merged 1 commit into from
May 4, 2020

Conversation

Flamefire
Copy link
Contributor

  • Use correct paths (stray $HOME instead of $PREFIX)
  • Use bash parameter expansion instead of echo | sed
  • Correct quoting
  • Cleanup archive and folder
  • Reset -e

This script helped me a lot for #3216, so here some improvements for local use.

- Use correct paths (stray $HOME instead of $PREFIX)
- Use bash parameter expansion instead of `echo | sed`
- Correct quoting
- Cleanup archive and folder
- Reset -e
@Flamefire Flamefire force-pushed the fix_install_eb_dep branch from f7dcead to 9fe985a Compare April 30, 2020 16:49

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

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

Copy link
Contributor Author

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

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

Copy link
Contributor Author

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the [[ here?

Copy link
Contributor Author

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

Copy link
Member

@boegel boegel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@akesandgren akesandgren dismissed their stale review May 4, 2020 08:49

Ignoring it for the time being.

Copy link
Contributor

@akesandgren akesandgren left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@akesandgren
Copy link
Contributor

Going in, thanks @Flamefire!

@akesandgren akesandgren merged commit 3b53953 into easybuilders:develop May 4, 2020
@Flamefire Flamefire deleted the fix_install_eb_dep branch May 4, 2020 09:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants