From 484d4567745b77eb0d993202dfce730416e3fb40 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Sat, 27 Jul 2013 15:32:40 -0400 Subject: lib/index.sh: s/archive/opt_base_dir/. --- (limited to 'lib') 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 -- cgit v0.9.1