* Remove ERT and "package" installation in CI
Since Emacs 23 is dropped for quite some time now, remove installation
of ERT and "package", because they are built-in since Emacs 24.
* Remove "prereqs" function left-overs
* Fix Git HTTP smart host detection
regression test test/issues/el-get-issue-1920.el revealed that Git
HTTP smart host detection is broken. Not all hosts support the HEAD
HTTP request method. For example, github.com for HEAD
(let ((url-request-method "HEAD"))
(url-retrieve-synchronously
"https://github.com/dimitri/el-get.git/info/refs\?service\=git-upload-pack"))
responds
HTTP/1.1 405 Method Not Allowed
Server: GitHub Babel 2.0
Content-Type: text/plain
Content-Security-Policy: default-src 'none'; sandbox
Content-Length: 0
X-Frame-Options: DENY
X-GitHub-Request-Id: C1DA:12E32:2B6C9D7:302B1C2:61C9A4E8
while for GET
(let ((url-request-method "GET"))
(url-retrieve-synchronously
"https://github.com/dimitri/el-get.git/info/refs\?service\=git-upload-pack"))
responds
HTTP/1.1 200 OK
Server: GitHub Babel 2.0
Content-Type: application/x-git-upload-pack-advertisement
Content-Security-Policy: default-src 'none'; sandbox
Transfer-Encoding: chunked
expires: Fri, 01 Jan 1980 00:00:00 GMT
pragma: no-cache
Cache-Control: no-cache, max-age=0, must-revalidate
Vary: Accept-Encoding
X-Frame-Options: DENY
X-GitHub-Request-Id: C22C:5E15:3923777:3D822AC:61CA332A
Other hosts like git.sr.ht do support HEAD, of course.
Furthermore, the HTTP status code wasn't checked, that's why hosts
like github.com would be classified as "dumb" hosts.
This commit checks the HTTP status code, and if the status is not 200
or 304 for the HEAD HTTP request method, it tries GET. HEAD is tried
first, because GET might be more expensive for big repositories.
The regression test is adapted as well.
* Fix byte compiler warnings
Many regression tests broke after the removal of "cl", because they
assumed "cl" is implicitly loaded. Others regression tests broke for
other reasons.
The commit fixes _not_ all regression tests. This is meant to be the
first wave.
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.
In Emacs 26, copy-directory copies the directory itself, based on
whether NEWNAME is directory name (ends with a "/"). Earlier Emacs
versions actually checked whether NEWNAME was existing directory, so
we happened to get the right behaviour most of the time.
Pass t for COPY-CONTENTS to ensure the correct behaviour all of the
time.
* 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 Emacs 25.1, a failed cl-assert will always jump to the debugger if
debug-on-error is non-nil. In batch-mode runs this becomes confusing
with the message suppression we have, and the crazy long stack traces
that are printed are really hard to read, so suppress this debugger
behaviour with advice as well.
A couple of recipes that were failing the test snuck in while the test
was accidentally disabled.
* .travis.yml (script):
* test/travis-ci.sh (prereqs): Remove folded_call; it was folding too
much, which made the logs needlessly difficult to read.
* recipes/flycheck-package.rcp (flycheck-package):
* recipes/idle-require.rcp (idle-require): Add :description field.
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.
* .travis.yml:
* test/travis-ci.sh: Don't treat byte-compilation warnings as errors for
downloaded package.el and ert.
* el-get-dependencies.el (el-get-auto-dependencies): Don't use
`read-from-whole-string', it's obsolete in Emacs 25.
* el-get-list-packages.el (el-get-package-menu-sort-by-column): Don't
assume `mouse-select-window' is fbound, it may not be for non-X builds.
Following Emacs' transition to git, the hashes of commits have changed
because some commits were edited to remove bzr specific
referefences (e.g. revnos in commit messages).
Note: the equivalent bzr commit had revno 103620 on trunk, revid
cyd@stupidchicken.com-20110310234046-vzsm4s3pjxc1aids.
First line of commit: "Fix package.el handling of version numbers like
1.0pre6"
* recipes/package.rcp (package):
* test/travis-ci.sh: Update hash for last package.el version compatible
with Emacs 23.
Also skip testing with emacs-snapshot if only recipes have been updated.
* test/run-travis-ci.sh: Deleted.
* test/travis-ci.sh (prereqs, byte-compile, check-recipes,
check-whitespace): New functions.
* .travis.yml (language): emacs-lisp -> generic. emacs-lisp is not
recognized, so Travis would treat it as ruby and needlessly install
rvm.
(install, script): Call functions from travis-ci.sh.