summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2017-08-23 22:07:00 +0200
committerErich Eckner <git@eckner.net>2017-08-23 22:07:00 +0200
commit67ffb502ea0c2bbf36dbfc0c8dfcd065002aabd8 (patch)
tree44ebe3ab863d236e052440f5ca72361316494971
parent1061c920833a562e02584aa70e7c889a734139d8 (diff)
downloadbuilder-67ffb502ea0c2bbf36dbfc0c8dfcd065002aabd8.tar.xz
silence all other shellcheck warnings
-rwxr-xr-xbin/build-master-status1
-rwxr-xr-xbin/build-packages3
-rwxr-xr-xbin/clean-cache1
-rwxr-xr-xbin/common-functions4
-rwxr-xr-xbin/db-update2
-rwxr-xr-xbin/get-assignment2
-rwxr-xr-xbin/get-package-updates1
-rwxr-xr-xbin/show-dependencies25
-rwxr-xr-xbin/strict-bashism-check1
9 files changed, 26 insertions, 14 deletions
diff --git a/bin/build-master-status b/bin/build-master-status
index 147b325..66a8f51 100755
--- a/bin/build-master-status
+++ b/bin/build-master-status
@@ -253,6 +253,7 @@ if ${web}; then
"${repo}" \
"$(wc -l < "${work_dir}/package-states/${sf}.broken")" \
"$(
+ # shellcheck disable=SC2010
ls -t "${webserver_directory}/build-logs" | \
grep -m1 "^$(str_to_regex "${sf}.")[^.]\+\.build-log\.gz\$"
)" \
diff --git a/bin/build-packages b/bin/build-packages
index 4209eea..fef2c9a 100755
--- a/bin/build-packages
+++ b/bin/build-packages
@@ -25,6 +25,7 @@
# shellcheck source=conf/default.conf
. "${0%/*}/../conf/default.conf"
+# shellcheck disable=SC2016
usage() {
>&2 echo ''
>&2 echo 'build-packages: build package(s) on the build-list'
@@ -100,7 +101,7 @@ fi
while [ "${count}" -ne 0 ]; do
- if [ ${timeout} -ne 0 ] && [ ${timeout} -lt $(date +%s) ];
+ if [ "${timeout}" -ne 0 ] && [ "${timeout}" -lt "$(date +%s)" ];
then
break
fi
diff --git a/bin/clean-cache b/bin/clean-cache
index 06ac8a1..42dae59 100755
--- a/bin/clean-cache
+++ b/bin/clean-cache
@@ -28,6 +28,7 @@ trap 'rm -rf --one-file-system "${tmp_dir}"' EXIT
for repo in ${repos}; do
mkdir "${tmp_dir}/${repo}"
wget -qO - "$(
+ # shellcheck disable=SC2016
echo "${mirror}" | \
sed "$(
printf 's|%s|%s|\n' \
diff --git a/bin/common-functions b/bin/common-functions
index 2d15f5e..4befce0 100755
--- a/bin/common-functions
+++ b/bin/common-functions
@@ -2,6 +2,8 @@
# contains functions used by more than one script
+# shellcheck disable=SC2039
+
if [ -z "${base_dir}" ]; then
# just to make shellcheck happy
. 'conf/default.conf'
@@ -64,6 +66,7 @@ find_repository_with_commit() {
local repository
for repository in ${repo_names}; do
+ # shellcheck disable=SC2016
if [ "$(eval git -C "$(printf '"${repo_paths__%s}"' "${repository}")" cat-file -t '"$1"' 2> /dev/null)" = "commit" ]; then
echo "${repository}"
return 0
@@ -399,6 +402,7 @@ remove_old_package_versions() {
local pkgname="${package%-*-*-*.pkg.tar.xz}"
+ # shellcheck disable=SC2046
${master_mirror_rsync_command} \
--recursive \
--delete \
diff --git a/bin/db-update b/bin/db-update
index 74bab79..1efc776 100755
--- a/bin/db-update
+++ b/bin/db-update
@@ -25,6 +25,7 @@
# use "builds" instead of assuming package builds only it's name
+# shellcheck disable=SC2039
# shellcheck source=conf/default.conf
. "${0%/*}/../conf/default.conf"
@@ -275,6 +276,7 @@ move_packages() {
while read -r repo; do
+ # shellcheck disable=SC2086
${dummynator} ${master_mirror_rsync_command} \
"${tmp_dir}/${repo}/${repo}.db."* \
"${tmp_dir}/${repo}/${repo}.files."* \
diff --git a/bin/get-assignment b/bin/get-assignment
index 7185a35..670dfdc 100755
--- a/bin/get-assignment
+++ b/bin/get-assignment
@@ -37,6 +37,7 @@ hand_out_assignment() {
xargs -rn1 rm -f
echo "$1 $2 $3 $4"
+ # shellcheck disable=SC2154
echo "${slave}" > "${work_dir}/package-states/$1.$2.$3.$4.locked"
# lock every loop this package breaks
@@ -112,6 +113,7 @@ fi
for hand_out_broken in false true; do
+ # shellcheck disable=SC2094
while read -r package git_revision mod_git_revision repository; do
if [ -z "${git_revision}${mod_git_revision}${repository}" ] && \
diff --git a/bin/get-package-updates b/bin/get-package-updates
index fbb05f8..7cd17cf 100755
--- a/bin/get-package-updates
+++ b/bin/get-package-updates
@@ -254,6 +254,7 @@ find "${work_dir}/package-infos/" -maxdepth 1 -name '*.builds' -printf '%f\n' |
[ -z "${mod_rev}" ] && \
[ -z "${repo}" ] && \
[ -z "${pkg}" ]; then
+ # shellcheck disable=SC2031
printf '%s %s.%s.%s.%s\n' \
"${opkg}" \
"${opkg}" \
diff --git a/bin/show-dependencies b/bin/show-dependencies
index f6110d3..fc381dd 100755
--- a/bin/show-dependencies
+++ b/bin/show-dependencies
@@ -15,7 +15,7 @@ if [ $# -eq 0 ]; then
sum=''
tmp_dir=$(mktemp -d)
trap 'rm -rf --one-file-system "${tmp_dir}"' EXIT
- find "${work_dir}/package-infos" -name '*.builds' -exec \
+ find "${work_dir}/package-infos" -maxdepth 1 -name '*.builds' -exec \
grep -HF '' {} \; | \
sed '
s|^.*/||
@@ -68,7 +68,7 @@ if [ $# -eq 0 ]; then
# shellcheck disable=SC2086
printf '%s\n' ${broken}
(
- ls "${webserver_directory}/graphs" | \
+ find "${webserver_directory}/graphs" -maxdepth 1 -name '*.png' -printf '%f\n' | \
sed 's|\.png$||'
(
awk '{print $1}' < \
@@ -85,13 +85,12 @@ if [ $# -eq 0 ]; then
# shellcheck disable=SC2086
"$0" 'ALL' ${broken}
(
- ls "${webserver_directory}/graphs"
+ find "${webserver_directory}/graphs" -maxdepth 1 -name '*.png'
# shellcheck disable=SC2086
- printf '%s.png\n' ${broken} ${broken} 'ALL' 'ALL'
+ printf "${webserver_directory}"'/graphs/%s.png\n' ${broken} ${broken} 'ALL' 'ALL'
) | \
sort | \
uniq -u | \
- sed "s|^|${webserver_directory}/graphs/|" | \
xargs -r rm
exit
fi
@@ -135,7 +134,7 @@ sort -k1,1 "${work_dir}/build-list" > \
sort -u | \
sponge "${tmp_dir}/original-build-order"
-ls "${work_dir}/package-infos" | \
+find "${work_dir}/package-infos" -maxdepth 1 -printf '%f\n' | \
sed 's|\(\.[^.]\+\)\{4\}$||' | \
sort -u > \
"${tmp_dir}/known-packages"
@@ -228,6 +227,7 @@ for target_package in "$@"; do
grep -v '^\(\S\+\) \1$' "${tmp_dir}/build-order" | \
sponge "${tmp_dir}/build-order"
+ # shellcheck disable=SC2129
tr ' ' '\n' < \
"${tmp_dir}/build-order" | \
sort -u | \
@@ -308,18 +308,17 @@ for target_package in "$@"; do
print $1 " " $2 > "'"${tmp_dir}/neighbours/"'"$2;
}'
- ls "${tmp_dir}/neighbours" | \
+ find "${tmp_dir}/neighbours" -maxdepth 1 -type f | \
while read -r file; do
sed "
- s@\(^\| \)$(str_to_regex "${file}")\( \|\$\)@\1<knot>\2@
- " "${tmp_dir}/neighbours/${file}" | \
+ s@\(^\| \)$(str_to_regex "${file##*/}")\( \|\$\)@\1<knot>\2@
+ " "${file}" | \
sort -u | \
- sponge "${tmp_dir}/neighbours/${file}"
+ sponge "${file}"
done
- ls "${tmp_dir}/neighbours" | \
- sed "s|^|${tmp_dir}/neighbours/|" | \
- xargs -r sha512sum | \
+ find "${tmp_dir}/neighbours" -maxdepth 1 -type f -exec \
+ sha512sum {} \; | \
sed 's|^\(\S\+\) .*/\([^/]\+\)$|\2 \1|' | \
sort -k2,2 | \
uniq -f1 -D | \
diff --git a/bin/strict-bashism-check b/bin/strict-bashism-check
index 1bcfdfd..9029471 100755
--- a/bin/strict-bashism-check
+++ b/bin/strict-bashism-check
@@ -62,6 +62,7 @@ if [ -n "${errors}" ]; then
fi
errors=$(
+# shellcheck disable=SC2016
find bin conf -type f -executable -exec grep -H '="\$(' {} \;
)