Task #25262 - added.err
back to task #25262download
Error: SHELLCHECK_WARNING (CWE-457):
/usr/share/dist-git/hooks/grok_update:6:27: warning[SC2154]: gitroot_dir is referenced but not assigned.
# 4|
# 5| eval "$(crudini --format=sh --get /etc/dist-git/dist-git.conf dist-git)"
# 6|-> /usr/bin/grok-manifest -m $gitroot_dir/manifest.js.gz -t $gitroot_dir -n `pwd`
Error: SHELLCHECK_WARNING (CWE-156):
/usr/share/dist-git/hooks/grok_update:6:74: warning[SC2046]: Quote this to prevent word splitting.
# 4|
# 5| eval "$(crudini --format=sh --get /etc/dist-git/dist-git.conf dist-git)"
# 6|-> /usr/bin/grok-manifest -m $gitroot_dir/manifest.js.gz -t $gitroot_dir -n `pwd`
Error: SHELLCHECK_WARNING (CWE-563):
/usr/share/dist-git/hooks/post-receive:3:11: warning[SC2034]: revs appears unused. Verify use (or export if used externally).
# 1| #!/usr/bin/bash
# 2|
# 3|-> readarray revs
# 4|
# 5| dirpath="$GIT_DIR/hooks/post-receive-chained.d"
Error: SHELLCHECK_WARNING (CWE-670):
/usr/share/dist-git/hooks/post-receive:9:11: warning[SC2128]: Expanding an array without an index only gives the first element.
# 7|
# 8| # pee redirects stdin to each of the post-receive hooks in place.
# 9|-> if [[ -e "$files" || -L "$files" ]]; then
# 10| /usr/bin/pee "$dirpath"/*
# 11| fi
Error: SHELLCHECK_WARNING (CWE-670):
/usr/share/dist-git/hooks/post-receive:9:26: warning[SC2128]: Expanding an array without an index only gives the first element.
# 7|
# 8| # pee redirects stdin to each of the post-receive hooks in place.
# 9|-> if [[ -e "$files" || -L "$files" ]]; then
# 10| /usr/bin/pee "$dirpath"/*
# 11| fi
Error: SHELLCHECK_WARNING (CWE-563):
/usr/share/dist-git/mkbranch:8:1: warning[SC2034]: RUNDIR appears unused. Verify use (or export if used externally).
# 6|
# 7| # Figure out the environment we're running in
# 8|-> RUNDIR=$(cd "$(dirname "$0")" && pwd)
# 9|
# 10| eval "$(crudini --format=sh --get /etc/dist-git/dist-git.conf dist-git)"
Error: SHELLCHECK_WARNING (CWE-457):
/usr/share/dist-git/mkbranch:11:9: warning[SC2154]: gitroot_dir is referenced but not assigned.
# 9|
# 10| eval "$(crudini --format=sh --get /etc/dist-git/dist-git.conf dist-git)"
# 11|-> REPODIR=$gitroot_dir
# 12| SRC_BRANCH="$default_branch"
# 13|
Error: SHELLCHECK_WARNING (CWE-457):
/usr/share/dist-git/mkbranch:12:13: warning[SC2154]: default_branch is referenced but not assigned.
# 10| eval "$(crudini --format=sh --get /etc/dist-git/dist-git.conf dist-git)"
# 11| REPODIR=$gitroot_dir
# 12|-> SRC_BRANCH="$default_branch"
# 13|
# 14| # check if a moron is driving me
Error: SHELLCHECK_WARNING (CWE-393):
/usr/share/dist-git/mkbranch:19:10: error[SC2242]: Can only exit with status 0-255. Other data should be written to stdout/stderr.
# 17| echo "ERROR: This script has to be run on the git server."
# 18| echo "ERROR: Homer sez 'Duh'."
# 19|-> exit -9
# 20| fi
# 21|
Error: SHELLCHECK_WARNING (CWE-477):
/usr/share/dist-git/mkbranch:82:19: warning[SC2166]: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined.
# 80|
# 81| # check the arguments
# 82|-> if [ -z "$BRANCH" -o -z "$PACKAGES" ] ; then
# 83| Usage
# 84| exit -1
Error: SHELLCHECK_WARNING (CWE-393):
/usr/share/dist-git/mkbranch:84:10: error[SC2242]: Can only exit with status 0-255. Other data should be written to stdout/stderr.
# 82| if [ -z "$BRANCH" -o -z "$PACKAGES" ] ; then
# 83| Usage
# 84|-> exit -1
# 85| fi
# 86|
Error: SHELLCHECK_WARNING (CWE-140):
/usr/share/dist-git/mkbranch:91:12: warning[SC2207]: Prefer mapfile or read -a to split command output (or quote to avoid splitting).
# 89| for PACKAGE in $PACKAGES ; do
# 90| PACKAGE=`echo $PACKAGE | sed -e "s+^/*\([^/]*\)/*$+\1+"`
# 91|-> parts=($(echo $PACKAGE | tr "/" " "))
# 92| parts_len=${#parts[@]}
# 93| if [ -n "$default_namespace" ] && [ $parts_len -le 1 ]; then
Error: SHELLCHECK_WARNING (CWE-393):
/usr/share/dist-git/mkbranch:106:47: error[SC2242]: Can only exit with status 0-255. Other data should be written to stdout/stderr.
# 104| if [ ! -d $REPODIR/$p.git ] ; then
# 105| echo "ERROR: Package module $p is invalid" >&2
# 106|-> [ "$IGNORE" = "yes" ] && continue || exit -1
# 107| fi
# 108| if GIT_DIR=$REPODIR/$p.git git rev-parse -q --verify $BRANCH >/dev/null; then
Error: SHELLCHECK_WARNING (CWE-393):
/usr/share/dist-git/mkbranch:118:10: error[SC2242]: Can only exit with status 0-255. Other data should be written to stdout/stderr.
# 116| if [ -z "$PACKAGES" ] ; then
# 117| echo "NOOP: no valid packages found to process"
# 118|-> exit -1
# 119| fi
# 120|
Error: SHELLCHECK_WARNING (CWE-393):
/usr/share/dist-git/mkbranch:130:10: error[SC2242]: Can only exit with status 0-255. Other data should be written to stdout/stderr.
# 128| echo "ERROR: You can not write to $REPODIR"
# 129| echo "ERROR: You can not perform branching operations"
# 130|-> exit -1
# 131| fi
# 132|
Error: SHELLCHECK_WARNING (CWE-457):
/usr/share/dist-git/mkbranch:142:43: warning[SC2154]: d is referenced but not assigned.
# 140| # permissions checks for this particular module
# 141| if [ ! -w $REPODIR/$NAME.git/refs/heads/ ] ; then
# 142|-> echo "ERROR: You can not write to $d"
# 143| echo "ERROR: $NAME can not be branched by you"
# 144| continue
Error: SHELLCHECK_WARNING (CWE-829):
/usr/share/dist-git/mkbranch:147:5: warning[SC2091]: Remove surrounding $() to avoid executing output (or use eval if intentional).
# 145| fi
# 146| [ $VERBOSE -gt 0 ] && echo "Creating $NAME $BRANCH from $NAME ..."
# 147|-> $(pushd $REPODIR/$NAME.git >/dev/null && \
# 148| git branch --no-track $BRANCH `git rev-list --max-parents=0 "$SRC_BRANCH" | head -1` && \
# 149| popd >/dev/null) || {
Error: SHELLCHECK_WARNING (CWE-156):
/usr/share/dist-git/mkbranch:148:35: warning[SC2046]: Quote this to prevent word splitting.
# 146| [ $VERBOSE -gt 0 ] && echo "Creating $NAME $BRANCH from $NAME ..."
# 147| $(pushd $REPODIR/$NAME.git >/dev/null && \
# 148|-> git branch --no-track $BRANCH `git rev-list --max-parents=0 "$SRC_BRANCH" | head -1` && \
# 149| popd >/dev/null) || {
# 150| echo "ERROR: Branch $NAME $BRANCH could not be created" >&2
Error: SHELLCHECK_WARNING (CWE-252):
/usr/share/dist-git/mkbranch:151:9: warning[SC2164]: Use 'popd ... || exit' or 'popd ... || return' in case popd fails.
# 149| popd >/dev/null) || {
# 150| echo "ERROR: Branch $NAME $BRANCH could not be created" >&2
# 151|-> popd >/dev/null
# 152| exit -2
# 153| }
Error: SHELLCHECK_WARNING (CWE-393):
/usr/share/dist-git/mkbranch:152:10: error[SC2242]: Can only exit with status 0-255. Other data should be written to stdout/stderr.
# 150| echo "ERROR: Branch $NAME $BRANCH could not be created" >&2
# 151| popd >/dev/null
# 152|-> exit -2
# 153| }
# 154| if [[ $grok && $grok != "False" ]]; then
Error: SHELLCHECK_WARNING (CWE-563):
/usr/share/dist-git/mkbranch_branching:8:1: warning[SC2034]: RUNDIR appears unused. Verify use (or export if used externally).
# 6|
# 7| # Figure out the environment we're running in
# 8|-> RUNDIR=$(cd "$(dirname "$0")" && pwd)
# 9|
# 10| eval "$(crudini --format=sh --get /etc/dist-git/dist-git.conf dist-git)"
Error: SHELLCHECK_WARNING (CWE-457):
/usr/share/dist-git/mkbranch_branching:11:9: warning[SC2154]: gitroot_dir is referenced but not assigned.
# 9|
# 10| eval "$(crudini --format=sh --get /etc/dist-git/dist-git.conf dist-git)"
# 11|-> REPODIR=$gitroot_dir
# 12| SRC_BRANCH="$default_branch"
# 13|
Error: SHELLCHECK_WARNING (CWE-457):
/usr/share/dist-git/mkbranch_branching:12:13: warning[SC2154]: default_branch is referenced but not assigned.
# 10| eval "$(crudini --format=sh --get /etc/dist-git/dist-git.conf dist-git)"
# 11| REPODIR=$gitroot_dir
# 12|-> SRC_BRANCH="$default_branch"
# 13|
# 14| # check if a moron is driving me
Error: SHELLCHECK_WARNING (CWE-393):
/usr/share/dist-git/mkbranch_branching:19:10: error[SC2242]: Can only exit with status 0-255. Other data should be written to stdout/stderr.
# 17| echo "ERROR: This script has to be run on the git server."
# 18| echo "ERROR: Homer sez 'Duh'."
# 19|-> exit -9
# 20| fi
# 21|
Error: SHELLCHECK_WARNING (CWE-477):
/usr/share/dist-git/mkbranch_branching:82:19: warning[SC2166]: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined.
# 80|
# 81| # check the arguments
# 82|-> if [ -z "$BRANCH" -o -z "$PACKAGES" ] ; then
# 83| Usage
# 84| exit -1
Error: SHELLCHECK_WARNING (CWE-393):
/usr/share/dist-git/mkbranch_branching:84:10: error[SC2242]: Can only exit with status 0-255. Other data should be written to stdout/stderr.
# 82| if [ -z "$BRANCH" -o -z "$PACKAGES" ] ; then
# 83| Usage
# 84|-> exit -1
# 85| fi
# 86|
Error: SHELLCHECK_WARNING (CWE-140):
/usr/share/dist-git/mkbranch_branching:91:12: warning[SC2207]: Prefer mapfile or read -a to split command output (or quote to avoid splitting).
# 89| for PACKAGE in $PACKAGES ; do
# 90| PACKAGE=`echo $PACKAGE | sed -e "s+^/*\([^/]*\)/*$+\1+"`
# 91|-> parts=($(echo $PACKAGE | tr "/" " "))
# 92| parts_len=${#parts[@]}
# 93| if [ -n "$default_namespace" ] && [ $parts_len -le 1 ]; then
Error: SHELLCHECK_WARNING (CWE-393):
/usr/share/dist-git/mkbranch_branching:106:47: error[SC2242]: Can only exit with status 0-255. Other data should be written to stdout/stderr.
# 104| if [ ! -d $REPODIR/$p.git ] ; then
# 105| echo "ERROR: Package module $p is invalid" >&2
# 106|-> [ "$IGNORE" = "yes" ] && continue || exit -1
# 107| fi
# 108| if GIT_DIR=$REPODIR/$p.git git rev-parse -q --verify $BRANCH >/dev/null; then
Error: SHELLCHECK_WARNING (CWE-393):
/usr/share/dist-git/mkbranch_branching:118:10: error[SC2242]: Can only exit with status 0-255. Other data should be written to stdout/stderr.
# 116| if [ -z "$PACKAGES" ] ; then
# 117| echo "NOOP: no valid packages found to process"
# 118|-> exit -1
# 119| fi
# 120|
Error: SHELLCHECK_WARNING (CWE-393):
/usr/share/dist-git/mkbranch_branching:130:10: error[SC2242]: Can only exit with status 0-255. Other data should be written to stdout/stderr.
# 128| echo "ERROR: You can not write to $REPODIR"
# 129| echo "ERROR: You can not perform branching operations"
# 130|-> exit -1
# 131| fi
# 132|
Error: SHELLCHECK_WARNING (CWE-457):
/usr/share/dist-git/mkbranch_branching:142:43: warning[SC2154]: d is referenced but not assigned.
# 140| # permissions checks for this particular module
# 141| if [ ! -w $REPODIR/$NAME.git/refs/heads/ ] ; then
# 142|-> echo "ERROR: You can not write to $d"
# 143| echo "ERROR: $NAME can not be branched by you"
# 144| continue
Error: SHELLCHECK_WARNING (CWE-829):
/usr/share/dist-git/mkbranch_branching:147:5: warning[SC2091]: Remove surrounding $() to avoid executing output (or use eval if intentional).
# 145| fi
# 146| [ $VERBOSE -gt 0 ] && echo "Creating $NAME $BRANCH from $NAME ..."
# 147|-> $(pushd $REPODIR/$NAME.git >/dev/null && \
# 148| git branch --no-track $BRANCH `git rev-list "$SRC_BRANCH" | head -1` && \
# 149| popd >/dev/null) || {
Error: SHELLCHECK_WARNING (CWE-156):
/usr/share/dist-git/mkbranch_branching:148:35: warning[SC2046]: Quote this to prevent word splitting.
# 146| [ $VERBOSE -gt 0 ] && echo "Creating $NAME $BRANCH from $NAME ..."
# 147| $(pushd $REPODIR/$NAME.git >/dev/null && \
# 148|-> git branch --no-track $BRANCH `git rev-list "$SRC_BRANCH" | head -1` && \
# 149| popd >/dev/null) || {
# 150| echo "ERROR: Branch $NAME $BRANCH could not be created" >&2
Error: SHELLCHECK_WARNING (CWE-252):
/usr/share/dist-git/mkbranch_branching:151:9: warning[SC2164]: Use 'popd ... || exit' or 'popd ... || return' in case popd fails.
# 149| popd >/dev/null) || {
# 150| echo "ERROR: Branch $NAME $BRANCH could not be created" >&2
# 151|-> popd >/dev/null
# 152| exit -2
# 153| }
Error: SHELLCHECK_WARNING (CWE-393):
/usr/share/dist-git/mkbranch_branching:152:10: error[SC2242]: Can only exit with status 0-255. Other data should be written to stdout/stderr.
# 150| echo "ERROR: Branch $NAME $BRANCH could not be created" >&2
# 151| popd >/dev/null
# 152|-> exit -2
# 153| }
# 154| if [[ $grok && $grok != "False" ]]; then
Error: SHELLCHECK_WARNING:
/usr/share/dist-git/remove_unused_sources:52:20: warning[SC2054]: Use spaces, not commas, to separate array elements.
# 50| test $# -eq 0 && continue
# 51| test $# -ne 2 && die "Unsupported format. Only the old '<SUM> <FILENAME' format is used."
# 52|-> allowlist+=("$hash","$filename")
# 53| done < <(git show "$branch":sources)
# 54| done
Error: SHELLCHECK_WARNING (CWE-457):
/usr/share/dist-git/setup_git_package:9:9: warning[SC2154]: gitroot_dir is referenced but not assigned.
# 7| # Figure out the environment we're running in
# 8| eval "$(crudini --format=sh --get /etc/dist-git/dist-git.conf dist-git)"
# 9|-> REPODIR=$gitroot_dir
# 10| DEFAULT_BRANCH=$default_branch
# 11| : ${git_author_name="Undefined"}
Error: SHELLCHECK_WARNING (CWE-457):
/usr/share/dist-git/setup_git_package:10:16: warning[SC2154]: default_branch is referenced but not assigned (did you mean 'DEFAULT_BRANCH'?).
# 8| eval "$(crudini --format=sh --get /etc/dist-git/dist-git.conf dist-git)"
# 9| REPODIR=$gitroot_dir
# 10|-> DEFAULT_BRANCH=$default_branch
# 11| : ${git_author_name="Undefined"}
# 12| : ${git_author_email="undefined@example.com"}
Error: SHELLCHECK_WARNING (CWE-393):
/usr/share/dist-git/setup_git_package:17:10: error[SC2242]: Can only exit with status 0-255. Other data should be written to stdout/stderr.
# 15| echo "ERROR: This script has to be run on the git server."
# 16| echo "ERROR: Homer sez 'Duh'."
# 17|-> exit -9
# 18| fi
# 19|
Error: SHELLCHECK_WARNING (CWE-398):
/usr/share/dist-git/setup_git_package:35:13: error[SC2071]: > is for string comparisons. Use -gt instead.
# 33| }
# 34|
# 35|-> while [[ $# > 0 ]]
# 36| do
# 37| key="$1"
Error: SHELLCHECK_WARNING (CWE-393):
/usr/share/dist-git/setup_git_package:53:10: error[SC2242]: Can only exit with status 0-255. Other data should be written to stdout/stderr.
# 51| if [ -z "$PACKAGE" ] ; then
# 52| Usage
# 53|-> exit -1
# 54| fi
# 55|
Error: SHELLCHECK_WARNING (CWE-140):
/usr/share/dist-git/setup_git_package:58:8: warning[SC2207]: Prefer mapfile or read -a to split command output (or quote to avoid splitting).
# 56| # optionally prepend default namespace if $PACKAGE is not namespaced
# 57| PACKAGE=`echo $PACKAGE | sed -e "s+^/*\([^/]*\)/*$+\1+"`
# 58|-> parts=($(echo $PACKAGE | tr "/" " "))
# 59| parts_len=${#parts[@]}
# 60| if [ -n "$default_namespace" ] && [ $parts_len -le 1 ]; then
Error: SHELLCHECK_WARNING (CWE-393):
/usr/share/dist-git/setup_git_package:75:10: error[SC2242]: Can only exit with status 0-255. Other data should be written to stdout/stderr.
# 73| echo "ERROR: You can not write to $REPODIR"
# 74| echo "ERROR: You can not create repos"
# 75|-> exit -1
# 76| fi
# 77|
Error: SHELLCHECK_WARNING (CWE-252):
/usr/share/dist-git/setup_git_package:84:1: warning[SC2164]: Use 'pushd ... || exit' or 'pushd ... || return' in case pushd fails.
# 82| # First create the master repo
# 83| mkdir -p $REPODIR/$PACKAGE.git
# 84|-> pushd $REPODIR/$PACKAGE.git >/dev/null
# 85| git init -q --shared --bare
# 86| popd >/dev/null
Error: SHELLCHECK_WARNING (CWE-252):
/usr/share/dist-git/setup_git_package:86:1: warning[SC2164]: Use 'popd ... || exit' or 'popd ... || return' in case popd fails.
# 84| pushd $REPODIR/$PACKAGE.git >/dev/null
# 85| git init -q --shared --bare
# 86|-> popd >/dev/null
# 87|
# 88| mkdir -p $REPODIR/$PACKAGE.git/hooks/post-receive-chained.d
Error: SHELLCHECK_WARNING (CWE-252):
/usr/share/dist-git/setup_git_package:103:1: warning[SC2164]: Use 'pushd ... || exit' or 'pushd ... || return' in case pushd fails.
# 101| # Now clone that repo and create the .gitignore and sources file
# 102| git init -q $TMPDIR/$PACKAGE
# 103|-> pushd $TMPDIR/$PACKAGE >/dev/null
# 104| touch .gitignore
# 105| git config user.name "$git_author_name"
Error: SHELLCHECK_WARNING (CWE-252):
/usr/share/dist-git/setup_git_package:111:1: warning[SC2164]: Use 'popd ... || exit' or 'popd ... || return' in case popd fails.
# 109| git remote add origin $REPODIR/$PACKAGE.git
# 110| git push -q origin "$DEFAULT_BRANCH"
# 111|-> popd >/dev/null
# 112|
# 113| # Place the gitolite update hook in place since we're not using our own