summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
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}"