]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
ast_coredumper: Fix deleting results when output dir is set
authorFrederic Van Espen <frederic.ve@gmail.com>
Thu, 9 Dec 2021 08:55:27 +0000 (09:55 +0100)
committerFriendly Automation <jenkins2@gerrit.asterisk.org>
Wed, 15 Dec 2021 18:38:52 +0000 (12:38 -0600)
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

contrib/scripts/ast_coredumper

index 353137f670aedbc2cf5e743a5fffa0e0d54de16d..2f685acb67cfa77a1463ed48ea2302e218fa7a6f 100755 (executable)
@@ -314,7 +314,11 @@ for i in "${!COREDUMPS[@]}" ; do
        fi
 
        if $DELETE_RESULTS_AFTER ; then
-               rm -rf "${cf//:/-}"-{brief,full,thread1,locks,info}.txt
+               to_delete=$cf
+               if [ -n "$OUTPUTDIR" ] ; then
+                       to_delete="$OUTPUTDIR/$cfname"
+               fi
+               rm -rf "${to_delete//:/-}"-{brief,full,thread1,locks,info}.txt
        fi
 done