[Asterisk-code-review] ast_coredumper: Fix deleting results when output dir is set (asterisk[master])

Frederic Van Espen asteriskteam at digium.com
Thu Dec 9 02:56:21 CST 2021


Frederic Van Espen has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/17643 )


Change subject: ast_coredumper: Fix deleting results when output dir is set
......................................................................

ast_coredumper: Fix deleting results when output dir is set

When OUTPUTDIR is set to another directory and the
--delete-results-after is set, the resulting txt files are
not deleted.

ASTERISK-29794 #close

Change-Id: I1c0071f6809a1e3f5cfc455d6eb08378bc0d7286
---
M contrib/scripts/ast_coredumper
1 file changed, 5 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/43/17643/1

diff --git a/contrib/scripts/ast_coredumper b/contrib/scripts/ast_coredumper
index 353137f..a562cea 100755
--- a/contrib/scripts/ast_coredumper
+++ b/contrib/scripts/ast_coredumper
@@ -314,7 +314,11 @@
 	fi
 
 	if $DELETE_RESULTS_AFTER ; then
-		rm -rf "${cf//:/-}"-{brief,full,thread1,locks,info}.txt
+		local to_delete=$cf
+		if [ -n $OUTPUTDIR ] ; then
+			to_delete="$OUTPUTDIR/$cfname"
+		fi
+		rm -rf "${to_delete//:/-}"-{brief,full,thread1,locks,info}.txt
 	fi
 done
 

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/17643
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: I1c0071f6809a1e3f5cfc455d6eb08378bc0d7286
Gerrit-Change-Number: 17643
Gerrit-PatchSet: 1
Gerrit-Owner: Frederic Van Espen <frederic.ve at gmail.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20211209/b4c1049f/attachment.html>


More information about the asterisk-code-review mailing list