diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/db.sh | 27 |
1 files changed, 27 insertions, 0 deletions
@@ -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}" |