From 70c1ab4ca21cbca9f6f58f05ecce3e2f32d883fd Mon Sep 17 00:00:00 2001 From: 0x1eef <0x1eef@protonmail.com> Date: Mon, 29 May 2023 00:03:46 -0300 Subject: [PATCH] Guard against the deletion of files that are already deleted On a second run where the first run was partially completed, the deleted files might not exist anymore. This change guards against trying to delete such files. --- libexec/portzap/commands/install | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libexec/portzap/commands/install b/libexec/portzap/commands/install index d509fef..b7081ab 100644 --- a/libexec/portzap/commands/install +++ b/libexec/portzap/commands/install @@ -9,8 +9,10 @@ __install_update() { ch_files=$(git diff --name-only --diff-filter=RAM "$rev"..HEAD | \ cut -d / -f1 -f2 | uniq) for file in $rm_files; do - echo RM "$ports_dir/$file" - rm "$ports_dir/$file" + if [ -e "$ports_dir/$file" ]; then + echo RM "$ports_dir/$file" + rm "$ports_dir/$file" + fi; done for file in $ch_files; do if [ -f "$file" ]; then