diff options
author | P. J. McDermott <pj@pehjota.net> | 2015-05-25 17:55:44 (EDT) |
---|---|---|
committer | P. J. McDermott <pj@pehjota.net> | 2015-05-25 17:55:44 (EDT) |
commit | 6fb8eb42460e7189588519db6f0c8584b8203858 (patch) | |
tree | e292a45554ed85902a9cef575e71589c0ce0d3ee /lib | |
parent | f5999d4e131a60728060fc7be62c881b9f7adb2c (diff) |
update_feeds(): Write suite manifest file
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 |