Update prune_prefixes for bastard settings
[pkgusr] / usr / bin / forall_direntries_from
index 2b336e7..7d599e2 100755 (executable)
@@ -52,7 +52,7 @@ fs_to_scan=(/)
 #      /usr/lib/pkgusr \
 #      /usr/share/polkit-1/rules.d \
 #      /var/tmp \
-#       /var/{cache,chroot,run,snmp,spool} \
+#       /var/{cache,chroot,db,run,snmp,spool} \
 #       /var/lib/{sshd,nfs,spamassassin,pulse}) #NO TRAILING SLASHES!!!!
 
 prune_prefixes=(\
@@ -124,6 +124,12 @@ do
 done
 y[${#y[@]}]=')'
 
+# The uninstall_package script sets this to `-ignore_readdir_race' so
+# that find doesn't print errors when things it is searching for
+# disappear.
+# IGNORE_READDIR_RACE='-ignore_readdir_race'
+IGNORE_READDIR_RACE=
+
 # In the following find command, the part
 # -not ( ( "${y[@]}" -prune ) -or "${y[@]}" )
 # is responsible for preventing the files that match prune_prefixes from
@@ -131,6 +137,6 @@ y[${#y[@]}]=')'
 # -prune has no effect and is always false when -depth is used.
 # The -true before "$@" ensures that -depth can be passed as only parameter.
 
-find "${fs_to_scan[@]}" -xdev $NOLEAF \
+find "${fs_to_scan[@]}" -xdev $NOLEAF $IGNORE_READDIR_RACE \
     -not \( \( "${y[@]}" -prune \) -or "${y[@]}" \) \
     -and \( "${ugmatcher[@]}" \) -and \( -true "$@" \)