summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMihai Moldovan <ionic@ionic.de>2015-04-01 04:33:52 +0200
committerMihai Moldovan <ionic@ionic.de>2015-04-01 04:33:52 +0200
commit893c96a40430d0eb7868019a4d55110f8bd5b1e1 (patch)
tree15575b2cd5dc5aedfb364adbb45d4573f28079b4
parentbdcaeb9a8352662d6310f8299a2965cca4b6ae24 (diff)
downloadbuildscripts-893c96a40430d0eb7868019a4d55110f8bd5b1e1.tar.gz
buildscripts-893c96a40430d0eb7868019a4d55110f8bd5b1e1.tar.bz2
buildscripts-893c96a40430d0eb7868019a4d55110f8bd5b1e1.zip
bin/build-rpm-package: add repeat_str() function to... repeat a string.
-rwxr-xr-xbin/build-rpm-package14
1 files changed, 14 insertions, 0 deletions
diff --git a/bin/build-rpm-package b/bin/build-rpm-package
index a598fc4..ca88489 100755
--- a/bin/build-rpm-package
+++ b/bin/build-rpm-package
@@ -168,6 +168,20 @@ check_mock_version_atleast () {
fi
}
+# Repeats an input string.
+# Returns the repeated input string.
+repeat_str() { # INPUT COUNT
+ typeset INPUT="${1:?"Error: no input string passed to ${FUNCNAME}()."}"
+ typeset COUNT="${2:?"Error: no count passed to ${FUNCNAME}()."}"
+
+ typeset ret=""
+ typeset -i i=0
+ while [ "${i}" -lt "${COUNT}" ]; do
+ ret="${ret}$(printf "${INPUT}")"
+ done
+ printf "${ret}"
+}
+
get_extra_repository () {
typeset TYPE="${1:?"Error: no type passed to ${FUNCNAME}()."}"
typeset DIST="${2:?"Error: no distribution passed to ${FUNCNAME}()."}"