summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorP. J. McDermott <pjm@nac.net>2013-07-28 16:59:07 (EDT)
committer P. J. McDermott <pjm@nac.net>2013-07-28 16:59:07 (EDT)
commit47b72cceb3877f6c21e6b464b6e8b97608bed68e (patch)
tree249550f923c4b5c90fd165f11c4bb9543fe1d03b /lib
parent1802fbf66276da1ee2411112b3e68cbe3b4c1026 (diff)
db_foreach_source(): New function.
Diffstat (limited to 'lib')
-rw-r--r--lib/db.sh27
1 files changed, 27 insertions, 0 deletions
diff --git a/lib/db.sh b/lib/db.sh
index 27a1ae8..f2742df 100644
--- a/lib/db.sh
+++ b/lib/db.sh
@@ -129,6 +129,33 @@ db_del_binver()
return 0
}
+db_foreach_source()
+{
+ local chan="${1}"
+ local dist="${2}"
+ local cb="${3}"
+ local dir=
+
+ dir="${opt_base_dir}/feeds/${chan}/${dist}/.db"
+ # For each hash:
+ for dir in "${dir}/"*/; do
+ if [ ! -d "${dir}" ]; then
+ continue
+ fi
+ # For each source:
+ for dir in "${dir}/"*/; do
+ if [ ! -d "${dir}" ]; then
+ continue
+ fi
+ dir="${dir%/}"
+ dir="${dir##*/}"
+ "${cb}" "${chan}" "${dist}" "${dir}" "${@}"
+ done
+ done
+
+ return 0
+}
+
db_get_archplats()
{
local chan="${1}"