dimitri / el-get

Manage the external elisp bits and pieces upon which you depend!
http://tapoueh.org/emacs/el-get.html
1.65k stars 457 forks source link

Inconsistent State - el-get removing items at startup. #256

Closed rileyrg closed 13 years ago

rileyrg commented 13 years ago

Somehow while migrating my set up el-get has got itself into an inconsistent state. Now whenever I call el-get its trying to uninstall things I want installed. Unfortunately this is linked with an issue with passwords : its not prompting me for passwords but shooting through assuming I entered a nil password for any apt-get candidates and therefore failing. Could this be linked with me using gpg-agent I wonder?

http://i.imgur.com/O0BOx.png

I tried manually removing then installing the offending packages using el-get-remove and el-get-install but it didnt help. el-get is still trying to remove them at the start (they are in el-get-sources). I will try and note how to get into this state if it continues.

rileyrg commented 13 years ago

On this note I tried deleting the loaddefs and status file. Now it completely fails since it cant cope with directories already existing : it should delete any existing or overwrite them after a suitable prompt.

fatal: destination path 'el-get' already exists and is not an empty directory.

rileyrg commented 13 years ago

Additional note (no error conditions seem to be gracefully handled) : if an install fails then you cant reinstall or update using the provided functions . e.g js2-mode failed with this on the initial install:

svn: Server sent unexpected return value (502 Bad Gateway) in response to OPTIONS request for 'http://js2-mode.googlecode.com/svn/trunk'

But then you cant update with el-get-update as it fails with:-

el-get-installation-failed: Setting current directory: no such file or directory, /home/shamrock/.emacs.d/el-get/js2-mode/

and you cant install again using el-get-install since its removed from the completion candidates since the error during installed wasnt caught gracefully and installation marked as failed. el-get thinks it is installed properly.

baron commented 13 years ago

I agree that the when things fail or become inconsistent, it's hard for el-get to get into a usable state (especially when you use two different computers in two different locations).

Your best bet is to delete the el-get directory, re-install el-get, and restart emacs to let el-get do it over. I have the snippet below for when things screw up.


(defun redo-el-get ()
  (interactive)
  (progn
    (ignore-errors
      (delete-directory "~/.emacs.d/el-get" t))
    (url-retrieve
     "https://github.com/dimitri/el-get/raw/master/el-get-install.el"
     (lambda (s)
       (end-of-buffer)
       (eval-print-last-sexp)))))
rileyrg commented 13 years ago

Possibly, all that needs to happen is that the code doesnt remove the "installed" candidates from the install completions. Ditto for remove. Deleteing everything is somewhat hairy.

dimitri commented 13 years ago

This should be much better now. The packages that are installed/initialized at startup are taken either from an explicit list or from the status of the packages. I'm closing the issue, please do reopen if needed.

I like that the redo-el-get looks simple, but I think it should not end-up in el-get itself, we'd better fix it :)