-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
Conversation
|
||
REINSTALL_PWD="${PWD}" | ||
REINSTALL_COMMAND="$(printf "%q " "$0" "${@}"; printf "\n")" | ||
REINSTALL_COMMAND="$(printf "%q " "$0" "${@}"; printf "\\n")" |
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.
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.
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.
This will still be printing a newline. https://github.com/koalaman/shellcheck/wiki/SC1117
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.
This fix is "retired".... so they got it back.
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.
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 |
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.
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" ) |
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.
extra backslash on \n
.
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.
@@ -489,7 +502,7 @@ run ./configure \ | |||
--with-zlib \ | |||
--with-math \ | |||
--with-user=netdata \ | |||
${NETDATA_CONFIGURE_OPTIONS} \ | |||
"${NETDATA_CONFIGURE_OPTIONS}" \ |
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.
This was intentionally without quotes; it contains one or more parameters to configure
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.