summaryrefslogtreecommitdiff
path: root/bin/common-functions
diff options
context:
space:
mode:
Diffstat (limited to 'bin/common-functions')
-rwxr-xr-xbin/common-functions23
1 files changed, 21 insertions, 2 deletions
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}))
+}