* methods/el-get-elpa.el (package-desc-archive): Define it for old Emacs
versions that don't provide it.
(el-get-elpa-build-local-recipes): Use that instead of hard-coding
offset into package-desc array.
* el-get-methods.el (el-get-insecure-check): Also consider URLs
satisfying `file-name-absolute-p' to be secure. `package-archives' uses
absolute file names *without* file:// prefix, so we have allow this too.
* methods/el-get-elpa.el (el-get-elpa-package-id):
(el-get-elpa-package-archive-base): New compat functions.
* methods/el-get-elpa.el (el-get-elpa-install): Call
`el-get-insecure-check' after ensuring `package-archive-contents' is
initialized.
github method, as a derived method, should build a final repository URL
and let parent's respective methods do the actual work.
Register new 'el-get-github-pull function as update method.
Make both methods, 'el-get-github-pull and 'el-get-github-clone,
implement the same pattern:
- Delegate check if URL is a secure one to the parent method
- Ignore :url from package's recipe passed by 'el-get-do-update as it
makes no sense
- Unconditionally build package repository URL with 'el-get-github-url
- Call respective git method
in name of buffer, rather than el-get package name. Since we write what
looks like the command being executed, "apt-get install FOO", it's
confusing if FOO isn't the actual package being passed to apt-get.
Fixes#2358.
This avoids asking for root priviledges if it's not needed.
* methods/el-get-apt-get.el (el-get-dpkg-package-installed-p): Renamed
from el-get-dpkg-package-status, don't use shell.
(el-get-apt-get-install-if-needed): New function.
(el-get-register-method :apt-get): Use it as :install method.
Escape the value of :description properly generating recipes.
Make auto generation of recipes from package.el descriptors quieter and
faster (forego nice indentation).
Both the http-tar and http-zip methods are modified to manually
verify the checksum before handling the archive. This is a
security precaution and also prevents unexpected consequences from
attempting to work with a corrupted archive file.
The checksum verification code is factored out of el-get-post-install
so that the tar and zip methods can verify using the same code as
other methods.
The auto-generated is simple enough that it's pretty readable without
indentation, and on Emacs 24.4 the indent-region function prints a
message.
Also, since we didn't change to elisp mode, the indentation wasn't doing
anything until now anyway.
* methods/el-get-emacswiki.el (el-get-emacswiki-retrieve-package-list):
Throw error if we didn't get HTTP 2xx.
* el-get-install.el: Show warning if
`el-get-emacswiki-build-local-recipes' fails.
This prevents the sha1 function from attempting and then failing to
encode the buffer contents in the wrong encoding.
* methods/el-get-http.el (el-get-http-compute-checksum): Call `sha1' on
result of `buffer-string', not `current-buffer'.
Using just message makes it too easy to overlook. The warning only
triggers on installation (not update or init) so it shouldn't be too
annoying.
* methods/el-get-apt-get.el (el-get-dpkg-symlink): use lwarn instead of
message.
If the apt-get package doesn't contain any elisp files symlinking to the
non-existant /usr/share/emacs/site-lisp/<package> directory will leave
us with a broken link that will raise an error when we attempt to look
for autoloads, clean stale elc files and the like. In this case, simply
create an empty directory instead of a link.
* methods/el-get-apt-get.el (el-get-dpkg-symlink): call `make-directory'
instead of symlink when `debdir' doesn't exist.
* methods/el-get-elpa.el (el-get-elpa-install-1-package): rename to
el-get-elpa-install-package, take another argument have-deps-p. Only
call package-download-transaction directly if have-deps-p.
(el-get-elpa-install, el-get-elpa-update): el-get-elpa-install{-1
=>}-package name change and new arg.
* 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.