summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorP. J. McDermott <pjm@nac.net>2013-07-27 15:32:40 (EDT)
committer P. J. McDermott <pjm@nac.net>2013-07-27 15:32:40 (EDT)
commit484d4567745b77eb0d993202dfce730416e3fb40 (patch)
tree477db304bec40b020c2da13bf2c718e70fa4b917
parent51ed0eda4a16dc4d4c27205a97247b04696aaba5 (diff)
lib/index.sh: s/archive/opt_base_dir/.
-rw-r--r--lib/index.sh24
1 files changed, 13 insertions, 11 deletions
diff --git a/lib/index.sh b/lib/index.sh
index 289cb78..7d5abf9 100644
--- a/lib/index.sh
+++ b/lib/index.sh
@@ -36,18 +36,19 @@ feed_add_package()
pkg_hash="$(hash_name "${pkg}")"
# Add package metadata to feed hash index.
- feed_hash_idx="${archive}/feeds/${chan}/${dist}/${plat}/${arch}/${sect}"
- feed_hash_idx="${feed_hash_idx}/.db/${pkg_hash}"
+ feed_hash_idx="${opt_base_dir}/feeds/${chan}/${dist}/${plat}/${arch}"
+ feed_hash_idx="${feed_hash_idx}/${sect}/.db/${pkg_hash}"
mkdir -p "${feed_hash_idx}"
- tar -xzOf "${archive}/${file}" 'control.tar.gz' | tar -xzO './control' \
- >"${feed_hash_idx}/info/${pkg}.control"
+ tar -xzOf "${opt_base_dir}/${file}" 'control.tar.gz' | \
+ tar -xzO './control' >"${feed_hash_idx}/info/${pkg}.control"
printf 'Filename: %s\nSize: %s\nMD5sum: %s\n\n' \
"../../../../../../${file}" "${size}" \
- "$(md5sum "${archive}/${file}" | sed 's/ .*$//')" \
+ "$(md5sum "${opt_base_dir}/${file}" | sed 's/ .*$//')" \
>>"${feed_hash_idx}/info/${pkg}.control"
# Mark feed index fragment as outdated.
- old_dir="${archive}/feeds/.db/${chan}_${dist}/${plat}_${arch}/${sect}"
+ old_dir="${opt_base_dir}/feeds/.db/${chan}_${dist}/${plat}_${arch}"
+ old_dir="${old_dir}/${sect}"
mkdir -p "${old_dir}"
>"${old_dir}/${pkg_hash}"
@@ -69,13 +70,14 @@ feed_remove_package()
pkg_hash="$(hash_name "${pkg}")"
# Remove package metadata from feed hash index.
- feed_hash_idx="${archive}/feeds/${chan}/${dist}/${plat}/${arch}/${sect}"
- feed_hash_idx="${feed_hash_idx}/.db/${pkg_hash}"
+ feed_hash_idx="${opt_base_dir}/feeds/${chan}/${dist}/${plat}/${arch}"
+ feed_hash_idx="${feed_hash_idx}/${sect}/.db/${pkg_hash}"
rm -f "${feed_hash_idx}/info/${pkg}.control"
try_rmdir "${feed_hash_idx}/info"
# Mark feed index fragment as outdated.
- old_dir="${archive}/feeds/.db/${chan}_${dist}/${plat}_${arch}/${sect}"
+ old_dir="${opt_base_dir}/feeds/.db/${chan}_${dist}/${plat}_${arch}"
+ old_dir="${old_dir}/${sect}"
mkdir -p "${old_dir}"
>"${old_dir}/${pkg_hash}"
@@ -93,10 +95,10 @@ update_feeds()
local idx=
script='s|^.*//*\(..*\)_\(..*\)//*\(..*\)_\(..*\)//*\(..*\)/$'
- script="${script}|${archive}/feeds/"'\1/\2/\3/\4/\5|'
+ script="${script}|${opt_base_dir}/feeds/"'\1/\2/\3/\4/\5|'
# For each suite:
- for suite_dirent in "${archive}/feeds/.db/"*_*/; do
+ for suite_dirent in "${opt_base_dir}/feeds/.db/"*_*/; do
if [ ! -d "${suite_dirent}" ]; then
continue
fi