2011-09-20 21:15:52 +08:00
|
|
|
;;; el-get --- Manage the external elisp bits and pieces you depend upon
|
|
|
|
;;
|
|
|
|
;; Copyright (C) 2010-2011 Dimitri Fontaine
|
|
|
|
;;
|
|
|
|
;; Author: Dimitri Fontaine <dim@tapoueh.org>
|
|
|
|
;; URL: http://www.emacswiki.org/emacs/el-get
|
|
|
|
;; GIT: https://github.com/dimitri/el-get
|
|
|
|
;; Licence: WTFPL, grab your copy here: http://sam.zoy.org/wtfpl/
|
|
|
|
;;
|
|
|
|
;; This file is NOT part of GNU Emacs.
|
|
|
|
;;
|
|
|
|
;; Install
|
2013-04-01 20:46:34 +08:00
|
|
|
;; Please see the README.md file from the same distribution
|
2021-01-30 20:17:05 +08:00
|
|
|
|
|
|
|
(require 'cl-lib)
|
2011-09-20 21:15:52 +08:00
|
|
|
(require 'el-get-core)
|
2016-09-01 17:01:46 +08:00
|
|
|
(unless (version< emacs-version "24.4")
|
|
|
|
(require 'subr-x))
|
2011-09-20 21:15:52 +08:00
|
|
|
|
|
|
|
;;
|
|
|
|
;; NOTE: this will probably benefit from some autoloading magic, later.
|
|
|
|
;;
|
2014-10-30 06:28:00 +08:00
|
|
|
(eval-and-compile
|
|
|
|
(add-to-list 'load-path
|
|
|
|
(expand-file-name
|
|
|
|
"methods"
|
|
|
|
(file-name-directory (or load-file-name byte-compile-current-file buffer-file-name)))))
|
2011-09-20 21:15:52 +08:00
|
|
|
|
2016-10-09 06:25:02 +08:00
|
|
|
(defun el-get-insecure-check (package url)
|
2016-09-05 11:51:05 +08:00
|
|
|
"Raise an error if it's not safe to install PACKAGE from URL.
|
|
|
|
|
2016-10-09 10:00:41 +08:00
|
|
|
When `el-get-allow-insecure' is non-nil, check if any of the
|
|
|
|
following are true:
|
2016-09-05 11:51:05 +08:00
|
|
|
|
|
|
|
- URL's protocol is in `el-get-secure-protocols'
|
|
|
|
|
|
|
|
- URL starts with 'file:///' (without hostname), so it points to the
|
|
|
|
local file
|
|
|
|
|
|
|
|
- URL starts with username, i.e. 'username@example.com', also known as
|
|
|
|
SCP-like syntax
|
|
|
|
|
2016-10-09 10:00:41 +08:00
|
|
|
- URL satisfies `file-name-absolute-p'
|
|
|
|
|
2016-09-05 11:51:05 +08:00
|
|
|
- PACKAGE definition has a non-empty :checksum"
|
2016-10-09 06:25:02 +08:00
|
|
|
(unless el-get-allow-insecure
|
2021-01-30 20:17:05 +08:00
|
|
|
(cl-assert (stringp url) nil "URL is nil, can't decide if it's safe to install package '%s'" package)
|
2016-10-09 06:25:02 +08:00
|
|
|
(let* ((checksum (plist-get (el-get-package-def package) :checksum))
|
|
|
|
(checksum-empty (or (not (stringp checksum))
|
|
|
|
(if (fboundp 'string-blank-p)
|
|
|
|
(string-blank-p checksum)
|
|
|
|
(string-match-p "\\`[ \t\n\r]*\\'" checksum)))))
|
2016-10-09 10:00:41 +08:00
|
|
|
(unless (or (string-match "\\`file:///" url)
|
|
|
|
(file-name-absolute-p url)
|
|
|
|
(car (member 0 (mapcar (lambda (secure-proto)
|
|
|
|
(let ((proto-rx (concat "\\`" (regexp-quote secure-proto) "://")))
|
|
|
|
(string-match-p proto-rx url))) el-get-secure-protocols)))
|
|
|
|
(string-match "\\`[-_\.A-Za-z0-9]+@" url))
|
2016-10-09 06:25:02 +08:00
|
|
|
;; With not empty :checksum, we can rely on `el-get-post-install' calling
|
|
|
|
;; `el-get-verify-checksum' for security.
|
|
|
|
(unless (not checksum-empty)
|
|
|
|
(error (concat "Attempting to install PACKAGE "
|
|
|
|
(el-get-as-string package)
|
|
|
|
" from insecure URL " url
|
|
|
|
" without `el-get-allow-insecure'.")))))))
|
2014-08-13 02:42:08 +08:00
|
|
|
|
2011-09-20 21:15:52 +08:00
|
|
|
(require 'el-get-apt-get)
|
2011-10-04 05:13:07 +08:00
|
|
|
(require 'el-get-builtin)
|
2011-11-25 06:47:12 +08:00
|
|
|
(require 'el-get-brew)
|
2011-09-20 21:15:52 +08:00
|
|
|
(require 'el-get-bzr)
|
|
|
|
(require 'el-get-cvs)
|
|
|
|
(require 'el-get-darcs)
|
|
|
|
(require 'el-get-elpa)
|
|
|
|
(require 'el-get-emacsmirror)
|
|
|
|
(require 'el-get-emacswiki)
|
|
|
|
(require 'el-get-fink)
|
|
|
|
(require 'el-get-git)
|
2012-01-18 04:52:32 +08:00
|
|
|
(require 'el-get-github)
|
2011-09-20 21:15:52 +08:00
|
|
|
(require 'el-get-git-svn)
|
2013-12-28 06:00:37 +08:00
|
|
|
(require 'el-get-go)
|
2011-09-20 21:15:52 +08:00
|
|
|
(require 'el-get-hg)
|
|
|
|
(require 'el-get-http)
|
|
|
|
(require 'el-get-http-tar)
|
2012-02-05 13:06:22 +08:00
|
|
|
(require 'el-get-http-zip)
|
2012-02-09 02:16:03 +08:00
|
|
|
(require 'el-get-github-tar)
|
2012-02-09 02:22:40 +08:00
|
|
|
(require 'el-get-github-zip)
|
2011-09-20 21:15:52 +08:00
|
|
|
(require 'el-get-pacman)
|
|
|
|
(require 'el-get-svn)
|
2012-03-17 01:58:52 +08:00
|
|
|
(require 'el-get-fossil)
|
2011-09-20 21:15:52 +08:00
|
|
|
|
|
|
|
(provide 'el-get-methods)
|