* methods/el-get-elpa.el (el-get-elpa-install-1-package): new wrapping
function for package-download-transaction.
(el-get-elpa-install, el-get-elpa-update): use it.
Since el-get also downloads dependencies we end up installing things
twice.
* methods/el-get-elpa.el (el-get-elpa-install): call
package-download-transaction instead of package-install.
The current algorithm is
1) If the protocol used is not http (file, ssh, git) clone is supported
2) Otherwise check if repo belongs to know smart host, if so assume
shallow clone is supported
3) If none of the above work, make a HEAD request and parse response
headers to determine the host is smart explained (here)[http://stackoverflow.com/questions/9270488/]
instead of shell-command which is sensitive to the user's choice of
shell.
* el-get-elpa.el (el-get-elpa-symlink-package): use make-symbolic-link
instead of shell-command "ln -s %s %s".
In most cases, we assume any connection is insecure unless the URL
starts with "https://", "$USERNAME@", or "ssh". There are a few
exceptions: I'm assuming all Emacswiki packages are insecure, and I
don't think we can know whether packages installed via Google Go are
secure or not.
When downloading a .gz file, if we actually write-file to that filename
the compressed data would be compressed a second time thanks to
auto-compress-mode. Instead, write to .part file first and then rename
to the destination, as it was before
92a39c84fe.
- If the file was changed on the HTTP server before you restarted emacs,
the checksum wouldn't be recomputed because it would be taken from the
cache.
- The cached value was wrongly including the HTTP headers in the
computation. Added a test for this.
- Computing a SHA1 is not so expensive that it needs the complication of
caching.
* methods/el-get-http.el
(el-get-http-checksums): remove.
(el-get-http-retrieve-callback): don't compute hash on HTTP headers.
(el-get-http-compute-checksum): always compute a fresh hash.
* test/el-get-issue-1752.el: new test.
* methods/el-get-elpa.el
(package-desc-summary, package-desc-version):
make aliases to the new 24.4 names.
(el-get-elpa-delete-package, el-get-elpa-descs): new wrapper functions
to simulate 24.4 behaviour in 24.3 and below.
(el-get-elpa-build-local-recipes, el-get-elpa-post-remove,
el-get-elpa-update-available-p): use the new wrappers/aliases.
In 24.4, simply removing the package directory is no longer enough. This
will only set the package status to `deleted' but package.el will still
think the package is installed and refuse a re-install. Calling
`package-delete' will ensure the right thing is done.
In 24.3 `package-delete' does only remove the directory so we stick with
that, but loading dired is no longer necessary since emacs 23.2 when
`delete-directory' got the optional RECURSIVE parameter.
* methods/el-get-elpa.el (el-get-elpa-post-remove): Call
`package-delete' to remove packages.
This can happen if the package directory is simply deleted but it is
still in the `package-list' and the user tries to re-install the
package. It is an error but without the patch the error is caused in
`file-relative-name'.
* methods/el-get-elpa.el (el-get-elpa-symlink-package): Gracefully error
if no directory is found.
This also checks if they exist. Which might even be a problem for
`package-user-dir' on its own for a fresh GNU Emacs install.
* methods/el-get-elpa.el (el-get-elpa-package-directory): Scan all
package directories and make sure they exist.
It knows argument to eval-after-load is code, and that #' implies
existence of a function.
Some of the package.el functions have changed, but that will be dealt
with separately.
el-get gets the proxy from `url-proxy-services` by
(cadr (assoc "http" url-proxy-services))
However, `url-proxy-services` is an alist which looks like
'(("http" . "hostname:portnumber') ...)
So using `cadr` is wrong. Replace it with `cdr`.
This commit closes dimitri#1615
Since emacswiki recipes might not have an explicit :url in their recipe,
the :compute-checksum method should fallback to the base url, like the
:install and :guess-website methods.
In particular I neglected the fact that I've introduced a conditional
which blocked package-refresh-contents from el-get-elpa-install in some
cases. Practically the smae bug which I attempted to fix, could have
been encountered if packages were installing in opposite order, whcich i
try to reflect in added variant of the test.
Several go related tools can be used within emacs, such as:
gocode, godef, goimports, golint, goflymake, etc.
The el-get-go method lets the 'go get' command take care of
downloading and building such tools. The main advantage is letting
go get take care of resolving dependecies and building the binary,
rather than wedging into the :build property.
Just adding "(require 'package)" to "el-get-elpa-package-directory"
fixes this bug, because by the time any elpa package is being installed
or fetched, package.el has to be available, so all we have to do is load
it if it hasn't already been loaded.
ELPA Package directories are named <package>-<version>. Previously
`el-get-elpa-package-directory' looked for package-dirs using
`all-completions' meaning anything starting with <package> would match.
This is problematic if a package is a prefix of another package, eg the
`s' and `solarized-theme' packages.
Instead of doing that, look for a directory that is precisely
<package>-<version> where <version> is something acceptable to
`version-to-list'.
Fixes#1189.
The package-install function calls some initalization functions from
within the interactive form. This can cause it to fail when called
non-interactively.
package-refresh-contents calls package-read-all-archive-contents so we
don't need to call it explicitly.
Fixes#1389
el-get-elpa-package-directory will not always return a real directory,
since two directories might have the same prefix (for example, erc
installs as `erc-5.3` but has a package name of `erc`. So
`try-completion` will return `erc-` if you have something
like `erc-image` installed.)
`all-completions` will return a list of actual directories which
satisfy the completion, and the `car` of this list will be the package
we want. `when realnames` will return `nil` when there are no possible
completions.
`package-desc-vers' is obsolete (replaced by `package-desc-version')
and `package-alist' has a different layout.
el-get-elpa also calls `el-get-rmdir' in some cases with
post-remove-fun as nil.
* methods/el-get-elpa.el (el-get-elpa-update-available-p): Use
`package-desc-version' if available.
* el-get-core.el (el-get-rmdir): Only call post-remove-fun if non-nil.
Signed-off-by: Rüdiger Sonderfeld <ruediger@c-plusplus.de>