From dad62a66102a5f35968c694200cad3a20da14dce Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Sat, 13 Apr 2019 01:35:01 -0400 Subject: Add "|| :" after try_rmdir() calls --- diff --git a/src/db.sh b/src/db.sh index 703dca0..4069621 100644 --- a/src/db.sh +++ b/src/db.sh @@ -243,7 +243,7 @@ db_del_packages() # Remove "pool///.db/__". rmdir "${dir}" # Try to remove "pool///.db". - try_rmdir "${dir%/*}" + try_rmdir "${dir%/*}" || : return 0 } diff --git a/src/garbage.sh b/src/garbage.sh index 2975b7a..575cc5d 100644 --- a/src/garbage.sh +++ b/src/garbage.sh @@ -63,7 +63,7 @@ collect_garbage() rm -f "${base_dir}/${file}" while [ ${dirs} -gt 0 ]; do file="${file%/*}" - try_rmdir "${base_dir}/${file}" + try_rmdir "${base_dir}/${file}" || : dirs=$((${dirs} - 1)) done done <"${garbage}" diff --git a/src/index.sh b/src/index.sh index 6246f85..df6d1ff 100644 --- a/src/index.sh +++ b/src/index.sh @@ -103,7 +103,7 @@ feed_remove_package() feed_hash_idx="${base_dir}/feeds/${chan}/${dist}/${arch}/${plat}" feed_hash_idx="${feed_hash_idx}/${sect}/.db/${pkg_hash}" rm -f "${feed_hash_idx}/info/${pkg}.control" - try_rmdir "${feed_hash_idx}/info" + try_rmdir "${feed_hash_idx}/info" || : # Mark feed index fragment as outdated. old_dir="${base_dir}/feeds/.db/${chan}_${dist}/${arch}_${plat}" @@ -199,11 +199,11 @@ update_feeds() "${sect}/Packages.gz" fi rmdir "${sect_dirent}" - try_rmdir "${sect}" + try_rmdir "${sect}" || : done rmdir "${archplat_dirent}" - try_rmdir "${archplat}" - try_rmdir "${archplat%/*}" + try_rmdir "${archplat}" || : + try_rmdir "${archplat%/*}" || : done rmdir "${suite_dirent}" exec 3>&- -- cgit v0.9.1