Commit Graph

25 Commits

Author SHA1 Message Date
Stephan Creutz
ccca97f226 Replace cl by cl-lib
Since Emacs 27 the package cl is deprecated, the replacement is
cl-lib, which is available since Emacs 24.3.

This patch replaces cl by cl-lib and drops support for Emacs versions
less than 24.3. Dropping older Emacsen is required, because cl-lib is
a builtin starting from version 24.3 and doesn't need an extra package
from ELPA.

Testcases for past issues still contain cl. Most of them seem to be
broken and need further investigation.

This patch is tested with test/run-ert.sh, which outputs:

Ran 10 tests, 10 results as expected, 0 unexpected (2021-01-30 13:24:54+0100, 0.672122 sec)
1 expected failures

and manually by daily usage for a month now.
2021-06-13 16:03:08 +02:00
Noam Postavsky
c00a03a26f Fix secure URL checking for :type elpa
* 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.
2016-10-08 22:00:41 -04:00
Noam Postavsky
facea41fde Skip assert (stringp url) if el-get-allow-insecure
Some methods, :elpa for instance, need some some special handling to
figure out the URL.  In the mean time, don't throw assertion violations
if the user didn't ask to check for "insecure" packages anyway.

* el-get-methods.el (el-get-insecure-check): Move check of
`el-get-allow-insecure' to beginning, before the assertion.  Change the
parameter names to lower case, as is customary in elisp.
2016-10-08 18:25:02 -04:00
Mykola Nikishov
28946c386e Add precondition for 'el-get-insecure-check
When URL parameter is nil, fail fast with explicit reason instead of
throwing wrong-type-argument later on.
2016-09-19 08:42:04 +03:00
Mykola Nikishov
cb02c71181 Customize list of secure URL protocols via 'el-get-secure-protocols 2016-09-06 08:49:29 +03:00
Mykola Nikishov
600ddcee76 Treat 'bzr+ssh', 'git+ssh' and 'sftp' as secure protocols 2016-09-05 06:48:21 +03:00
Mykola Nikishov
17b0da4984 Package with empty :checksum is insecure
For compatibility with Emacs versions before 24.4, fall back to
'string-match if 'string-blank-p from subr-x is not available.
2016-09-05 06:48:18 +03:00
Mykola Nikishov
070dddde7e Consider URL pointing to a local file as secure
URL starting with 'file:///' (hostname is empty) is secure because it
always points to a local file.

OTOH, 'file://example.com/' (with any hostname, including 'localhost'
and '127.0.0.1') is insecure as it may refer to the remote file and
deciding if some hostname is actually a local in given moment in time is
tricky and too error-prone.
2016-09-03 22:22:14 +03:00
Mykola Nikishov
2044e6da76 More clear error message from 'el-get-insecure-check
...because not a package itself but a URL user trying to install it from
is actually insecure. Mention URL in the error message like

    Attempting to install package ag from insecure URL user@ftp://example.com/ without `el-get-allow-insecure

for easier troubleshooting.
2016-09-03 22:22:14 +03:00
Noam Postavsky
94a4a62b92 Fix compilation errors/warnings under elpa
* el-get-list-packages.el (el-get-read-package-status): Declare.
* el-get-status.el (el-get-print-package): Declare.
(el-get-status-cache): Move definition before use.
* el-get-methods.el (add-to-list): Set load-path during compilation too.
2014-10-29 18:28:00 -04:00
Noam Postavsky
ebfcf79cd4 consider recipes with :checksum as "secure"
If the package recipe has a :checksum property no more work is needed:
either the checksum matches in which case we have a trusted version of
the package, or it fails to match (or doesn't have a :compute-checksum
method) so we get an error raised on el-get-post-install.

* el-get-methods.el (el-get-insecure-check): don't raise error if
  package recipe has :checksum property.
2014-10-02 23:00:35 -04:00
Phil Hagelberg
0def3df0e9
Set el-get-allow-insecure to avoid breakage.
This should be changed to nil in a future major release bump.
2014-08-12 20:09:25 -07:00
Phil Hagelberg
acdcb6e5b2
Don't install insecurely without el-get-allow-insecure.
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.
2014-08-12 11:42:08 -07:00
Ryan C. Thompson
cf34f9aa0a Clean up whitespace
This commit is the result of running cleanup-whitespace.sh.

Fixes #549.
2014-02-21 10:52:48 -08:00
Doug MacEachern
e0c220e6fc Add method to install go packages
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.
2013-12-27 15:06:19 -08:00
Victor Deryagin
0a202ea35d changed mentions of 'README.asciidoc' to 'README.md' in source files 2013-04-01 15:46:34 +03:00
Jonathan Leech-Pepin
75f61b2bd1 Fixed quoting error on Linux System and a typo. Added fossil to list of methods.
This commit successfully passes "test/test-recipe.sh vc-fossil".
2012-03-16 13:58:52 -04:00
Ryan C. Thompson
37833f68cb Add github-zip method 2012-02-21 15:05:09 -08:00
Ryan C. Thompson
275004b5a8 Add github-tar method 2012-02-21 15:05:09 -08:00
Ryan C. Thompson
98c5aa8be6 Add github method 2012-02-21 15:02:25 -08:00
Matthew L. Fidler
de5a150d6b Adding http-zip to the el-get-methods 2012-02-04 23:06:22 -06:00
Julien Fantin
9f7df186d4 Homebrew method support 2011-11-24 23:51:13 +01:00
Kyle Hargraves
a54ad73fee Add el-get-builtin method, so builtin packages can be "installed" simply 2011-10-03 16:13:07 -05:00
Dimitri Fontaine
8db0c4d49b 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.
2011-09-22 21:48:11 +02:00
Dimitri Fontaine
0433ca0ce9 Refactoring it all: a beginning. No time for testing yet, just showing ideas. 2011-09-20 15:15:52 +02:00