bug#43359: package-tests leave temporary files behind

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

bug#43359: package-tests leave temporary files behind

Glenn Morris-3
Package: emacs
Version: 28.0.50
Severity: minor

cd test
make lisp/emacs-lisp/package-tests

-> two directories "/tmp/pkg-archive-base-*" are left behind on every run.



Reply | Threaded
Open this post in threaded view
|

bug#43359: package-tests leave temporary files behind

Lars Ingebrigtsen
Glenn Morris <[hidden email]> writes:

> cd test
> make lisp/emacs-lisp/package-tests
>
> -> two directories "/tmp/pkg-archive-base-*" are left behind on every run.

This patch fixes the problem, but since it does a recursive deletion,
it'd be nice if somebody could look at it and see whether it looks
safe...

I think it should be -- when upload-base is set, then
package-test-archive-upload-base should always point to the new
directory in /tmp.

diff --git a/test/lisp/emacs-lisp/package-tests.el b/test/lisp/emacs-lisp/package-tests.el
index cbb2410f95..7797799cf8 100644
--- a/test/lisp/emacs-lisp/package-tests.el
+++ b/test/lisp/emacs-lisp/package-tests.el
@@ -154,6 +154,8 @@ with-package-test
                     `(insert-file-contents ,file))
                ,@body)))
 
+       (when ,upload-base
+         (delete-directory package-test-archive-upload-base t))
        (when (file-directory-p package-test-user-dir)
          (delete-directory package-test-user-dir t))
 


--
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no