From a53d93fa4253a0f50db92936d6af11ae04f67a2a Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Thu, 01 May 2014 13:59:43 -0400 Subject: collect_garbage(): Use file input, not heredoc. This fixes garbage collection. Before: $ pro-archman -v -b proteanos process-incoming pro-archman: Processing changes in incoming... pro-archman: Updating feeds... pro-archman: Collecting garbage... pro-archman: Deleting file ... rm: cannot remove ‘proteanos/’: Is a directory pro-archman: 52: [: Illegal number: proteanos/.db/garbage/1398956970 pro-archman: Deleting file ... rm: cannot remove ‘proteanos/’: Is a directory pro-archman: 52: [: Illegal number: proteanos/.db/garbage/1398956971 After: $ pro-archman -v -b proteanos process-incoming pro-archman: Processing changes in incoming... pro-archman: Updating feeds... pro-archman: Collecting garbage... pro-archman: Deleting file pool/o/opkg/libopkg.1-dev_0.2.0-1_all_all.opk... pro-archman: Deleting file pool/o/opkg/opkg-doc_0.2.0-1_all_all.opk... pro-archman: Deleting file pool/o/opkg/libopkg.1_0.2.0-1_amd64-linux-glibc_all.opk... pro-archman: Deleting file pool/o/opkg/opkg-dbg_0.2.0-1_amd64-linux-glibc_all.opk... pro-archman: Deleting file pool/o/opkg/opkg_0.2.0-1_amd64-linux-glibc_all.opk... pro-archman: Deleting file pool/o/opkg/_0.2.2-1_all_all.opk... pro-archman: Deleting file pool/o/opkg/_0.2.2-1_amd64-linux-glibc_all.opk... pro-archman: Deleting file pool/o/opkg/libopkg.1_0.2.0-1_i686-linux-glibc_all.opk... pro-archman: Deleting file pool/o/opkg/opkg-dbg_0.2.0-1_i686-linux-glibc_all.opk... pro-archman: Deleting file pool/o/opkg/opkg_0.2.0-1_i686-linux-glibc_all.opk... pro-archman: Deleting file pool/o/opkg/src-opkg_0.2.0-1_src_all.opk... --- diff --git a/lib/garbage.sh b/lib/garbage.sh index 3a0ca97..a6f1a3d 100644 --- a/lib/garbage.sh +++ b/lib/garbage.sh @@ -54,9 +54,7 @@ collect_garbage() try_rmdir "${base_dir}/${file}" dirs=$(($dirs - 1)) done - done <<-EOF - ${garbage} - EOF + done <"${garbage}" rm -f "${garbage}" done } -- cgit v0.9.1