-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Empty directories remain after jpm uninstall
#83
Comments
At least in stx's case, there does not appear to be any mention of the {:tag "eb6bedd643ad47caa9d3c0630c1679ca49484fdc"
:paths @["/home/user/.local/lib/janet/stx/native.so"
"/home/user/.local/lib/janet/stx/native.meta.janet"
"/home/user/.local/lib/janet/stx/native.a"
"/home/user/.local/lib/janet/stx/init.janet"]
:type :git
:url "https://github.com/ml-2/stx"
:version "0.0.0"
:dependencies @[]} Currently, it seems that (defn uninstall
"Uninstall bundle named name"
[name]
(def manifest (find-manifest name))
(when-with [f (file/open manifest)]
(def man (parse (:read f :all)))
(each path (get man :paths [])
(def path1 (string (dyn :dest-dir "") path))
(print "removing " path1)
(rm path1))
(print "removing manifest " manifest)
(:close f) # <censored (^^;>
(rm manifest)
(print "Uninstalled."))) So, IIUC, things that are not explicitly mentioned in the manifest are not removed [1]. Does that seem right? [1] Thanks to pyrmont for the pointer. |
In my opinion there are three ways to deal with this problem.
My suggestion would be to adopt Option 3. Option 2 could lead to JPM deleting user data that is saved into a directory. Option 3 will only delete directories that are empty. |
I think a slight variation on option 2 could be doable too, i.e. only remove recorded directories if they become empty...error otherwise. Or, check whether there is anything in the relevant directories other than what's recorded in the manifest before removing anything? This way one doesn't end up with a partial installation perhaps. I'm not coming up with a scenario of there being post-installation-user-created data under syspath, but that might just be my limited imagination (^^; Not necessarily saying that I think an option 2-ish thing is better, just observing here. |
For the following two repositories / projects, performing
jpm uninstall
here after an installation, leaves behind empty directories in the package cache:Sample session:
Perhaps it has something to do with the use of
:prefix
indeclare-source
?Lines from
project.janet
fromjimmy
:Lines from
project.janet
fromstx
:Janet: 1.30.0-2ac36a05
JPM: 65e218e
OS: Ubuntu Linux 22.0.x
The text was updated successfully, but these errors were encountered: