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

[cleanup crusade] lint installer script #4164

Closed
wants to merge 1 commit into from
Closed

[cleanup crusade] lint installer script #4164

wants to merge 1 commit into from

Conversation

paulfantom
Copy link
Contributor

@paulfantom paulfantom commented Sep 12, 2018

Ran shellcheck and fix errors. Added some FIXME and disabled a couple of linter checks due to quite large portion of magic happening in this script.

We should probably think of some way of reducing size of this script as this is close to being unmaintainable by people other than an author.

@paulfantom paulfantom mentioned this pull request Sep 12, 2018
10 tasks

REINSTALL_PWD="${PWD}"
REINSTALL_COMMAND="$(printf "%q " "$0" "${@}"; printf "\n")"
REINSTALL_COMMAND="$(printf "%q " "$0" "${@}"; printf "\\n")"
Copy link
Member

Choose a reason for hiding this comment

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

You have added an extra backslash to \n. We just need a new line to be printed here, since printf does not print new lines.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This will still be printing a newline. https://github.com/koalaman/shellcheck/wiki/SC1117

Copy link
Member

Choose a reason for hiding this comment

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

This fix is "retired".... so they got it back.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Looks like I am just using shellcheck 0.4.7 in which this is not retired.

@@ -176,30 +182,32 @@ get_git_config_signatures() {
local x s file md5

[ ! -d "conf.d" ] && echo >&2 "Wrong directory." && return 1
[ -z "${md5sum}" -o ! -x "${md5sum}" ] && echo >&2 "No md5sum command." && return 1
[ -z "${md5sum}" ] || [ ! -x "${md5sum}" ] && echo >&2 "No md5sum command." && return 1
Copy link
Member

Choose a reason for hiding this comment

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

This may need parenthesis around the conditions.

while read
do
if [[ ! "${path}" =~ (^|:)"${REPLY}"(:|$) ]]
then
[ ! -z "${path}" ] && path="${path}:"
path="${path}${REPLY}"
fi
done < <( echo "${PATH}" | tr ":" "\n" )
done < <( echo "${PATH}" | tr ":" "\\n" )
Copy link
Member

Choose a reason for hiding this comment

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

extra backslash on \n.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@@ -489,7 +502,7 @@ run ./configure \
--with-zlib \
--with-math \
--with-user=netdata \
${NETDATA_CONFIGURE_OPTIONS} \
"${NETDATA_CONFIGURE_OPTIONS}" \
Copy link
Member

Choose a reason for hiding this comment

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

This was intentionally without quotes; it contains one or more parameters to configure

@paulfantom paulfantom closed this Sep 12, 2018
@paulfantom paulfantom deleted the lint_installer branch October 19, 2018 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants