From b3ecc7f6806f76fd1fe7fd0faca1a26188520185 Mon Sep 17 00:00:00 2001 From: Alex Ott Date: Fri, 7 Jan 2011 13:08:14 +0100 Subject: [PATCH] Reverting "first, naive version of el-get-update-all function" Revert "first, naive version of el-get-update-all function" This reverts commit b6b9b3d1e01c31bc62b99387e14cfa0f67252669. --- el-get.el | 1095 ++++++++++++++++++++++++++--------------------------- 1 file changed, 545 insertions(+), 550 deletions(-) diff --git a/el-get.el b/el-get.el index 873bd6d3..724d9104 100644 --- a/el-get.el +++ b/el-get.el @@ -156,60 +156,60 @@ disable byte-compilation globally." (defcustom el-get-methods '(:git (:install el-get-git-clone - :install-hook el-get-git-clone-hook - :update el-get-git-pull - :remove el-get-rmdir) + :install-hook el-get-git-clone-hook + :update el-get-git-pull + :remove el-get-rmdir) :git-svn (:install el-get-git-svn-clone - :install-hook el-get-git-svn-clone-hook - :update el-get-git-svn-update - :remove el-get-rmdir) + :install-hook el-get-git-svn-clone-hook + :update el-get-git-svn-update + :remove el-get-rmdir) :bzr (:install el-get-bzr-branch - :install-hook el-get-bzr-branch-hook - :update el-get-bzr-pull - :remove el-get-rmdir) + :install-hook el-get-bzr-branch-hook + :update el-get-bzr-pull + :remove el-get-rmdir) :svn (:install el-get-svn-checkout - :install-hook el-get-svn-checkout-hook - :update el-get-svn-update - :remove el-get-rmdir) + :install-hook el-get-svn-checkout-hook + :update el-get-svn-update + :remove el-get-rmdir) :cvs (:install el-get-cvs-checkout - :install-hook el-get-cvs-checkout-hook - :update el-get-cvs-update - :remove el-get-rmdir) + :install-hook el-get-cvs-checkout-hook + :update el-get-cvs-update + :remove el-get-rmdir) :darcs (:install el-get-darcs-get - :install-hook el-get-darcs-get-hook - :update el-get-darcs-pull - :remove el-get-rmdir) + :install-hook el-get-darcs-get-hook + :update el-get-darcs-pull + :remove el-get-rmdir) :apt-get (:install el-get-apt-get-install - :install-hook el-get-apt-get-install-hook - :update el-get-apt-get-install - :remove el-get-apt-get-remove - :remove-hook el-get-apt-get-remove-hook) + :install-hook el-get-apt-get-install-hook + :update el-get-apt-get-install + :remove el-get-apt-get-remove + :remove-hook el-get-apt-get-remove-hook) :fink (:install el-get-fink-install - :install-hook el-get-fink-install-hook - :update el-get-fink-install - :remove el-get-fink-remove - :remove-hook el-get-fink-remove-hook) + :install-hook el-get-fink-install-hook + :update el-get-fink-install + :remove el-get-fink-remove + :remove-hook el-get-fink-remove-hook) :elpa (:install el-get-elpa-install - :install-hook el-get-elpa-install-hook - :update el-get-elpa-update - :remove el-get-elpa-remove - :remove-hook el-get-elpa-remove-hook) + :install-hook el-get-elpa-install-hook + :update el-get-elpa-update + :remove el-get-elpa-remove + :remove-hook el-get-elpa-remove-hook) :http (:install el-get-http-install - :install-hook el-get-http-install-hook - :update el-get-http-install - :remove el-get-rmdir) + :install-hook el-get-http-install-hook + :update el-get-http-install + :remove el-get-rmdir) :ftp (:install el-get-http-install - :install-hook el-get-http-install-hook - :update el-get-http-install - :remove el-get-rmdir) + :install-hook el-get-http-install-hook + :update el-get-http-install + :remove el-get-rmdir) :emacswiki (:install el-get-emacswiki-install - :install-hook el-get-http-install-hook - :update el-get-emacswiki-install - :remove el-get-rmdir) + :install-hook el-get-http-install-hook + :update el-get-emacswiki-install + :remove el-get-rmdir) :http-tar (:install el-get-http-tar-install - :install-hook el-get-http-tar-install-hook - :update el-get-http-tar-install - :remove el-get-rmdir) + :install-hook el-get-http-tar-install-hook + :update el-get-http-tar-install + :remove el-get-rmdir) :pacman (:install el-get-pacman-install :install-hook el-get-pacman-install-hook :update el-get-pacman-install @@ -274,7 +274,7 @@ the named package action in the given method." ;; debian uses ginstall-info and it's compatible to fink's install-info on ;; MacOSX, so: (defvar el-get-install-info (or (executable-find "ginstall-info") - (executable-find "install-info"))) + (executable-find "install-info"))) ;; we support notifications on darwin too, thanks to growlnotify (defvar el-get-growl-notify "/usr/local/bin/growlnotify") @@ -428,7 +428,7 @@ definition provided by `el-get' recipes locally. "Return the list of absolute directory names to be added to `load-path' by the named PACKAGE." (let* ((source (el-get-package-def package)) - (el-path (el-get-flatten (or (plist-get source :load-path) "."))) + (el-path (el-get-flatten (or (plist-get source :load-path) "."))) (pkg-dir (el-get-package-directory package))) (mapcar (lambda (p) (expand-file-name p pkg-dir)) el-path))) @@ -436,7 +436,7 @@ definition provided by `el-get' recipes locally. "Return the function to call for doing action (e.g. install) in given method." (let* ((method (intern-soft (concat ":" (format "%s" method-name)))) - (actions (plist-get el-get-methods method))) + (actions (plist-get el-get-methods method))) (plist-get actions action))) (defun el-get-check-init () @@ -453,10 +453,10 @@ given method." "(add-to-list LIST PATH) checking for path existence within given package directory." (let* ((pdir (el-get-package-directory package)) - (fullpath (expand-file-name (or path ".") pdir))) + (fullpath (expand-file-name (or path ".") pdir))) (unless (file-directory-p fullpath) (error "el-get could not find directory `%s' for package %s, at %s" - path package fullpath)) + path package fullpath)) (add-to-list list fullpath))) (defun el-get-package-exists-p (package) @@ -465,7 +465,7 @@ directory or a symlink in el-get-dir." (let ((pdir (el-get-package-directory package))) ;; seems overkill as file-directory-p will always be true (or (file-directory-p pdir) - (file-symlink-p pdir)))) + (file-symlink-p pdir)))) ;; @@ -475,26 +475,26 @@ directory or a symlink in el-get-dir." "When proc has exited and was successful, chain next command." (when (eq (process-status proc) 'exit) (let ((status (process-exit-status proc)) - (cname (process-get proc :command-name)) - (cbuf (process-get proc :buffer-name)) - (message (process-get proc :message)) - (errorm (process-get proc :error)) - (package (process-get proc :el-get-package)) - (final-f (process-get proc :el-get-final-func)) - (next (process-get proc :el-get-start-process-list)) - (el-get-sources (process-get proc :el-get-sources))) + (cname (process-get proc :command-name)) + (cbuf (process-get proc :buffer-name)) + (message (process-get proc :message)) + (errorm (process-get proc :error)) + (package (process-get proc :el-get-package)) + (final-f (process-get proc :el-get-final-func)) + (next (process-get proc :el-get-start-process-list)) + (el-get-sources (process-get proc :el-get-sources))) (if (not (eq 0 status)) - (progn - (when (process-buffer proc) - (set-window-buffer (selected-window) cbuf)) - (error "el-get: %s %s" cname errorm)) - (message "el-get: %s" message)) + (progn + (when (process-buffer proc) + (set-window-buffer (selected-window) cbuf)) + (error "el-get: %s %s" cname errorm)) + (message "el-get: %s" message)) (when cbuf (kill-buffer cbuf)) (if next - (el-get-start-process-list package next final-f) - (when (functionp final-f) - (funcall final-f package)))))) + (el-get-start-process-list package next final-f) + (when (functionp final-f) + (funcall final-f package)))))) (defvar el-get-default-process-sync nil "Non-nil value asks `el-get-start-process-list' to run current @@ -553,20 +553,20 @@ Any other property will get put into the process object. " (when commands (let* ((c (car commands)) - (cdir (plist-get c :default-directory)) - (cname (plist-get c :command-name)) - (cbuf (plist-get c :buffer-name)) - (killed (when (get-buffer cbuf) (kill-buffer cbuf))) - (filter (plist-get c :process-filter)) - (program (plist-get c :program)) - (args (plist-get c :args)) - (shell (plist-get c :shell)) - (sync (if (plist-member c :sync) (plist-get c :sync) + (cdir (plist-get c :default-directory)) + (cname (plist-get c :command-name)) + (cbuf (plist-get c :buffer-name)) + (killed (when (get-buffer cbuf) (kill-buffer cbuf))) + (filter (plist-get c :process-filter)) + (program (plist-get c :program)) + (args (plist-get c :args)) + (shell (plist-get c :shell)) + (sync (if (plist-member c :sync) (plist-get c :sync) el-get-default-process-sync)) - (default-directory (if cdir - (file-name-as-directory - (expand-file-name cdir)) - default-directory))) + (default-directory (if cdir + (file-name-as-directory + (expand-file-name cdir)) + default-directory))) (if sync (let* ((startf (if shell #'call-process-shell-command #'call-process)) (dummy (message "el-get is waiting for %S to complete" cname)) @@ -575,15 +575,15 @@ Any other property will get put into the process object. (errorm (plist-get c :error)) (next (cdr commands))) (if (eq 0 status) - (message "el-get: %s" message) + (message "el-get: %s" message) (set-window-buffer (selected-window) cbuf) (error "el-get: %s %s" cname errorm)) (when cbuf (kill-buffer cbuf)) (if next - (el-get-start-process-list package next final-func) + (el-get-start-process-list package next final-func) (when (functionp final-func) (funcall final-func package)))) - ;; async case + ;; async case (let* ((startf (if shell #'start-process-shell-command #'start-process)) (process-connection-type nil) ; pipe, don't pretend we're a pty (proc (apply startf cname cbuf program args))) @@ -608,65 +608,65 @@ Any other property will get put into the process object. "Return git executable to use, or signal an error when not found." (let ((git-executable (if (and (boundp 'magit-git-executable) - (file-executable-p magit-git-executable)) - magit-git-executable - (executable-find "git")))) + (file-executable-p magit-git-executable)) + magit-git-executable + (executable-find "git")))) (unless (and git-executable (file-executable-p git-executable)) (error (concat "el-get-git-clone requires `magit-git-executable' to be set, " - "or the binary `git' to be found in your PATH"))) + "or the binary `git' to be found in your PATH"))) git-executable)) (defun el-get-git-clone (package url post-install-fun) "Clone the given package following the URL." (let* ((git-executable (el-get-git-executable)) - (pdir (el-get-package-directory package)) - (name (format "*git clone %s*" package)) - (ok (format "Package %s installed." package)) - (ko (format "Could not install package %s." package))) + (pdir (el-get-package-directory package)) + (name (format "*git clone %s*" package)) + (ok (format "Package %s installed." package)) + (ko (format "Could not install package %s." package))) (el-get-start-process-list package `((:command-name ,name - :buffer-name ,name - :default-directory ,el-get-dir - :program ,git-executable - :args ( "--no-pager" "clone" ,url ,package) - :message ,ok - :error ,ko) + :buffer-name ,name + :default-directory ,el-get-dir + :program ,git-executable + :args ( "--no-pager" "clone" ,url ,package) + :message ,ok + :error ,ko) (:command-name "*git submodule update*" - :buffer-name ,name - :default-directory ,pdir - :program ,git-executable - :args ("--no-pager" "submodule" "update" "--init" "--recursive") - :message "git submodule update ok" - :error "Could not update git submodules")) + :buffer-name ,name + :default-directory ,pdir + :program ,git-executable + :args ("--no-pager" "submodule" "update" "--init" "--recursive") + :message "git submodule update ok" + :error "Could not update git submodules")) post-install-fun))) (defun el-get-git-pull (package url post-update-fun) "git pull the package." (let* ((git-executable (el-get-git-executable)) - (pdir (el-get-package-directory package)) - (name (format "*git pull %s*" package)) - (ok (format "Pulled package %s." package)) - (ko (format "Could not update package %s." package))) + (pdir (el-get-package-directory package)) + (name (format "*git pull %s*" package)) + (ok (format "Pulled package %s." package)) + (ko (format "Could not update package %s." package))) (el-get-start-process-list package `((:command-name ,name - :buffer-name ,name - :default-directory ,pdir - :program ,git-executable - :args ( "--no-pager" "pull") - :message ,ok - :error ,ko) + :buffer-name ,name + :default-directory ,pdir + :program ,git-executable + :args ( "--no-pager" "pull") + :message ,ok + :error ,ko) (:command-name "*git submodule update*" - :buffer-name ,name - :default-directory ,pdir - :program ,git-executable - :args ("--no-pager" "submodule" "update" "--init" "--recursive") - :message "git submodule update ok" - :error "Could not update git submodules")) + :buffer-name ,name + :default-directory ,pdir + :program ,git-executable + :args ("--no-pager" "submodule" "update" "--init" "--recursive") + :message "git submodule update ok" + :error "Could not update git submodules")) post-update-fun))) @@ -676,49 +676,49 @@ found." (defun el-get-git-svn-clone (package url post-install-fun) "Clone the given svn PACKAGE following the URL using git." (let ((git-executable (el-get-git-executable)) - (name (format "*git svn clone %s*" package)) - (ok (format "Package %s installed." package)) - (ko (format "Could not install package %s." package))) + (name (format "*git svn clone %s*" package)) + (ok (format "Package %s installed." package)) + (ko (format "Could not install package %s." package))) (el-get-start-process-list package `((:command-name ,name - :buffer-name ,name - :default-directory ,el-get-dir - :program ,git-executable - :args ( "--no-pager" "svn" "clone" ,url ,package) - :message ,ok - :error ,ko)) + :buffer-name ,name + :default-directory ,el-get-dir + :program ,git-executable + :args ( "--no-pager" "svn" "clone" ,url ,package) + :message ,ok + :error ,ko)) post-install-fun))) (defun el-get-git-svn-update (package url post-update-fun) "Update PACKAGE using git-svn. URL is given for compatibility reasons." (let ((git-executable (el-get-git-executable)) - (pdir (el-get-package-directory package)) - (f-name (format "*git svn fetch %s*" package)) - (f-ok (format "Fetched package %s." package)) - (f-ko (format "Could not fetch package %s." package)) - (r-name (format "*git svn rebase %s*" package)) - (r-ok (format "Rebased package %s." package)) - (r-ko (format "Could not rebase package %s." package))) + (pdir (el-get-package-directory package)) + (f-name (format "*git svn fetch %s*" package)) + (f-ok (format "Fetched package %s." package)) + (f-ko (format "Could not fetch package %s." package)) + (r-name (format "*git svn rebase %s*" package)) + (r-ok (format "Rebased package %s." package)) + (r-ko (format "Could not rebase package %s." package))) (el-get-start-process-list package `((:command-name ,f-name - :buffer-name ,f-name - :default-directory ,pdir - :program ,git-executable - :args ("--no-pager" "svn" "fetch") - :message ,f-ok - :error ,f-ko) + :buffer-name ,f-name + :default-directory ,pdir + :program ,git-executable + :args ("--no-pager" "svn" "fetch") + :message ,f-ok + :error ,f-ko) (:command-name ,r-name - :buffer-name ,r-name - :default-directory ,pdir - :program ,git-executable - :args ("--no-pager" "svn" "rebase") - :message ,r-ok - :error ,r-ko)) + :buffer-name ,r-name + :default-directory ,pdir + :program ,git-executable + :args ("--no-pager" "svn" "rebase") + :message ,r-ok + :error ,r-ko)) post-update-fun))) @@ -728,37 +728,37 @@ found." (defun el-get-bzr-branch (package url post-install-fun) "Branch a given bzr PACKAGE following the URL using bzr." (let* ((bzr-executable "bzr") - (name (format "*bzr branch %s*" package)) - (ok (format "Package %s installed" package)) - (ko (format "Could not install package %s." package))) + (name (format "*bzr branch %s*" package)) + (ok (format "Package %s installed" package)) + (ko (format "Could not install package %s." package))) (el-get-start-process-list package `((:command-name ,name - :buffer-name ,name - :default-directory ,el-get-dir - :program ,bzr-executable - :args ("branch" ,url ,package) - :message ,ok - :error ,ko)) + :buffer-name ,name + :default-directory ,el-get-dir + :program ,bzr-executable + :args ("branch" ,url ,package) + :message ,ok + :error ,ko)) post-install-fun))) (defun el-get-bzr-pull (package url post-update-fun) "bzr pull the package." (let* ((bzr-executable "bzr") - (pdir (el-get-package-directory package)) - (name (format "*bzr pull %s*" package)) - (ok (format "Pulled package %s." package)) - (ko (format "Could not update package %s." package))) + (pdir (el-get-package-directory package)) + (name (format "*bzr pull %s*" package)) + (ok (format "Pulled package %s." package)) + (ko (format "Could not update package %s." package))) (el-get-start-process-list package `((:command-name ,name - :buffer-name ,name - :default-directory ,pdir - :program ,bzr-executable - :args ( "pull" ) - :message ,ok - :error ,ko)) + :buffer-name ,name + :default-directory ,pdir + :program ,bzr-executable + :args ( "pull" ) + :message ,ok + :error ,ko)) post-update-fun))) @@ -768,39 +768,39 @@ found." (defun el-get-svn-checkout (package url post-install-fun) "svn checkout the package." (let* ((svn-executable el-get-svn) - (source (el-get-package-def package)) - (name (format "*svn checkout %s*" package)) - (ok (format "Checked out package %s." package)) - (ko (format "Could not checkout package %s." package))) + (source (el-get-package-def package)) + (name (format "*svn checkout %s*" package)) + (ok (format "Checked out package %s." package)) + (ko (format "Could not checkout package %s." package))) (el-get-start-process-list package `((:command-name ,name - :buffer-name ,name - :default-directory ,el-get-dir - :program ,svn-executable - :args ("checkout" ,url ,package) - :message ,ok - :error ,ko)) + :buffer-name ,name + :default-directory ,el-get-dir + :program ,svn-executable + :args ("checkout" ,url ,package) + :message ,ok + :error ,ko)) post-install-fun))) (defun el-get-svn-update (package url post-update-fun) "update the package using svn." (let* ((svn-executable el-get-svn) - (pdir (el-get-package-directory package)) - (name (format "*svn update %s*" package)) - (ok (format "Updated package %s." package)) - (ko (format "Could not update package %s." package))) + (pdir (el-get-package-directory package)) + (name (format "*svn update %s*" package)) + (ok (format "Updated package %s." package)) + (ko (format "Could not update package %s." package))) (el-get-start-process-list package `((:command-name ,name - :buffer-name ,name - :default-directory ,pdir - :program ,svn-executable - :args ("update") - :message ,ok - :error ,ko)) + :buffer-name ,name + :default-directory ,pdir + :program ,svn-executable + :args ("update") + :message ,ok + :error ,ko)) post-update-fun))) @@ -810,12 +810,12 @@ found." (defun el-get-cvs-checkout (package url post-install-fun) "cvs checkout the package." (let* ((cvs-executable (executable-find "cvs")) - (source (el-get-package-def package)) - (module (plist-get source :module)) - (options (plist-get source :options)) - (name (format "*cvs checkout %s*" package)) - (ok (format "Checked out package %s." package)) - (ko (format "Could not checkout package %s." package))) + (source (el-get-package-def package)) + (module (plist-get source :module)) + (options (plist-get source :options)) + (name (format "*cvs checkout %s*" package)) + (ok (format "Checked out package %s." package)) + (ko (format "Could not checkout package %s." package))) ;; (message "%S" `(:args ("-d" ,url "checkout" "-d" ,package ,module))) ;; (message "el-get-cvs-checkout: %S" (string= options "login")) @@ -823,41 +823,41 @@ found." (el-get-start-process-list package `(,@(when (string= options "login") - `((:command-name ,(format "*cvs login %s*" package) - :buffer-name ,(format "*cvs login %s*" package) - :default-directory ,el-get-dir - :process-filter ,(function el-get-sudo-password-process-filter) - :program ,cvs-executable - :args ("-d" ,url "login") - :message "cvs login" - :error "Could not login against the cvs server"))) + `((:command-name ,(format "*cvs login %s*" package) + :buffer-name ,(format "*cvs login %s*" package) + :default-directory ,el-get-dir + :process-filter ,(function el-get-sudo-password-process-filter) + :program ,cvs-executable + :args ("-d" ,url "login") + :message "cvs login" + :error "Could not login against the cvs server"))) (:command-name ,name - :buffer-name ,name - :default-directory ,el-get-dir - :program ,cvs-executable - :args ("-d" ,url "checkout" "-d" ,package ,module) - :message ,ok - :error ,ko)) + :buffer-name ,name + :default-directory ,el-get-dir + :program ,cvs-executable + :args ("-d" ,url "checkout" "-d" ,package ,module) + :message ,ok + :error ,ko)) post-install-fun))) (defun el-get-cvs-update (package url post-update-fun) "cvs checkout the package." (let* ((cvs-executable (executable-find "cvs")) - (pdir (el-get-package-directory package)) - (name (format "*cvs update %s*" package)) - (ok (format "Updated package %s." package)) - (ko (format "Could not update package %s." package))) + (pdir (el-get-package-directory package)) + (name (format "*cvs update %s*" package)) + (ok (format "Updated package %s." package)) + (ko (format "Could not update package %s." package))) (el-get-start-process-list package `((:command-name ,name - :buffer-name ,name - :default-directory ,pdir - :program ,cvs-executable - :args ("update" "-dP") - :message ,ok - :error ,ko)) + :buffer-name ,name + :default-directory ,pdir + :program ,cvs-executable + :args ("update" "-dP") + :message ,ok + :error ,ko)) post-update-fun))) @@ -875,37 +875,37 @@ found." (defun el-get-darcs-get (package url post-install-fun) "Get a given PACKAGE following the URL using darcs." (let* ((darcs-executable (el-get-darcs-executable)) - (name (format "*darcs get %s*" package)) - (ok (format "Package %s installed" package)) - (ko (format "Could not install package %s." package))) + (name (format "*darcs get %s*" package)) + (ok (format "Package %s installed" package)) + (ko (format "Could not install package %s." package))) (el-get-start-process-list package `((:command-name ,name - :buffer-name ,name - :default-directory ,el-get-dir - :program ,darcs-executable - :args ("get" "--lazy" ,url ,package) - :message ,ok - :error ,ko)) + :buffer-name ,name + :default-directory ,el-get-dir + :program ,darcs-executable + :args ("get" "--lazy" ,url ,package) + :message ,ok + :error ,ko)) post-install-fun))) (defun el-get-darcs-pull (package url post-update-fun) "darcs pull the package." (let* ((darcs-executable (el-get-darcs-executable)) - (pdir (el-get-package-directory package)) - (name (format "*darcs pull %s*" package)) - (ok (format "Pulled package %s." package)) - (ko (format "Could not update package %s." package))) + (pdir (el-get-package-directory package)) + (name (format "*darcs pull %s*" package)) + (ok (format "Pulled package %s." package)) + (ko (format "Could not update package %s." package))) (el-get-start-process-list package `((:command-name ,name - :buffer-name ,name - :default-directory ,pdir - :program ,darcs-executable - :args ( "pull" ) - :message ,ok - :error ,ko)) + :buffer-name ,name + :default-directory ,pdir + :program ,darcs-executable + :args ( "pull" ) + :message ,ok + :error ,ko)) post-update-fun))) @@ -927,11 +927,11 @@ found." (defun el-get-dpkg-symlink (package) "ln -s /usr/share/emacs/site-lisp/package ~/.emacs.d/el-get/package" (let* ((pdir (el-get-package-directory package)) - (method (plist-get (el-get-package-def package) :type)) - (basedir (cond ((eq method 'apt-get) el-get-apt-get-base) - ((eq method 'fink) el-get-fink-base) - ((eq method 'pacman) el-get-pacman-base))) - (debdir (concat (file-name-as-directory basedir) package))) + (method (plist-get (el-get-package-def package) :type)) + (basedir (cond ((eq method 'apt-get) el-get-apt-get-base) + ((eq method 'fink) el-get-fink-base) + ((eq method 'pacman) el-get-pacman-base))) + (debdir (concat (file-name-as-directory basedir) package))) (unless (file-directory-p pdir) (shell-command (concat "cd " el-get-dir " && ln -s " debdir " " package))))) @@ -959,27 +959,27 @@ password prompt." (with-current-buffer (process-buffer proc) ;; arrange to remember already seen content (unless (boundp 'el-get-sudo-password-process-filter-pos) - (make-local-variable 'el-get-sudo-password-process-filter-pos) - (setq el-get-sudo-password-process-filter-pos (point-min))) + (make-local-variable 'el-get-sudo-password-process-filter-pos) + (setq el-get-sudo-password-process-filter-pos (point-min))) ;; first, check about passwords (save-excursion - (goto-char (point-max)) - (insert string) - ;; redirect the subprocess sudo prompt to the user face, and answer it - (goto-char el-get-sudo-password-process-filter-pos) - (while (re-search-forward "password" nil t) - (let* ((prompt (thing-at-point 'line)) - (pass (read-passwd prompt))) - (process-send-string proc (concat pass "\n"))))) + (goto-char (point-max)) + (insert string) + ;; redirect the subprocess sudo prompt to the user face, and answer it + (goto-char el-get-sudo-password-process-filter-pos) + (while (re-search-forward "password" nil t) + (let* ((prompt (thing-at-point 'line)) + (pass (read-passwd prompt))) + (process-send-string proc (concat pass "\n"))))) ;; second, check about "Do you want to continue [Y/n]?" prompts (save-excursion - (while (re-search-forward "Do you want to continue" nil t) - (set-window-buffer (selected-window) (process-buffer proc)) - (let* ((prompt (thing-at-point 'line)) - (cont (yes-or-no-p (concat prompt " ")))) - (process-send-string proc (concat (if cont "y" "n") "\n"))))) + (while (re-search-forward "Do you want to continue" nil t) + (set-window-buffer (selected-window) (process-buffer proc)) + (let* ((prompt (thing-at-point 'line)) + (cont (yes-or-no-p (concat prompt " ")))) + (process-send-string proc (concat (if cont "y" "n") "\n"))))) (setq el-get-sudo-password-process-filter-pos (point-max))))) @@ -988,18 +988,18 @@ password prompt." (let* ((source (el-get-package-def package)) (pkgname (or (plist-get source :pkgname) package)) (name (format "*apt-get install %s*" package)) - (ok (format "Package %s installed." package)) - (ko (format "Could not install package %s." package))) + (ok (format "Package %s installed." package)) + (ko (format "Could not install package %s." package))) (el-get-start-process-list package `((:command-name ,name - :buffer-name ,name - :process-filter ,(function el-get-sudo-password-process-filter) - :program ,(executable-find "sudo") - :args ("-S" ,(executable-find "apt-get") "install" ,pkgname) - :message ,ok - :error ,ko)) + :buffer-name ,name + :process-filter ,(function el-get-sudo-password-process-filter) + :program ,(executable-find "sudo") + :args ("-S" ,(executable-find "apt-get") "install" ,pkgname) + :message ,ok + :error ,ko)) post-install-fun))) (defun el-get-apt-get-remove (package url post-remove-fun) @@ -1007,18 +1007,18 @@ password prompt." (let* ((source (el-get-package-def package)) (pkgname (or (plist-get source :pkgname) package)) (name (format "*apt-get remove %s*" package)) - (ok (format "Package %s removed." package)) - (ko (format "Could not remove package %s." package))) + (ok (format "Package %s removed." package)) + (ko (format "Could not remove package %s." package))) (el-get-start-process-list package `((:command-name ,name - :buffer-name ,name - :process-filter ,(function el-get-sudo-password-process-filter) - :program ,(executable-find "sudo") - :args ("-S" ,(executable-find "apt-get") "remove" "-y" ,pkgname) - :message ,ok - :error ,ko)) + :buffer-name ,name + :process-filter ,(function el-get-sudo-password-process-filter) + :program ,(executable-find "sudo") + :args ("-S" ,(executable-find "apt-get") "remove" "-y" ,pkgname) + :message ,ok + :error ,ko)) post-remove-fun))) (add-hook 'el-get-apt-get-remove-hook 'el-get-dpkg-remove-symlink) @@ -1031,18 +1031,18 @@ password prompt." "sudo -S fink install PACKAGE" (let* ((name (format "*fink install %s*" package)) (pkgname (or (plist-get source :pkgname) package)) - (ok (format "Package %s installed." package)) - (ko (format "Could not install package %s." package))) + (ok (format "Package %s installed." package)) + (ko (format "Could not install package %s." package))) (el-get-start-process-list package `((:command-name ,name - :buffer-name ,name - :process-filter ,(function el-get-sudo-password-process-filter) - :program ,(executable-find "sudo") - :args ("-S" ,(executable-find "fink") "install" ,pkgname) - :message ,ok - :error ,ko)) + :buffer-name ,name + :process-filter ,(function el-get-sudo-password-process-filter) + :program ,(executable-find "sudo") + :args ("-S" ,(executable-find "fink") "install" ,pkgname) + :message ,ok + :error ,ko)) post-install-fun))) (add-hook 'el-get-fink-install-hook 'el-get-dpkg-symlink) @@ -1051,18 +1051,18 @@ password prompt." "apt-get remove PACKAGE. URL is there for API compliance." (let* ((name (format "*fink remove %s*" package)) (pkgname (or (plist-get source :pkgname) package)) - (ok (format "Package %s removed." package)) - (ko (format "Could not remove package %s." package))) + (ok (format "Package %s removed." package)) + (ko (format "Could not remove package %s." package))) (el-get-start-process-list package `((:command-name ,name - :buffer-name ,name - :process-filter ,(function el-get-sudo-password-process-filter) - :program ,(executable-find "sudo") - :args ("-S" ,(executable-find "fink") "-y" "remove" ,pkgname) - :message ,ok - :error ,ko)) + :buffer-name ,name + :process-filter ,(function el-get-sudo-password-process-filter) + :program ,(executable-find "sudo") + :args ("-S" ,(executable-find "fink") "-y" "remove" ,pkgname) + :message ,ok + :error ,ko)) post-remove-fun))) (add-hook 'el-get-fink-remove-hook 'el-get-dpkg-remove-symlink) @@ -1076,19 +1076,19 @@ password prompt." PACKAGE isn't currently installed by ELPA." (let* ((pname (format "%s" package)) ; easy way to cope with symbols etc. - (l - ;; we use try-completion to find the realname of the directory - ;; ELPA used, and this wants an alist, we trick ls -i -1 into - ;; that. - (mapcar 'split-string - (split-string - (shell-command-to-string - (concat - "ls -i1 " - (expand-file-name - (file-name-as-directory package-user-dir))))))) + (l + ;; we use try-completion to find the realname of the directory + ;; ELPA used, and this wants an alist, we trick ls -i -1 into + ;; that. + (mapcar 'split-string + (split-string + (shell-command-to-string + (concat + "ls -i1 " + (expand-file-name + (file-name-as-directory package-user-dir))))))) - (realname (try-completion pname l))) + (realname (try-completion pname l))) (if realname (concat (file-name-as-directory package-user-dir) realname) realname))) @@ -1096,12 +1096,12 @@ PACKAGE isn't currently installed by ELPA." (defun el-get-elpa-symlink-package (package) "ln -s ../elpa/ ~/.emacs.d/el-get/" (let ((elpa-dir (file-relative-name - (el-get-elpa-package-directory package) el-get-dir))) + (el-get-elpa-package-directory package) el-get-dir))) (unless (el-get-package-exists-p package) (message "%s" (shell-command - (concat "cd " el-get-dir - " && ln -s \"" elpa-dir "\" \"" package "\"")))))) + (concat "cd " el-get-dir + " && ln -s \"" elpa-dir "\" \"" package "\"")))))) (defun el-get-elpa-install (package url post-install-fun) "Ask elpa to install given PACKAGE." @@ -1128,7 +1128,7 @@ PACKAGE isn't currently installed by ELPA." "Do remove the ELPA bits for package, now" (let ((p-elpa-dir (el-get-elpa-package-directory package))) (if p-elpa-dir - (dired-delete-file p-elpa-dir 'always) + (dired-delete-file p-elpa-dir 'always) (message "el-get: could not find ELPA dir for %s." package)))) (add-hook 'el-get-elpa-remove-hook 'el-get-elpa-post-remove) @@ -1140,10 +1140,10 @@ PACKAGE isn't currently installed by ELPA." (defun el-get-http-retrieve-callback (status package post-install-fun &optional dest sources) "Callback function for `url-retrieve', store the emacs lisp file for the package." (let* ((pdir (el-get-package-directory package)) - (dest (or dest (concat (file-name-as-directory pdir) package ".el"))) - (part (concat dest ".part")) - (el-get-sources (if sources sources el-get-sources)) - (require-final-newline nil)) + (dest (or dest (concat (file-name-as-directory pdir) package ".el"))) + (part (concat dest ".part")) + (el-get-sources (if sources sources el-get-sources)) + (require-final-newline nil)) ;; prune HTTP headers before save (goto-char (point-min)) (re-search-forward "^$" nil 'move) @@ -1163,10 +1163,10 @@ PACKAGE isn't currently installed by ELPA." Should dest be omitted (nil), the url content will get written into the package :localname option or its `file-name-nondirectory' part." (let* ((pdir (el-get-package-directory package)) - (fname (or (plist-get (el-get-package-def package) :localname) - (file-name-nondirectory url))) - (dest (or dest - (concat (file-name-as-directory pdir) fname)))) + (fname (or (plist-get (el-get-package-def package) :localname) + (file-name-nondirectory url))) + (dest (or dest + (concat (file-name-as-directory pdir) fname)))) (unless (file-directory-p pdir) (make-directory pdir)) @@ -1176,7 +1176,7 @@ into the package :localname option or its `file-name-nondirectory' part." (with-current-buffer (url-retrieve-synchronously url) (el-get-http-retrieve-callback - nil package post-install-fun dest el-get-sources))))) + nil package post-install-fun dest el-get-sources))))) @@ -1196,42 +1196,42 @@ into the package :localname option or its `file-name-nondirectory' part." "Cleanup after tar xzf: if there's only one subdir, move all the files up." (let* ((pdir (el-get-package-directory package)) - (url (plist-get (el-get-package-def package) :url)) - (tarfile (file-name-nondirectory url)) - (files (directory-files pdir nil "[^.]$"))) + (url (plist-get (el-get-package-def package) :url)) + (tarfile (file-name-nondirectory url)) + (files (directory-files pdir nil "[^.]$"))) ;; if there's only one directory, move its content up and get rid of it (message "%S" (remove tarfile files)) (when (null (cdr (remove tarfile files))) (let ((move (format "cd %s && mv \"%s\"/* ." pdir (car files))) - (rmdir (format "cd %s && rmdir \"%s\"" pdir (car files)))) - ;; (message "%s: %s" package move) - ;; (message "%s: %s" package rmdir) - (shell-command move) - (shell-command rmdir))))) + (rmdir (format "cd %s && rmdir \"%s\"" pdir (car files)))) + ;; (message "%s: %s" package move) + ;; (message "%s: %s" package rmdir) + (shell-command move) + (shell-command rmdir))))) (defun el-get-http-tar-install (package url post-install-fun) "Dowload a tar archive package over HTTP." (let* ((source (el-get-package-def package)) - (options (plist-get source :options)) - (pdir (el-get-package-directory package)) - (tarfile (file-name-nondirectory url)) - (dest (concat (file-name-as-directory pdir) tarfile)) - (name (format "*tar %s %s*" options url)) - (ok (format "Package %s installed." package)) - (ko (format "Could not install package %s." package)) - (post `(lambda (package) - ;; tar xzf `basename url` - (let ((el-get-sources '(,@el-get-sources))) - (el-get-start-process-list - package - '((:command-name ,name - :buffer-name ,name - :default-directory ,pdir - :program ,(executable-find "tar") - :args (,@options ,tarfile) - :message ,ok - :error ,ko)) - ,(symbol-function post-install-fun)))))) + (options (plist-get source :options)) + (pdir (el-get-package-directory package)) + (tarfile (file-name-nondirectory url)) + (dest (concat (file-name-as-directory pdir) tarfile)) + (name (format "*tar %s %s*" options url)) + (ok (format "Package %s installed." package)) + (ko (format "Could not install package %s." package)) + (post `(lambda (package) + ;; tar xzf `basename url` + (let ((el-get-sources '(,@el-get-sources))) + (el-get-start-process-list + package + '((:command-name ,name + :buffer-name ,name + :default-directory ,pdir + :program ,(executable-find "tar") + :args (,@options ,tarfile) + :message ,ok + :error ,ko)) + ,(symbol-function post-install-fun)))))) (el-get-http-install package url post dest))) (add-hook 'el-get-http-tar-install-hook 'el-get-http-tar-cleanup-extract-hook) @@ -1247,19 +1247,19 @@ the files up." (let* ((source (el-get-package-def package)) (pkgname (or (plist-get source :pkgname) package)) (name (format "*pacman install %s*" package)) - (ok (format "Package %s installed." package)) - (ko (format "Could not install package %s." package))) + (ok (format "Package %s installed." package)) + (ko (format "Could not install package %s." package))) (el-get-start-process-list package `((:command-name ,name - :buffer-name ,name - :process-filter ,(function el-get-sudo-password-process-filter) - :program ,(executable-find "sudo") - :args ("-S" ,(executable-find "pacman") "--sync" "--noconfirm" "--needed" ,pkgname) - :message ,ok - :error ,ko - :sync t)) + :buffer-name ,name + :process-filter ,(function el-get-sudo-password-process-filter) + :program ,(executable-find "sudo") + :args ("-S" ,(executable-find "pacman") "--sync" "--noconfirm" "--needed" ,pkgname) + :message ,ok + :error ,ko + :sync t)) post-install-fun))) (defun el-get-pacman-remove (package url post-remove-fun) @@ -1267,19 +1267,19 @@ the files up." (let* ((source (el-get-package-def package)) (pkgname (or (plist-get source :pkgname) package)) (name (format "*pacman remove %s*" package)) - (ok (format "Package %s removed." package)) - (ko (format "Could not remove package %s." package))) + (ok (format "Package %s removed." package)) + (ko (format "Could not remove package %s." package))) (el-get-start-process-list package `((:command-name ,name - :buffer-name ,name - :process-filter ,(function el-get-sudo-password-process-filter) - :program ,(executable-find "sudo") - :args ("-S" ,(executable-find "pacman") "--remove" "--noconfirm" ,pkgname) - :message ,ok - :error ,ko - :sync t)) + :buffer-name ,name + :process-filter ,(function el-get-sudo-password-process-filter) + :program ,(executable-find "sudo") + :args ("-S" ,(executable-find "pacman") "--remove" "--noconfirm" ,pkgname) + :message ,ok + :error ,ko + :sync t)) post-remove-fun))) (add-hook 'el-get-pacman-remove-hook 'el-get-dpkg-remove-symlink) @@ -1291,39 +1291,39 @@ the files up." (defun el-get-hg-clone (package url post-install-fun) "Clone the given package following the URL." (let* ((hg-executable "hg") - (pdir (el-get-package-directory package)) - (name (format "*hg clone %s*" package)) - (ok (format "Package %s installed." package)) - (ko (format "Could not install package %s." package))) + (pdir (el-get-package-directory package)) + (name (format "*hg clone %s*" package)) + (ok (format "Package %s installed." package)) + (ko (format "Could not install package %s." package))) (el-get-start-process-list package `((:command-name ,name - :buffer-name ,name - :default-directory ,el-get-dir - :program ,hg-executable - :args ("clone" ,url ,package) - :message ,ok - :error ,ko)) + :buffer-name ,name + :default-directory ,el-get-dir + :program ,hg-executable + :args ("clone" ,url ,package) + :message ,ok + :error ,ko)) post-install-fun))) (defun el-get-hg-pull (package url post-update-fun) "hg pull the package." (let* ((hg-executable "hg") - (pdir (el-get-package-directory package)) - (name (format "*hg pull %s*" package)) - (ok (format "Pulled package %s." package)) - (ko (format "Could not update package %s." package))) + (pdir (el-get-package-directory package)) + (name (format "*hg pull %s*" package)) + (ok (format "Pulled package %s." package)) + (ko (format "Could not update package %s." package))) (el-get-start-process-list package `((:command-name ,name - :buffer-name ,name - :default-directory ,pdir - :program ,hg-executable - :args ("pull" "--update") - :message ,ok - :error ,ko)) + :buffer-name ,name + :default-directory ,pdir + :program ,hg-executable + :args ("pull" "--update") + :message ,ok + :error ,ko)) post-update-fun))) @@ -1334,7 +1334,7 @@ the files up." "Just rm -rf the package directory. Follow symlinks." (let ((pdir (el-get-package-directory package))) (if (file-exists-p pdir) - (dired-delete-file pdir 'always) + (dired-delete-file pdir 'always) (message "el-get could not find package directory \"%s\"" pdir)) (funcall post-remove-fun package))) @@ -1348,48 +1348,48 @@ the files up." file when build-or-init is 'build, or `el-get-set-info-path' when build-or-init is 'init " (let* ((source (el-get-package-def package)) - (method (plist-get source :type)) - (infodir (plist-get source :info)) - (pdir (el-get-package-directory package))) + (method (plist-get source :type)) + (infodir (plist-get source :info)) + (pdir (el-get-package-directory package))) ;; apt-get, pacman and ELPA will take care of Info-directory-list (unless (member method '(elpa apt-get fink pacman)) (let* ((infodir-abs-conf (concat pdir infodir)) - (infodir-abs (file-name-as-directory + (infodir-abs (file-name-as-directory (if (file-directory-p infodir-abs-conf) infodir-abs-conf (file-name-directory infodir-abs-conf)))) - (infodir-rel (if (file-directory-p infodir-abs-conf) - infodir - (file-name-directory infodir))) - (info-dir (concat infodir-abs "dir")) - (infofile (if (and (file-exists-p infodir-abs-conf) - (not (file-directory-p infodir-abs-conf))) - infodir-abs-conf - (concat infodir-abs package)))) + (infodir-rel (if (file-directory-p infodir-abs-conf) + infodir + (file-name-directory infodir))) + (info-dir (concat infodir-abs "dir")) + (infofile (if (and (file-exists-p infodir-abs-conf) + (not (file-directory-p infodir-abs-conf))) + infodir-abs-conf + (concat infodir-abs package)))) - (cond - ((eq build-or-init 'init) - (when (file-exists-p info-dir) - (el-get-set-info-path package infodir-rel))) + (cond + ((eq build-or-init 'init) + (when (file-exists-p info-dir) + (el-get-set-info-path package infodir-rel))) - ((eq build-or-init 'build) - ;; rebuild each time asked --- e.g. on update - (when (and infodir - (file-directory-p infodir-abs) - (not (file-exists-p info-dir))) - (el-get-set-info-path package infodir-rel) - (el-get-build - package - `(,(format "%s %s dir" - el-get-install-info - (if (string= (substring infofile -5) ".info") - infofile - (concat infofile ".info")))) infodir-rel t))) + ((eq build-or-init 'build) + ;; rebuild each time asked --- e.g. on update + (when (and infodir + (file-directory-p infodir-abs) + (not (file-exists-p info-dir))) + (el-get-set-info-path package infodir-rel) + (el-get-build + package + `(,(format "%s %s dir" + el-get-install-info + (if (string= (substring infofile -5) ".info") + infofile + (concat infofile ".info")))) infodir-rel t))) - (t - (error - "el-get-install-or-init-info: %s not supported" build-or-init))))))) + (t + (error + "el-get-install-or-init-info: %s not supported" build-or-init))))))) (defun el-get-build-commands (package) "Return a list of build commands for the named PACKAGE. @@ -1400,8 +1400,8 @@ strings, each string representing a single shell argument." (let* ((source (el-get-package-def package)) (build-type (intern (format ":build/%s" system-type))) (build-commands - (or (plist-get source build-type) - (plist-get source :build)))) + (or (plist-get source build-type) + (plist-get source :build)))) (unless (listp build-commands) (error "build commands for package %s are not a list" package)) @@ -1419,53 +1419,53 @@ That will find the program in current $PATH for you, unless given command name is a relative filename beginning with \"./\", or its absolute filename obtained with expand-file-name is executable." (let ((fullname (expand-file-name name)) - (exe (executable-find name))) + (exe (executable-find name))) (cond ((string-match "^\./" name) name) - ((file-executable-p fullname) fullname) - (t (or exe name))))) + ((file-executable-p fullname) fullname) + (t (or exe name))))) (defun el-get-build (package commands &optional subdir sync post-build-fun) "Run each command from the package directory." (let* ((pdir (el-get-package-directory package)) - (wdir (if subdir (concat (file-name-as-directory pdir) subdir) pdir)) - (buf (format "*el-get-build: %s*" package)) - (default-directory wdir)) + (wdir (if subdir (concat (file-name-as-directory pdir) subdir) pdir)) + (buf (format "*el-get-build: %s*" package)) + (default-directory wdir)) ;; first build the Info dir (el-get-install-or-init-info package 'build) (if sync - (progn - (dolist (c commands) + (progn + (dolist (c commands) (let ((cmd (if (stringp c) c (mapconcat 'shell-quote-argument c " ")))) (message "%S" (shell-command-to-string cmd)))) - (when (and post-build-fun (functionp post-build-fun)) - (funcall post-build-fun))) + (when (and post-build-fun (functionp post-build-fun)) + (funcall post-build-fun))) ;; async (let ((process-list - (mapcar (lambda (c) - (let* ((split (if (stringp c) - (split-string c) + (mapcar (lambda (c) + (let* ((split (if (stringp c) + (split-string c) (mapcar 'shell-quote-argument c))) (c (mapconcat 'identity split " ")) - (name (car split)) - (program (el-get-build-command-program name)) - (args (cdr split))) + (name (car split)) + (program (el-get-build-command-program name)) + (args (cdr split))) - `(:command-name ,name - :buffer-name ,buf - :default-directory ,wdir - :shell t - :program ,program - :args (,@args) - :message ,(format "el-get-build %s: %s ok." package c) - :error ,(format - "el-get could not build %s [%s]" package c)))) - commands))) - (el-get-start-process-list package process-list post-build-fun))))) + `(:command-name ,name + :buffer-name ,buf + :default-directory ,wdir + :shell t + :program ,program + :args (,@args) + :message ,(format "el-get-build %s: %s ok." package c) + :error ,(format + "el-get could not build %s [%s]" package c)))) + commands))) + (el-get-start-process-list package process-list post-build-fun))))) ;; @@ -1480,9 +1480,9 @@ absolute filename obtained with expand-file-name is executable." (defun el-get-read-recipe (package) "Return the source definition for PACKAGE, from the recipes." (loop for dir in el-get-recipe-path - for recipe = (concat (file-name-as-directory dir) package ".el") - if (file-exists-p recipe) - return (el-get-read-recipe-file recipe))) + for recipe = (concat (file-name-as-directory dir) package ".el") + if (file-exists-p recipe) + return (el-get-read-recipe-file recipe))) (defun el-get-read-all-recipes (&optional merge) "Return the list of all the recipes, formatted like `el-get-sources'. @@ -1497,12 +1497,12 @@ get merged to `el-get-sources'." (append (when merge el-get-sources) (loop for dir in el-get-recipe-path - nconc (loop for recipe in (directory-files dir nil "\.el$") - for filename = (concat (file-name-as-directory dir) recipe) - and package = (file-name-sans-extension (file-name-nondirectory recipe)) - unless (member package packages) - do (push package packages) - and collect (el-get-read-recipe-file filename)))))) + nconc (loop for recipe in (directory-files dir nil "\.el$") + for filename = (concat (file-name-as-directory dir) recipe) + and package = (file-name-sans-extension (file-name-nondirectory recipe)) + unless (member package packages) + do (push package packages) + and collect (el-get-read-recipe-file filename)))))) (defun el-get-source-name (source) "Return the package name (stringp) given an `el-get-sources' @@ -1513,23 +1513,23 @@ entry." (defun el-get-package-def (package) "Return a single `el-get-sources' entry for PACKAGE." (let ((source (loop for src in el-get-sources - when (string= package (el-get-source-name src)) - return src))) + when (string= package (el-get-source-name src)) + return src))) (cond ((symbolp source) - ;; we did find only its name, load its definition in the recipes - (el-get-read-recipe package)) + ;; we did find only its name, load its definition in the recipes + (el-get-read-recipe package)) - ((null (plist-get source :type)) - ;; we got a list with no :type, that's an override plist - (loop with def = (el-get-read-recipe package) - for (prop override) on source by 'cddr - do (plist-put def prop override) - finally return def)) + ((null (plist-get source :type)) + ;; we got a list with no :type, that's an override plist + (loop with def = (el-get-read-recipe package) + for (prop override) on source by 'cddr + do (plist-put def prop override) + finally return def)) - ;; none of the previous, must be a full definition - ;; definition - (t source)))) + ;; none of the previous, must be a full definition + ;; definition + (t source)))) ;; @@ -1547,27 +1547,27 @@ entry." "Return the current plist of packages status" (when (file-exists-p el-get-status-file) (car (with-temp-buffer - (insert-file-contents-literally el-get-status-file) - (read-from-string (buffer-string)))))) + (insert-file-contents-literally el-get-status-file) + (read-from-string (buffer-string)))))) (defun el-get-read-package-status (package) "Return the current known status for given package." (plist-get (el-get-read-all-packages-status) - (el-get-package-symbol package))) + (el-get-package-symbol package))) (defun el-get-save-package-status (package status) "Save given package status" (let ((p (el-get-package-symbol package)) - (s (el-get-read-all-packages-status))) + (s (el-get-read-all-packages-status))) (with-temp-file el-get-status-file (insert (format "%S" (if s (plist-put s p status) - `(,p ,status))))))) + `(,p ,status))))))) (defun el-get-count-package-with-status (&rest status) "Return how many packages are currently in given status" (loop for (p s) on (el-get-read-all-packages-status) by 'cddr - if (member s status) sum 1)) + if (member s status) sum 1)) (defun el-get-package-status (package &optional package-status-plist) "Return current status of package from given list" @@ -1580,10 +1580,10 @@ entry." (defun el-get-duplicates (list) "Return duplicates found in list." (loop with dups and once - for elt in list - if (member elt once) collect elt into dups - else collect elt into once - finally return dups)) + for elt in list + if (member elt once) collect elt into dups + else collect elt into once + finally return dups)) ;; @@ -1598,9 +1598,9 @@ entry." "Return package a list of all package names from `el-get-sources'." (let* ((el-get-sources (if merge-recipes (el-get-read-all-recipes 'merge) - el-get-sources)) - (package-name-list (mapcar 'el-get-source-name el-get-sources)) - (duplicates (el-get-duplicates package-name-list))) + el-get-sources)) + (package-name-list (mapcar 'el-get-source-name el-get-sources)) + (duplicates (el-get-duplicates package-name-list))) (when duplicates (error "Please remove duplicates in `el-get-sources': %S." duplicates)) package-name-list)) @@ -1632,7 +1632,7 @@ entry." "byte-compile the file EL if there's no .elc or the source is newer" (let* ((elc (concat (file-name-sans-extension el) ".elc"))) (when (or (not (file-exists-p elc)) - (file-newer-than-file-p el elc)) + (file-newer-than-file-p el elc)) (byte-compile-file el)))) (defun el-get-save-and-kill (file) @@ -1652,7 +1652,7 @@ entry." (unless (file-exists-p file) (write-region (replace-regexp-in-string ";; no-byte-compile: t\n" "" - (autoload-rubric file)) nil file))) + (autoload-rubric file)) nil file))) (defun el-get-load-fast (file) "Load the compiled version of FILE if it exists; else load FILE verbatim" @@ -1708,10 +1708,10 @@ with the named PACKAGE" (when (file-directory-p dir) (dolist (f (directory-files dir t el-get-load-suffix-regexp)) ;; this will clear out any autoloads associated with the file - ;; `autoload-find-destination' signature has changed in emacs24. - (if (> emacs-major-version 23) - (autoload-find-destination f (autoload-file-load-name f)) - (autoload-find-destination f))))))) + ;; `autoload-find-destination' signature has changed in emacs24. + (if (> emacs-major-version 23) + (autoload-find-destination f (autoload-file-load-name f)) + (autoload-find-destination f))))))) (el-get-save-and-kill el-get-autoload-file)) (defvar el-get-autoload-timer nil @@ -1729,7 +1729,7 @@ is nil, marks all installed packages as needing new autoloads." ;; Save the package names for later (mapc (lambda (p) (add-to-list 'el-get-outdated-autoloads p)) (if package (list package) - (mapcar 'el-get-source-name el-get-sources))) + (mapcar 'el-get-source-name el-get-sources))) ;; If we're invalidating everything, try to start from a clean slate (unless package @@ -1752,22 +1752,22 @@ package is not listed in `el-get-sources'" (interactive (list (el-get-read-package-name "Init"))) (unless noerror (el-get-error-unless-package-p package)) (let* ((source (el-get-package-def package)) - (method (plist-get source :type)) - (loads (plist-get source :load)) - (feats (plist-get source :features)) - (el-path (el-get-load-path package)) - (compile (plist-get source :compile)) - (nocomp (and (plist-member source :compile) (not compile))) - (after (plist-get source :after)) - (before (plist-get source :before)) - (pdir (el-get-package-directory package))) + (method (plist-get source :type)) + (loads (plist-get source :load)) + (feats (plist-get source :features)) + (el-path (el-get-load-path package)) + (compile (plist-get source :compile)) + (nocomp (and (plist-member source :compile) (not compile))) + (after (plist-get source :after)) + (before (plist-get source :before)) + (pdir (el-get-package-directory package))) ;; append entries to load-path and Info-directory-list (unless (member method '(elpa apt-get fink pacman)) ;; append entries to load-path (mapc (lambda (path) - (el-get-add-path-to-list package 'load-path path)) - (if (stringp el-path) (list el-path) el-path)) + (el-get-add-path-to-list package 'load-path path)) + (if (stringp el-path) (list el-path) el-path)) ;; and Info-directory-list (el-get-install-or-init-info package 'init)) @@ -1775,7 +1775,7 @@ package is not listed in `el-get-sources'" ;; byte-compile either :compile entries or anything in load-path (let ((byte-compile-warnings nil)) (if compile - ;; only byte-compile what's in the :compile property of the recipe + ;; only byte-compile what's in the :compile property of the recipe (dolist (path (if (listp compile) compile (list compile))) (let ((fp (concat pdir path))) ;; we accept directories, files and file name regexp @@ -1785,7 +1785,7 @@ package is not listed in `el-get-sources'" (dolist (file (directory-files pdir nil path)) (el-get-byte-compile-file (concat pdir file))))))) ;; Compile that directory, unless users asked not to (:compile nil) - ;; or unless we have build instructions (then they should care) + ;; or unless we have build instructions (then they should care) ;; or unless we have installed pre-compiled package (unless (or nocomp (el-get-build-commands package) @@ -1801,23 +1801,23 @@ package is not listed in `el-get-sources'" ;; loads (when loads (mapc (lambda (file) - (let ((pfile (concat pdir file))) - (unless (file-exists-p pfile) - (error "el-get could not find file '%s'" pfile)) - (message "el-get: load '%s'" pfile) - (el-get-load-fast pfile))) - (if (stringp loads) (list loads) loads))) + (let ((pfile (concat pdir file))) + (unless (file-exists-p pfile) + (error "el-get could not find file '%s'" pfile)) + (message "el-get: load '%s'" pfile) + (el-get-load-fast pfile))) + (if (stringp loads) (list loads) loads))) ;; features, only ELPA will handle them on its own (unless (eq method 'elpa) ;; if a feature is provided, require it now (when feats - (mapc (lambda (feat) - (let ((feature (if (stringp feat) (intern feat) feat))) - (message "require '%s" (require feature)))) - (cond ((symbolp feats) (list feats)) - ((stringp feats) (list (intern feats))) - (t feats))))) + (mapc (lambda (feat) + (let ((feature (if (stringp feat) (intern feat) feat))) + (message "require '%s" (require feature)))) + (cond ((symbolp feats) (list feats)) + ((stringp feats) (list (intern feats))) + (t feats))))) ;; call the "after" user function (when (and after (functionp after)) @@ -1836,8 +1836,8 @@ package is not listed in `el-get-sources'" Optional parameter NOERROR, if non-nil, suppresses errors in case package is not listed in `el-get-sources'" (let* ((source (el-get-package-def package)) - (hooks (el-get-method (plist-get source :type) :install-hook)) - (commands (el-get-build-commands package))) + (hooks (el-get-method (plist-get source :type) :install-hook)) + (commands (el-get-build-commands package))) ;; post-install is the right place to run install-hook (run-hook-with-args hooks package) @@ -1861,22 +1861,22 @@ from `el-get-sources'. ;; use dynamic binding to pretend package is part of `el-get-sources' ;; without having to edit the user setup --- that's what C-u is for. (let ((el-get-sources (if current-prefix-arg - (el-get-read-all-recipes 'merge) - el-get-sources))) + (el-get-read-all-recipes 'merge) + el-get-sources))) (el-get-error-unless-package-p package) (let* ((status (el-get-read-package-status package)) - (source (el-get-package-def package)) - (method (plist-get source :type)) - (install (el-get-method method :install)) - (url (plist-get source :url))) + (source (el-get-package-def package)) + (method (plist-get source :type)) + (install (el-get-method method :install)) + (url (plist-get source :url))) (when (string= "installed" status) - (error "Package %s is already installed." package)) + (error "Package %s is already installed." package)) (when (string= "required" status) - (message "Package %s failed to install, removing it first." package) - (el-get-remove package)) + (message "Package %s failed to install, removing it first." package) + (el-get-remove package)) ;; check we can install the package and save to "required" status (el-get-check-init) @@ -1891,13 +1891,13 @@ from `el-get-sources'. (defun el-get-post-update (package) "Post update PACKAGE. This will get run by a sentinel." (let* ((source (el-get-package-def package)) - (commands (el-get-build-commands package))) + (commands (el-get-build-commands package))) (el-get-build package commands nil nil - (lambda (package) - (el-get-init package) - ;; fix trailing failed installs - (when (string= (el-get-read-package-status package) "required") - (el-get-save-package-status package "installed")) + (lambda (package) + (el-get-init package) + ;; fix trailing failed installs + (when (string= (el-get-read-package-status package) "required") + (el-get-save-package-status package "installed")) (run-hook-with-args 'el-get-post-update-hooks package))))) (defun el-get-update (package) @@ -1905,23 +1905,18 @@ from `el-get-sources'. (interactive (list (el-get-read-package-name "Update"))) (el-get-error-unless-package-p package) (let* ((source (el-get-package-def package)) - (method (plist-get source :type)) - (update (el-get-method method :update)) - (url (plist-get source :url)) - (commands (plist-get source :build))) + (method (plist-get source :type)) + (update (el-get-method method :update)) + (url (plist-get source :url)) + (commands (plist-get source :build))) ;; update the package now (funcall update package url 'el-get-post-update) (message "el-get update %s" package))) -(defun el-get-update-all () - (interactive) - "Performs update of all installed packages (specified in el-get-sources)" - (mapc 'el-get-update (el-get-package-name-list))) - (defun el-get-post-remove (package) "Run the post-remove hooks for PACKAGE." (let* ((source (el-get-package-def package)) - (hooks (el-get-method (plist-get source :type) :remove-hook))) + (hooks (el-get-method (plist-get source :type) :remove-hook))) (run-hook-with-args hooks package))) (defun el-get-remove (package) @@ -1933,13 +1928,13 @@ from `el-get-sources'." (interactive (list (el-get-read-package-name "Remove" current-prefix-arg))) ;; see comment in el-get-install (let ((el-get-sources (if current-prefix-arg - (el-get-read-all-recipes 'merge) - el-get-sources))) + (el-get-read-all-recipes 'merge) + el-get-sources))) (el-get-error-unless-package-p package) (let* ((source (el-get-package-def package)) - (method (plist-get source :type)) - (remove (el-get-method method :remove)) - (url (plist-get source :url))) + (method (plist-get source :type)) + (remove (el-get-method method :remove)) + (url (plist-get source :url))) ;; remove the package now (el-get-remove-autoloads package) (funcall remove package url 'el-get-post-remove) @@ -1956,13 +1951,13 @@ from `el-get-sources'." ;; notify user with emacs notifications API (new in 24) ;; (when (and (eq system-type 'darwin) - (not (fboundp 'growl)) - (file-executable-p el-get-growl-notify)) + (not (fboundp 'growl)) + (file-executable-p el-get-growl-notify)) (defun growl (title message) "Send a message to growl, that implements notifications for darwin" (let* ((name "*growl*") - (proc - (start-process name name el-get-growl-notify title "-a" "Emacs"))) + (proc + (start-process name name el-get-growl-notify title "-a" "Emacs"))) (process-send-string proc (concat message "\n")) (process-send-eof proc)))) @@ -1980,25 +1975,25 @@ from `el-get-sources'." ;; else try notify.el, there's a recipe for it (unless (fboundp 'notify) (when (featurep 'notify) - (require 'notify)))) + (require 'notify)))) (cond ((fboundp 'notifications-notify) (notifications-notify :title title - :body message)) - ((fboundp 'notify) (notify title message)) - ((fboundp 'growl) (growl title message)) - (t (message "%s: %s" title message)))) + :body message)) + ((fboundp 'notify) (notify title message)) + ((fboundp 'growl) (growl title message)) + (t (message "%s: %s" title message)))) (when (or (fboundp 'notifications-notify) (fboundp 'notify) (fboundp 'growl)) (defun el-get-post-install-notification (package) "Notify the PACKAGE has been installed." (el-get-notify (format "%s installed" package) - "This package has been installed successfully by el-get.")) + "This package has been installed successfully by el-get.")) (add-hook 'el-get-post-install-hooks 'el-get-post-install-notification) (defun el-get-post-update-notification (package) "Notify the PACKAGE has been updated." (el-get-notify (format "%s updated" package) - "This package has been updated successfully by el-get.")) + "This package has been updated successfully by el-get.")) (add-hook 'el-get-post-update-hooks 'el-get-post-update-notification)) (defun el-get-post-init-message (package) @@ -2040,7 +2035,7 @@ done synchronously, so you will have to wait here. There's `byte-compile' support though, and the packages you use are welcome to use `autoload' too." (unless (or (null sync) - (member sync '(sync wait))) + (member sync '(sync wait))) (error "el-get sync parameter should be either nil, sync or wait")) ;; If there's no autoload file, everything needs to be regenerated. (if (not (file-exists-p el-get-autoload-file)) (el-get-invalidate-autoloads)) @@ -2050,8 +2045,8 @@ welcome to use `autoload' too." (installed (el-get-count-package-with-status "installed")) (progress (and (eq sync 'wait) (make-progress-reporter - "Waiting for `el-get' to complete… " - 0 (- total installed) 0))) + "Waiting for `el-get' to complete… " + 0 (- total installed) 0))) (el-get-default-process-sync sync)) ;; keep the result of mapcar to return it even in the 'wait case (prog1