From 6fb8eb42460e7189588519db6f0c8584b8203858 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Mon, 25 May 2015 17:55:44 -0400 Subject: update_feeds(): Write suite manifest file --- 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 -- cgit v0.9.1