Closed dvzubarev closed 6 years ago
Excellent idea, thank you very much for this one!
I'm now on an pacman-based system so I can test that.
Regarding the "find files", I think we can use disply-to-real
Helm attribute to prepend the TRAMP path.
For the caches: actually a "save" mechanism is already used to find dependencies recursively. It's not very pretty at the moment. I suggest we store all the caches in an alist of
(TRAMP-PATH name-cache description-cache)
With the empty TRAMP-PATH ""
being the localhost.
The current cache could be stored in helm-system-packages--tramp-path
or something similar.
For the -deps
functions, we could use a special key or dedicated variables. I've still got to think this through.
Forgot about the shells: yes, it's totally possible to have one Eshell session per host.
We could simply name the buffers *helm-system-packages-shell <TRAMP-PATH>*
or something like that.
Back to work: I tried your suggestion and it works beautifully! Thanks!
Now the first thing to fix before everything else is executable-find
.
I think we should use tramp-find-executable
. The following does not work if I run it
on a TRAMP connection to a pacman host:
(tramp-find-executable (car (tramp-list-connections)) "pacman" exec-path)
Any clue how it works?
Sorry, I misread the output, it actually works.
(if (tramp-tramp-file-p default-directory)
(tramp-find-executable (car (tramp-list-connections)) (car p) nil)
(executable-find (car p)))
Now I need to get the TRAMP connection associated with the default-directory
since I don't think
(car (tramp-list-connections))
will work with multiple TRAMP connections. Do you know how to do that?
OK, found it: (tramp-dissect-file-name default-directory)
will return the current connection structure.
I've pushed the changes to a tramp-support
branch. I've opened a different pull request (#15) to validate the changes.
Closing here.
The first step for working with remote hosts is to replace all call-process with process-file. Now one can run
M-x helm-system-packages
from a remote buffer or a remote dired directory and receive packages from this remote host. Install/uninstall works fine, since eshell supports tramp. I tested only for dpkg, before merging should be tested for all other managers, I suppose. There are few problems left, however:M-x helm-system-packages
from different host. I think we can store the last accessed host in a new variable and if its value doesn't match with the current host, we will reset all caches.Before I continue, I wanted to be sure, that you are interested in supporting tramp in this package.