From 6c9ef1ccaca1763d6a9e46c71ed9c67f6139c5bc Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Wed, 14 Jun 2017 16:11:08 +0200 Subject: remove bashisms - only "bash arrays" and "bash string substituions" left --- bin/common-functions | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'bin/common-functions') diff --git a/bin/common-functions b/bin/common-functions index d954a36..c3301f0 100755 --- a/bin/common-functions +++ b/bin/common-functions @@ -23,7 +23,7 @@ find_pkgbuild() { fi for repo in "${!repo_paths[@]}"; do - if [ "${repo}" == "archlinux32" ]; then + if [ "${repo}" = "archlinux32" ]; then # this is not a repository of packages continue fi @@ -112,7 +112,7 @@ find_git_repository_to_package_repository() { local repository for repository in "${!repo_paths[@]}"; do - if [ "${repository}" == "archlinux32" ]; then + if [ "${repository}" = "archlinux32" ]; then continue fi if [ -n "$( @@ -304,3 +304,22 @@ remove_old_package_versions() { xargs -rn1 rm } + +# wait_some_time $minimum $maximum-$minimum +wait_some_time() { + local minimum=$1 + local diff=$2 + local random + + if [ -z "${diff}" ]; then + diff=30 + fi + + random="$( + dd if='/dev/urandom' count=1 2> /dev/null | \ + cksum | \ + cut -d' ' -f1 + )" + + sleep $((${minimum} + ${random} % ${diff})) +} -- cgit v1.2.3-54-g00ecf