diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/index.sh | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/index.sh b/lib/index.sh index e3ed7ba..dd6ba3d 100644 --- a/lib/index.sh +++ b/lib/index.sh @@ -108,6 +108,7 @@ update_feeds() local archplat= local sect_dirent= local sect= + local manifest_entry= local hash_dirent= local idx= @@ -123,6 +124,7 @@ 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 @@ -143,6 +145,7 @@ 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 @@ -166,6 +169,7 @@ update_feeds() >"${sect}/Packages~" mv "${sect}/Packages~" \ "${sect}/Packages" + printf '%s\n' "${manifest_entry}" >&3 else rm -f "${sect}/Packages" fi @@ -177,8 +181,14 @@ update_feeds() try_rmdir "${archplat%/*}" done rmdir "${suite_dirent}" - try_rmdir "${suite}" - try_rmdir "${suite%/*}" + exec 3>&- + if [ -s "${suite}/Manifest~" ]; then + mv "${suite}/Manifest~" "${suite}/Manifest" + else + rm -f "${suite}/Manifest~" "${suite}/Manifest" + rmdir "${suite}" + rmdir "${suite%/*}" + fi done return 0 |