Commit 8db0c4d4 authored by Dimitri Fontaine's avatar Dimitri Fontaine

Fix the refactoring so that it actually works.

This includes teaching methods that they now work with a symbolp PACKAGE,
some more cleaning up, and some load-path adjustments now that a part of the
code is in a subdirectory (methods).

Also include some of the tests used to convince oneself that the refactoring
didn't break any and all use cases for el-get, with some rough documentation
about how to use them.
parent 7a4a744d
...@@ -13,6 +13,12 @@ ...@@ -13,6 +13,12 @@
;; Please see the README.asciidoc file from the same distribution ;; Please see the README.asciidoc file from the same distribution
(require 'el-get-core) (require 'el-get-core)
(require 'el-get-byte-compile)
;; 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")))
(defun el-get-build-commands (package) (defun el-get-build-commands (package)
"Return a list of build commands for the named PACKAGE. "Return a list of build commands for the named PACKAGE.
...@@ -113,7 +119,6 @@ recursion. ...@@ -113,7 +119,6 @@ recursion.
;; it must be a lambda, just inline its value ;; it must be a lambda, just inline its value
post-build-fun) post-build-fun)
package))))) package)))))
(el-get-start-process-list (el-get-start-process-list
package full-process-list build-info-then-post-build-fun))) package full-process-list build-info-then-post-build-fun)))
...@@ -129,6 +134,7 @@ recursion. ...@@ -129,6 +134,7 @@ recursion.
(let* ((source (el-get-package-def package)) (let* ((source (el-get-package-def package))
(method (el-get-package-method source)) (method (el-get-package-method source))
(infodir (plist-get source :info)) (infodir (plist-get source :info))
(pname (el-get-as-string package))
(pdir (el-get-package-directory package))) (pdir (el-get-package-directory package)))
;; apt-get, pacman and ELPA will set up Info-directory-list ;; apt-get, pacman and ELPA will set up Info-directory-list
...@@ -145,7 +151,7 @@ recursion. ...@@ -145,7 +151,7 @@ recursion.
(infofile (if (and (file-exists-p infodir-abs-conf) (infofile (if (and (file-exists-p infodir-abs-conf)
(not (file-directory-p infodir-abs-conf))) (not (file-directory-p infodir-abs-conf)))
infodir-abs-conf infodir-abs-conf
(concat infodir-abs package)))) (concat infodir-abs pname))))
(cond (cond
((eq build-or-init 'init) ((eq build-or-init 'init)
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
;; Install ;; Install
;; Please see the README.asciidoc file from the same distribution ;; Please see the README.asciidoc file from the same distribution
(require 'el-get-core) (require 'cl) ; yes I like loop
(require 'bytecomp) (require 'bytecomp)
;; Emacs < 24 ;; Emacs < 24
......
...@@ -27,6 +27,10 @@ ...@@ -27,6 +27,10 @@
(defun el-get-verbose-message (format &rest arguments) (defun el-get-verbose-message (format &rest arguments)
(when el-get-verbose (apply 'message format arguments))) (when el-get-verbose (apply 'message format arguments)))
;;
;; el-get-methods support, those are like backends.
;;
(defvar el-get-methods nil (defvar el-get-methods nil
"Register methods that el-get can use to fetch and update a given package. "Register methods that el-get can use to fetch and update a given package.
...@@ -108,7 +112,8 @@ given method." ...@@ -108,7 +112,8 @@ given method."
(defun el-get-package-directory (package) (defun el-get-package-directory (package)
"Return the absolute directory name of the named PACKAGE." "Return the absolute directory name of the named PACKAGE."
(file-name-as-directory (file-name-as-directory
(expand-file-name package (expand-file-name el-get-dir)))) (expand-file-name (el-get-as-string package)
(expand-file-name el-get-dir))))
(defun el-get-add-path-to-list (package list path) (defun el-get-add-path-to-list (package list path)
"(add-to-list LIST PATH) checking for path existence within "(add-to-list LIST PATH) checking for path existence within
......
...@@ -17,6 +17,10 @@ ...@@ -17,6 +17,10 @@
;; ;;
;; NOTE: this will probably benefit from some autoloading magic, later. ;; NOTE: this will probably benefit from some autoloading magic, later.
;; ;;
(add-to-list 'load-path
(expand-file-name
"methods"
(file-name-directory (or load-file-name buffer-file-name))))
(require 'el-get-apt-get) (require 'el-get-apt-get)
(require 'el-get-bzr) (require 'el-get-bzr)
......
...@@ -68,6 +68,13 @@ ...@@ -68,6 +68,13 @@
(loop for (p s) on (el-get-read-all-packages-status) by 'cddr (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-count-packages-with-status (packages &rest status)
"Return how many packages are currently in given status in PACKAGES"
(loop for (p s) on (el-get-read-all-packages-status) by 'cddr
when (and (member (el-get-as-symbol p) packages)
(member s status))
sum 1))
(defun el-get-package-status (package &optional package-status-plist) (defun el-get-package-status (package &optional package-status-plist)
"Return current status of package from given list" "Return current status of package from given list"
(let ((status-plist (or package-status-plist (el-get-read-all-packages-status)))) (let ((status-plist (or package-status-plist (el-get-read-all-packages-status))))
......
...@@ -144,8 +144,33 @@ ...@@ -144,8 +144,33 @@
;;; Code: ;;; Code:
(require 'el-get-core) ;; first some essential variables, used in other parts of the code.
(defgroup el-get nil "el-get customization group"
:group 'convenience)
(defconst el-get-version "4.0.0" "el-get version number")
(defconst el-get-script (or load-file-name buffer-file-name))
(defcustom el-get-dir "~/.emacs.d/el-get/"
"Path where to install the packages."
:group 'el-get
:type 'directory)
(defcustom el-get-status-file
(concat (file-name-as-directory el-get-dir) ".status.el")
"Define where to store and read the package statuses")
(defvar el-get-autoload-file
(concat (file-name-as-directory el-get-dir) ".loaddefs.el")
"Where generated autoloads are saved")
(defvar el-get-emacs (concat invocation-directory invocation-name)
"Where to find the currently running emacs, a facility for :build commands")
;;
;; Now load the rest of the el-get code
;;
(require 'el-get-core) ; core facilities used everywhere (require 'el-get-core) ; core facilities used everywhere
(require 'el-get-custom) ; user tweaks and `el-get-sources' (require 'el-get-custom) ; user tweaks and `el-get-sources'
(require 'el-get-methods) ; support for `el-get-methods', backends (require 'el-get-methods) ; support for `el-get-methods', backends
...@@ -159,11 +184,11 @@ ...@@ -159,11 +184,11 @@
(require 'el-get-autoloads) ; to be removed^W cleaned up next (require 'el-get-autoloads) ; to be removed^W cleaned up next
(defgroup el-get nil "el-get customization group" ;;
:group 'convenience) ;; And then define some more code-level customs. They stay here so that
;; it's easier for elisp programmers to find them and know about them. If
(defconst el-get-version "4.0.0" "el-get version number") ;; that is too lame of an excuse, let's move them to el-get-custom.el.
;;
(defcustom el-get-post-init-hooks nil (defcustom el-get-post-init-hooks nil
"Hooks to run after a package init. "Hooks to run after a package init.
Each hook is a unary function accepting a package" Each hook is a unary function accepting a package"
...@@ -227,29 +252,6 @@ force their evaluation on some packages only." ...@@ -227,29 +252,6 @@ force their evaluation on some packages only."
:group 'el-get :group 'el-get
:type 'boolean) :type 'boolean)
(defconst el-get-script (or load-file-name buffer-file-name))
(defcustom el-get-dir "~/.emacs.d/el-get/"
"Path where to install the packages."
:group 'el-get
:type 'directory)
(defcustom el-get-status-file
(concat (file-name-as-directory el-get-dir) ".status.el")
"Define where to store and read the package statuses")
(defvar el-get-autoload-file
(concat (file-name-as-directory el-get-dir) ".loaddefs.el")
"Where generated autoloads are saved")
(defvar el-get-emacs (concat invocation-directory invocation-name)
"Where to find the currently running emacs, a facility for :build commands")
;; 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")))
(defvar el-get-next-packages nil (defvar el-get-next-packages nil
"List of packages to install next, used when dealing with dependencies.") "List of packages to install next, used when dealing with dependencies.")
...@@ -433,21 +435,23 @@ PACKAGE may be either a string or the corresponding symbol." ...@@ -433,21 +435,23 @@ PACKAGE may be either a string or the corresponding symbol."
(if (el-get-package-is-installed package) (if (el-get-package-is-installed package)
(message "el-get: `%s' package is already installed" package) (message "el-get: `%s' package is already installed" package)
(let* ((packages (el-get-dependencies package))) (let* ((packages (el-get-dependencies (el-get-as-symbol package))))
(when (cdr packages) (when (cdr packages)
;; tweak el-get-post-install-hooks to install remaining packages ;; tweak el-get-post-install-hooks to install remaining packages
;; once the first is installed ;; once the first is installed
(el-get-verbose-message "el-get-install %s: %S" package packages)
(setq el-get-next-packages (cdr packages)) (setq el-get-next-packages (cdr packages))
(add-hook 'el-get-post-install-hooks 'el-get-install-next-packages)) (add-hook 'el-get-post-install-hooks 'el-get-install-next-packages))
(el-get-do-install package)))) (el-get-do-install (car packages)))))
(defun el-get-install-next-packages () (defun el-get-install-next-packages (current-package)
"Run as part of `el-get-post-init-hooks' when dealing with dependencies." "Run as part of `el-get-post-init-hooks' when dealing with dependencies."
(let ((package (pop el-get-next-packages))) (let ((package (pop el-get-next-packages)))
(el-get-verbose-message "el-get-install-next-packages: %s" package)
(if package (if package
(if (el-get-package-is-installed package) (if (el-get-package-is-installed package)
(message "el-get: `%s' package is already installed" package) (message "el-get: `%s' package is already installed" package)
(el-get-do-install package)) (el-get-do-install (el-get-as-string package)))
;; no more packages to install in the dependency walk, clean up ;; no more packages to install in the dependency walk, clean up
(remove-hook 'el-get-post-init-hooks 'el-get-install-next-packages)))) (remove-hook 'el-get-post-init-hooks 'el-get-install-next-packages))))
...@@ -670,35 +674,31 @@ already installed packages is considered." ...@@ -670,35 +674,31 @@ already installed packages is considered."
;; Autoloads path are relative to el-get-dir, so add it to load-path ;; Autoloads path are relative to el-get-dir, so add it to load-path
(add-to-list 'load-path (file-name-as-directory el-get-dir)) (add-to-list 'load-path (file-name-as-directory el-get-dir))
(let ((previously-installing (el-get-currently-installing-packages)) (let* ((packages
(progress (and (eq sync 'wait) ;; (el-get 'sync 'a 'b my-package-list)
(loop for p in packages when (listp p) append p else collect p))
(p-status (el-get-read-all-packages-status))
(total (length packages))
(installed (el-get-count-packages-with-status packages "installed"))
(progress (and (eq sync 'wait)
(make-progress-reporter (make-progress-reporter
"Waiting for `el-get' to complete... " "Waiting for `el-get' to complete... "
0 100 0))) 0 (- total installed) 0)))
(el-get-default-process-sync sync)) (el-get-default-process-sync sync))
;; keep the result of `el-get-init-and-install' to return it even in the ;; keep the result of `el-get-init-and-install' to return it even in the
;; 'wait case ;; 'wait case
(prog1 (prog1
(let ((packages (el-get-init-and-install packages)
;; (el-get 'sync 'a 'b my-package-list)
(loop for p in packages when (listp p) append p else collect p)))
(el-get-init-and-install packages))
;; el-get-do-install is async, that's now ongoing. ;; el-get-install is async, that's now ongoing.
(when progress (when progress
(let* ((newly-installing (while (> (- total installed) 0)
(set-difference (el-get-currently-installing-packages) (sleep-for 0.2)
previously-installing)) ;; don't forget to account for installation failure
(still-installing newly-installing)) (setq installed (el-get-count-packages-with-status packages "installed" "required"))
(progress-reporter-update progress (- total installed)))
(while (> (length still-installing) 0) (progress-reporter-done progress))
(sleep-for 0.2)
(setq still-installing (delete-if-not 'el-get-currently-installing-p still-installing))
(progress-reporter-update
progress
(/ (* 100.0 (- newly-installing still-installing)) newly-installing)))
(progress-reporter-done progress)))
;; unless we have autoloads to update, just load them now ;; unless we have autoloads to update, just load them now
(unless el-get-outdated-autoloads (unless el-get-outdated-autoloads
......
...@@ -53,19 +53,20 @@ ...@@ -53,19 +53,20 @@
"ln -s /usr/share/emacs/site-lisp/package ~/.emacs.d/el-get/package" "ln -s /usr/share/emacs/site-lisp/package ~/.emacs.d/el-get/package"
(let* ((pdir (el-get-package-directory package)) (let* ((pdir (el-get-package-directory package))
(method (el-get-package-method package)) (method (el-get-package-method package))
(pname (el-get-as-string package))
(basedir (cond ((eq method 'apt-get) el-get-apt-get-base) (basedir (cond ((eq method 'apt-get) el-get-apt-get-base)
((eq method 'fink) el-get-fink-base) ((eq method 'fink) el-get-fink-base)
((eq method 'pacman) el-get-pacman-base))) ((eq method 'pacman) el-get-pacman-base)))
(debdir (concat (file-name-as-directory basedir) package))) (debdir (concat (file-name-as-directory basedir) pname)))
(unless (file-directory-p pdir) (unless (file-directory-p pdir)
(shell-command (shell-command
(concat "cd " el-get-dir " && ln -s " debdir " " package))))) (concat "cd " el-get-dir " && ln -s " debdir " " pname)))))
(defun el-get-dpkg-remove-symlink (package) (defun el-get-dpkg-remove-symlink (package)
"rm -f ~/.emacs.d/el-get/package" "rm -f ~/.emacs.d/el-get/package"
(let* ((pdir (el-get-package-directory package))) (let* ((pdir (el-get-package-directory package)))
(when (file-symlink-p pdir) (when (file-symlink-p pdir)
(let ((command (concat "cd " el-get-dir " && rm -f " package))) (let ((command (concat "cd " el-get-dir " && rm -f " pname)))
(message command) (message command)
(shell-command command))))) (shell-command command)))))
...@@ -111,7 +112,7 @@ password prompt." ...@@ -111,7 +112,7 @@ password prompt."
(defun el-get-apt-get-install (package url post-install-fun) (defun el-get-apt-get-install (package url post-install-fun)
"echo $pass | sudo -S apt-get install PACKAGE" "echo $pass | sudo -S apt-get install PACKAGE"
(let* ((source (el-get-package-def package)) (let* ((source (el-get-package-def package))
(pkgname (or (plist-get source :pkgname) package)) (pkgname (or (plist-get source :pkgname) (el-get-as-string package)))
(name (format "*apt-get install %s*" package)) (name (format "*apt-get install %s*" package))
(ok (format "Package %s installed." package)) (ok (format "Package %s installed." package))
(ko (format "Could not install package %s." package))) (ko (format "Could not install package %s." package)))
...@@ -130,7 +131,7 @@ password prompt." ...@@ -130,7 +131,7 @@ password prompt."
(defun el-get-apt-get-remove (package url post-remove-fun) (defun el-get-apt-get-remove (package url post-remove-fun)
"apt-get remove PACKAGE, URL is there for API compliance" "apt-get remove PACKAGE, URL is there for API compliance"
(let* ((source (el-get-package-def package)) (let* ((source (el-get-package-def package))
(pkgname (or (plist-get source :pkgname) package)) (pkgname (or (plist-get source :pkgname) (el-get-as-string package)))
(name (format "*apt-get remove %s*" package)) (name (format "*apt-get remove %s*" package))
(ok (format "Package %s removed." package)) (ok (format "Package %s removed." package))
(ko (format "Could not remove package %s." package))) (ko (format "Could not remove package %s." package)))
......
...@@ -22,16 +22,17 @@ ...@@ -22,16 +22,17 @@
(defun el-get-bzr-branch (package url post-install-fun) (defun el-get-bzr-branch (package url post-install-fun)
"Branch a given bzr PACKAGE following the URL using bzr." "Branch a given bzr PACKAGE following the URL using bzr."
(let* ((bzr-executable (el-get-executable-find "bzr")) (let* ((bzr-executable (el-get-executable-find "bzr"))
(name (format "*bzr branch %s*" package)) (pname (el-get-as-string package))
(ok (format "Package %s installed" package)) (name (format "*bzr branch %s*" 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 (el-get-start-process-list
package package
`((:command-name ,name `((:command-name ,name
:buffer-name ,name :buffer-name ,name
:default-directory ,el-get-dir :default-directory ,el-get-dir
:program ,bzr-executable :program ,bzr-executable
:args ("branch" ,url ,package) :args ("branch" ,url ,pname)
:message ,ok :message ,ok
:error ,ko)) :error ,ko))
post-install-fun))) post-install-fun)))
...@@ -56,7 +57,7 @@ ...@@ -56,7 +57,7 @@
post-update-fun))) post-update-fun)))
(el-get-register-method (el-get-register-method
:bzr #'el-get-bzr-branch el-get-bzr-pull el-get-rmdir :bzr #'el-get-bzr-branch #'el-get-bzr-pull #'el-get-rmdir
el-get-bzr-branch-hook) el-get-bzr-branch-hook)
(provide 'el-get-bzr) (provide 'el-get-bzr)
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
(source (el-get-package-def package)) (source (el-get-package-def package))
(module (plist-get source :module)) (module (plist-get source :module))
(options (plist-get source :options)) (options (plist-get source :options))
(pname (el-get-as-string package))
(name (format "*cvs checkout %s*" package)) (name (format "*cvs checkout %s*" package))
(ok (format "Checked out package %s." package)) (ok (format "Checked out package %s." package))
(ko (format "Could not checkout package %s." package))) (ko (format "Could not checkout package %s." package)))
...@@ -48,7 +49,7 @@ ...@@ -48,7 +49,7 @@
:buffer-name ,name :buffer-name ,name
:default-directory ,el-get-dir :default-directory ,el-get-dir
:program ,cvs-executable :program ,cvs-executable
:args ("-d" ,url "checkout" "-d" ,package ,module) :args ("-d" ,url "checkout" "-d" ,pname ,module)
:message ,ok :message ,ok
:error ,ko)) :error ,ko))
post-install-fun))) post-install-fun)))
......
...@@ -22,16 +22,17 @@ ...@@ -22,16 +22,17 @@
(defun el-get-darcs-get (package url post-install-fun) (defun el-get-darcs-get (package url post-install-fun)
"Get a given PACKAGE following the URL using darcs." "Get a given PACKAGE following the URL using darcs."
(let* ((darcs-executable (el-get-executable-find "darcs")) (let* ((darcs-executable (el-get-executable-find "darcs"))
(name (format "*darcs get %s*" package)) (pname (el-get-as-string package))
(ok (format "Package %s installed" package)) (name (format "*darcs get %s*" 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 (el-get-start-process-list
package package
`((:command-name ,name `((:command-name ,name
:buffer-name ,name :buffer-name ,name
:default-directory ,el-get-dir :default-directory ,el-get-dir
:program ,darcs-executable :program ,darcs-executable
:args ("get" "--lazy" ,url ,package) :args ("get" "--lazy" ,url ,pname)
:message ,ok :message ,ok
:error ,ko)) :error ,ko))
post-install-fun))) post-install-fun)))
......
...@@ -106,7 +106,7 @@ the recipe, then return nil." ...@@ -106,7 +106,7 @@ the recipe, then return nil."
emacs-lisp-mode-hook fundamental-mode-hook prog-mode-hook) emacs-lisp-mode-hook fundamental-mode-hook prog-mode-hook)
(unless p (unless p
(package-refresh-contents))) (package-refresh-contents)))
(package-install (intern package))) (package-install (el-get-as-symbol package)))
;; we symlink even when the package already is installed because it's ;; we symlink even when the package already is installed because it's
;; not an error to have installed ELPA packages before using el-get, and ;; not an error to have installed ELPA packages before using el-get, and
;; that will register them ;; that will register them
...@@ -117,7 +117,7 @@ the recipe, then return nil." ...@@ -117,7 +117,7 @@ the recipe, then return nil."
"Ask elpa to update given PACKAGE." "Ask elpa to update given PACKAGE."
(el-get-elpa-remove package url nil) (el-get-elpa-remove package url nil)
(package-refresh-contents) (package-refresh-contents)
(package-install (intern package)) (package-install (el-get-as-symbol package))
(funcall post-update-fun package)) (funcall post-update-fun package))
(defun el-get-elpa-remove (package url post-remove-fun) (defun el-get-elpa-remove (package url post-remove-fun)
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
;; ;;
(defun el-get-emacsmirror-clone (package url post-install-fun) (defun el-get-emacsmirror-clone (package url post-install-fun)
(let* ((source (el-get-package-def package)) (let* ((source (el-get-package-def package))
(pkgname (or (plist-get source :pkgname) package)) (pkgname (or (plist-get source :pkgname) (el-get-as-string package)))
(url (or url (format el-get-emacsmirror-base-url pkgname)))) (url (or url (format el-get-emacsmirror-base-url pkgname))))
(el-get-git-clone package url post-install-fun))) (el-get-git-clone package url post-install-fun)))
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
"sudo -S fink install PACKAGE" "sudo -S fink install PACKAGE"
(let* ((name (format "*fink install %s*" package)) (let* ((name (format "*fink install %s*" package))
(source (el-get-package-def package)) (source (el-get-package-def package))
(pkgname (or (plist-get source :pkgname) package)) (pkgname (or (plist-get source :pkgname) (el-get-as-string package)))
(ok (format "Package %s installed." package)) (ok (format "Package %s installed." package))
(ko (format "Could not install package %s." package))) (ko (format "Could not install package %s." package)))
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
"apt-get remove PACKAGE. URL is there for API compliance." "apt-get remove PACKAGE. URL is there for API compliance."
(let* ((name (format "*fink remove %s*" package)) (let* ((name (format "*fink remove %s*" package))
(source (el-get-package-def package)) (source (el-get-package-def package))
(pkgname (or (plist-get source :pkgname) package)) (pkgname (or (plist-get source :pkgname) (el-get-as-string package)))
(ok (format "Package %s removed." package)) (ok (format "Package %s removed." package))
(ko (format "Could not remove package %s." package))) (ko (format "Could not remove package %s." package)))
...@@ -76,7 +76,7 @@ ...@@ -76,7 +76,7 @@
(add-hook 'el-get-fink-remove-hook 'el-get-dpkg-remove-symlink) (add-hook 'el-get-fink-remove-hook 'el-get-dpkg-remove-symlink)
(el-get-register (el-get-register-method
:fink :fink
#'el-get-fink-install #'el-get-fink-install #'el-get-fink-remove #'el-get-fink-install #'el-get-fink-install #'el-get-fink-remove
#'el-get-fink-install-hook #'el-get-fink-remove-hook) #'el-get-fink-install-hook #'el-get-fink-remove-hook)
......
...@@ -22,9 +22,10 @@ ...@@ -22,9 +22,10 @@
(defun el-get-git-svn-clone (package url post-install-fun) (defun el-get-git-svn-clone (package url post-install-fun)
"Clone the given svn PACKAGE following the URL using git." "Clone the given svn PACKAGE following the URL using git."
(let ((git-executable (el-get-executable-find "git")) (let ((git-executable (el-get-executable-find "git"))
(name (format "*git svn clone %s*" package)) (pname (el-get-as-string package))
(ok (format "Package %s installed." package)) (name (format "*git svn clone %s*" 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 (el-get-start-process-list
package package
...@@ -32,7 +33,7 @@ ...@@ -32,7 +33,7 @@
:buffer-name ,name :buffer-name ,name
:default-directory ,el-get-dir :default-directory ,el-get-dir
:program ,git-executable :program ,git-executable
:args ( "--no-pager" "svn" "clone" ,url ,package) :args ( "--no-pager" "svn" "clone" ,url ,pname)
:message ,ok :message ,ok
:error ,ko)) :error ,ko))
post-install-fun))) post-install-fun)))
......
...@@ -36,12 +36,13 @@ found." ...@@ -36,12 +36,13 @@ found."
"Clone the given package following the URL." "Clone the given package following the URL."
(let* ((git-executable (el-get-executable-find "git")) (let* ((git-executable (el-get-executable-find "git"))
(pdir (el-get-package-directory package)) (pdir (el-get-package-directory package))
(pname (el-get-as-string package))
(name (format "*git clone %s*" package)) (name (format "*git clone %s*" package))
(source (el-get-package-def package)) (source (el-get-package-def package))
(branch (plist-get source :branch)) (branch (plist-get source :branch))
(args (if branch (args (if branch
(list "--no-pager" "clone" "-b" branch url package) (list "--no-pager" "clone" "-b" branch url pname)
(list "--no-pager" "clone" url package))) (list "--no-pager" "clone" url pname)))
(ok (format "Package %s installed." package)) (ok (format "Package %s installed." package))
(ko (format "Could not install package %s." package))) (ko (format "Could not install package %s." package)))
(el-get-start-process-list (el-get-start-process-list
......
...@@ -22,10 +22,11 @@ ...@@ -22,10 +22,11 @@
(defun el-get-hg-clone (package url post-install-fun) (defun el-get-hg-clone (package url post-install-fun)
"Clone the given package following the URL." "Clone the given package following the URL."
(let* ((hg-executable (el-get-executable-find "hg")) (let* ((hg-executable (el-get-executable-find "hg"))
(pdir (el-get-package-directory package)) (pdir (el-get-package-directory package))
(name (format "*hg clone %s*" package)) (pname (el-get-as-string package))
(ok (format "Package %s installed." package)) (name (format "*hg clone %s*" 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 (el-get-start-process-list
package package
...@@ -33,7 +34,7 @@ ...@@ -33,7 +34,7 @@
:buffer-name ,name :buffer-name ,name
:default-directory ,el-get-dir :default-directory ,el-get-dir
:program ,hg-executable :program ,hg-executable
:args ("clone" ,url ,package) :args ("clone" ,url ,pname)
:message ,ok :message ,ok
:error ,ko)) :error ,ko))
post-install-fun))) post-install-fun)))
......
...@@ -29,7 +29,7 @@ Test url: http://repo.or.cz/w/ShellArchive.git?a=blob_plain;hb=HEAD;f=ack.el" ...@@ -29,7 +29,7 @@ Test url: http://repo.or.cz/w/ShellArchive.git?a=blob_plain;hb=HEAD;f=ack.el"
(defun el-get-http-retrieve-callback (status package post-install-fun &optional dest sources) (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." "Callback function for `url-retrieve', store the emacs lisp file for the package."
(let* ((pdir (el-get-package-directory package)) (let* ((pdir (el-get-package-directory package))
(dest (or dest (concat (file-name-as-directory pdir) package ".el"))) (dest (or dest (format "%s%s.el" (file-name-as-directory pdir) package)))
(part (concat dest ".part")) (part (concat dest ".part"))
(el-get-sources (if sources sources el-get-sources)) (el-get-sources (if sources sources el-get-sources))
(buffer-file-coding-system 'no-conversion) (buffer-file-coding-system 'no-conversion)
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
(defun el-get-pacman-install (package url post-install-fun) (defun el-get-pacman-install (package url post-install-fun)
"echo $pass | sudo -S pacman install PACKAGE" "echo $pass | sudo -S pacman install PACKAGE"
(let* ((source (el-get-package-def package)) (let* ((source (el-get-package-def package))
(pkgname (or (plist-get source :pkgname) package)) (pkgname (or (plist-get source :pkgname) (el-get-as-string package)))
(name (format "*pacman install %s*" package)) (name (format "*pacman install %s*" package))
(ok (format "Package %s installed." package)) (ok (format "Package %s installed." package))
(ko (format "Could not install package %s." package))) (ko (format "Could not install package %s." package)))
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
(defun el-get-pacman-remove (package url post-remove-fun) (defun el-get-pacman-remove (package url post-remove-fun)
"pacman remove PACKAGE, URL is there for API compliance" "pacman remove PACKAGE, URL is there for API compliance"
(let* ((source (el-get-package-def package)) (let* ((source (el-get-package-def package))
(pkgname (or (plist-get source :pkgname) package)) (pkgname (or (plist-get source :pkgname) (el-get-as-string package)))
(name (format "*pacman remove %s*" package)) (name (format "*pacman remove %s*" package))
(ok (format "Package %s removed." package)) (ok (format "Package %s removed." package))
(ko (format "Could not remove package %s." package))) (ko (format "Could not remove package %s." package)))
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
"svn checkout the package." "svn checkout the package."
(let* ((svn-executable (el-get-executable-find "svn")) (let* ((svn-executable (el-get-executable-find "svn"))
(source (el-get-package-def package)) (source (el-get-package-def package))
(pname (el-get-as-string package))
(name (format "*svn checkout %s*" package)) (name (format "*svn checkout %s*" package))
(ok (format "Checked out package %s." package)) (ok (format "Checked out package %s." package))
(ko (format "Could not checkout package %s." package)))