diff options
author | P. 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) |
commit | 47b72cceb3877f6c21e6b464b6e8b97608bed68e (patch) | |
tree | 249550f923c4b5c90fd165f11c4bb9543fe1d03b /lib | |
parent | 1802fbf66276da1ee2411112b3e68cbe3b4c1026 (diff) |
db_foreach_source(): New function.
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}" |