diff options
author | Patrick McDermott <patrick.mcdermott@libiquity.com> | 2019-04-27 01:03:19 (EDT) |
---|---|---|
committer | Patrick McDermott <patrick.mcdermott@libiquity.com> | 2019-04-27 01:03:19 (EDT) |
commit | fdca7410feb58b9fa5ec28814bb8d39aa9b6b2a4 (patch) | |
tree | bfa8026694053f8a6b4caf3cc0199702f84d8844 | |
parent | 842f0e7a3d9857d353614005ff17424266ef51a0 (diff) |
update_feeds(): Fix manifest generation
Previously, manifests only included newly updated arch/plat/sect feeds.
This reverts and rewrites commit 6fb8eb4.
-rw-r--r-- | src/index.sh | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/src/index.sh b/src/index.sh index 9711af5..62208b9 100644 --- a/src/index.sh +++ b/src/index.sh @@ -126,7 +126,6 @@ update_feeds() local archplat= local sect_dirent= local sect= - local manifest_entry= local hash_dirent= local idx= @@ -142,7 +141,6 @@ update_feeds() dist="${chan##*_}" chan="${chan%_*}" suite="${base_dir}/feeds/${chan}/${dist}" - exec 3>"${suite}/Manifest~" # For each archplat: for archplat_dirent in "${suite_dirent}/"*_*/; do if [ ! -d "${archplat_dirent}" ]; then @@ -163,7 +161,6 @@ update_feeds() info_v "$(get_msg 'updating_feed')" \ "${chan}" "${dist}" \ "${arch}" "${plat}" "${sect}" - manifest_entry="${arch}/${plat}/${sect}" sect="${archplat}/${sect}" # For each package name hash: for hash_dirent in "${sect_dirent}/"*; do @@ -193,7 +190,6 @@ update_feeds() 1>"${sect}/Packages.gz" fi feed_sign "${sect}/Packages" - printf '%s\n' "${manifest_entry}" 1>&3 else rm -f -- "${sect}/Packages" \ "${sect}/Packages.gz" @@ -206,14 +202,17 @@ update_feeds() try_rmdir "${archplat%/*}" || : done rmdir -- "${suite_dirent}" - exec 3>&- - if [ -s "${suite}/Manifest~" ]; then - mv -- "${suite}/Manifest~" "${suite}/Manifest" - else - rm -f -- "${suite}/Manifest~" "${suite}/Manifest" - rmdir -- "${suite}" - rmdir -- "${suite%/*}" 2>/dev/null || : - fi + try_rmdir "${suite}" + try_rmdir "${suite%/*}" + done + + # Generate all suites' arch/plat/sect manifests. + for suite_dirent in "${base_dir}/feeds/"*/*/; do + ( + cd "${suite_dirent}" + printf '%s\n' */*/* >'Manifest~' + mv 'Manifest~' 'Manifest' + ) done return 0 |