-
Notifications
You must be signed in to change notification settings - Fork 457
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
Fixes for ELPA support #1756
Fixes for ELPA support #1756
Conversation
This also checks if they exist. Which might even be a problem for `package-user-dir' on its own for a fresh GNU Emacs install. * methods/el-get-elpa.el (el-get-elpa-package-directory): Scan all package directories and make sure they exist.
This can happen if the package directory is simply deleted but it is still in the `package-list' and the user tries to re-install the package. It is an error but without the patch the error is caused in `file-relative-name'. * methods/el-get-elpa.el (el-get-elpa-symlink-package): Gracefully error if no directory is found.
Yes, in emacs 24.3 and below we have: |
I attempted a fix for 24.3. I don't have Emacs 24.3 installed, so I have to wait for Travis to retest. |
Simply removing the package directory is no longer enough (and why use `dired' for it?). This will only set the package status to `deleted' but package.el will still think the package is installed and refuse a re-install. Calling `package-delete' will ensure the right thing is done. * methods/el-get-elpa.el (el-get-elpa-post-remove): Call `package-delete' to remove packages.
Ok build passes. It should probably be manually tested for 24.3. E.g.: |
24.3's More serious problems:
(defun package-delete (pkg-desc)
(let ((dir (package-desc-dir pkg-desc)))
(if (not (string-prefix-p (file-name-as-directory
(expand-file-name package-user-dir))
(expand-file-name dir)))
;; Don't delete "system" packages.
(error "Package `%s' is a system package, not deleting"
(package-desc-full-name pkg-desc)) It looks like the only solution is to reimplement our own |
If we implement our own Is the error really an issue? If
Here is a new suggestion
This basically uses the old version (but |
Oh, I mixed up your 1st commit which extends However this could be an issue: el-get used to override
That's probably the right approach. I suspect the dired thing was there because the recursive argument to
Is it correct to delete all package versions? Wouldn't the other versions be the system packages? I'm a bit confused as to what scenarios result in multiple installed package versions... |
This only happens when the user installs
I'm not sure how to handle this case. Maybe we could read the symlink to figure out which version was installed via |
No, it happens when a user installed elpa packages with an el-get from before April 16.
Hmm, maybe we can just leave it as delete all, and see if someone complains. It's hard to envision a situation where it would matter... |
We could consider using EPL https://github.com/cask/epl/ |
Here is what I have so far, I'm not sure if using EPL will work: for instance I see their |
Ah, that bug was fixed, I just had an outdated version. I made a new pull request at #1763. |
The biggest issue is that
el-get-elpa-post-remove
only deletes the package directory. But it won't remove the package from thepackage-alist
which causes package.el to still consider the package installed and thus subsequent attempts to reinstall the package will fail. The patch changes the function to usepackage-delete
instead.Minor issues I had:
el-get-elpa-package-directory
should check if the elpa directory exists. On a fresh install~/.emacs.d/elpa/
might not yet exist and this prevented package installation completely since the directory is queried before install is called. The patch also changes the function to consider packages in the global directoriespackage-directory-list
.While debugging the major issue I also ran into trouble with
el-get-elpa-symlink-package
causing an error infile-relative-name
. I changed it to provide a better error message.