core: change scope of elpa stable variables
make them public when they are used outside of core-configuration-layer.el make them private when they are used only on this file.
This commit is contained in:
parent
e7cd788d06
commit
8a5771559e
10
.lock
10
.lock
|
@ -1,15 +1,15 @@
|
|||
;; -*- mode: emacs-lisp -*-
|
||||
|
||||
(setq configuration-layer--stable-elpa-name "spacelpa")
|
||||
(setq configuration-layer--stable-elpa-version "0.300")
|
||||
(setq configuration-layer-stable-elpa-name "spacelpa")
|
||||
(setq configuration-layer-stable-elpa-version "0.300")
|
||||
|
||||
(setq configuration-layer--elpa-archives
|
||||
(setq configuration-layer-elpa-archives
|
||||
`(("melpa" . "melpa.org/packages/")
|
||||
("org" . "orgmode.org/elpa/")
|
||||
("gnu" . "elpa.gnu.org/packages/")
|
||||
("spacelpa" . ,(concat configuration-layer--stable-elpa-directory
|
||||
("spacelpa" . ,(concat configuration-layer-stable-elpa-directory
|
||||
"spacelpa-"
|
||||
configuration-layer--stable-elpa-version))))
|
||||
configuration-layer-stable-elpa-version))))
|
||||
|
||||
(setq package-archive-priorities
|
||||
'(("spacelpa" . 8)
|
||||
|
|
|
@ -51,13 +51,17 @@
|
|||
(concat spacemacs-start-directory ".lock")
|
||||
"Absolute path to the lock file.")
|
||||
|
||||
(defconst configuration-layer--stable-elpa-gpg-keyring
|
||||
(expand-file-name (concat spacemacs-core-directory "gnupg/spacemacs.pub"))
|
||||
"Absolute path to public GPG key used to signed the ELPA stable repository
|
||||
tarballs.")
|
||||
(defvar configuration-layer-stable-elpa-version spacemacs-version
|
||||
"Version of ELPA stable repository. This value is aimed to be overwritten by
|
||||
the .lock file at the root of the repository.")
|
||||
|
||||
(defconst configuration-layer--stable-elpa-name "spacelpa"
|
||||
"Name of the stable ELPA repository. Should be fixed by the lock file.")
|
||||
(defvar configuration-layer-stable-elpa-name "spacelpa"
|
||||
"Name of the stable ELPA repository. Should be defined in the lock file.")
|
||||
|
||||
(defconst configuration-layer-stable-elpa-directory
|
||||
(expand-file-name
|
||||
(concat spacemacs-cache-directory "stable-elpa/" emacs-version "/"))
|
||||
"Remote location of the tarball for the ELPA stable directory")
|
||||
|
||||
(defconst configuration-layer--stable-elpa-tarball-directory
|
||||
"https://github.com/syl20bnr/spacelpa/archive/"
|
||||
|
@ -67,20 +71,16 @@ tarballs.")
|
|||
"https://github.com/syl20bnr/spacelpa/releases/download/"
|
||||
"Remote location of the signature file for the ELPA stable directory")
|
||||
|
||||
(defconst configuration-layer--stable-elpa-directory
|
||||
(expand-file-name
|
||||
(concat spacemacs-cache-directory "stable-elpa/" emacs-version "/"))
|
||||
"Remote location of the tarball for the ELPA stable directory")
|
||||
(defconst configuration-layer--stable-elpa-gpg-keyring
|
||||
(expand-file-name (concat spacemacs-core-directory "gnupg/spacemacs.pub"))
|
||||
"Absolute path to public GPG key used to signed the ELPA stable repository
|
||||
tarballs.")
|
||||
|
||||
(defconst configuration-layer--stable-elpa-version-file
|
||||
(concat configuration-layer--stable-elpa-directory "version")
|
||||
(concat configuration-layer-stable-elpa-directory "version")
|
||||
"Absolute path to the file containing the current stable elpa repository
|
||||
version")
|
||||
|
||||
(defvar configuration-layer--stable-elpa-version spacemacs-version
|
||||
"Version of ELPA stable repository. This value is aimed to be overwritten by
|
||||
the .lock file at the root of the repository.")
|
||||
|
||||
(defun configuration-layer/elpa-directory (root)
|
||||
"Evaluate the correct package subdirectory of ROOT. This is
|
||||
done according to the value of `dotspacemacs-elpa-subdirectory'.
|
||||
|
@ -340,7 +340,7 @@ is not set for the given SLOT."
|
|||
(unless configuration-layer--package-properties-read-onlyp
|
||||
(eval `(oset pkg ,slot value))))
|
||||
|
||||
(defvar configuration-layer--elpa-archives nil
|
||||
(defvar configuration-layer-elpa-archives nil
|
||||
"List of ELPA archives required by Spacemacs. This value is set by the lock
|
||||
file.")
|
||||
|
||||
|
@ -417,7 +417,7 @@ cache folder.")
|
|||
(configuration-layer/elpa-directory
|
||||
configuration-layer--elpa-root-directory))
|
||||
(setq package-archives (configuration-layer//resolve-package-archives
|
||||
configuration-layer--elpa-archives))
|
||||
configuration-layer-elpa-archives))
|
||||
;; optimization, no need to activate all the packages so early
|
||||
(setq package-enable-at-startup nil)
|
||||
(package-initialize 'noactivate)))
|
||||
|
@ -2446,19 +2446,19 @@ Returns nil if the version is unknown."
|
|||
repository."
|
||||
(format "%sv%s.tar.gz"
|
||||
configuration-layer--stable-elpa-tarball-directory
|
||||
configuration-layer--stable-elpa-version))
|
||||
configuration-layer-stable-elpa-version))
|
||||
|
||||
(defun configuration-layer//stable-elpa-tarball-distant-sign-file ()
|
||||
"Return the absolute path to the signature file."
|
||||
(format "%s/v%s/v%s.tar.gz.sig"
|
||||
configuration-layer--stable-elpa-sig-directory
|
||||
configuration-layer--stable-elpa-version
|
||||
configuration-layer--stable-elpa-version))
|
||||
configuration-layer-stable-elpa-version
|
||||
configuration-layer-stable-elpa-version))
|
||||
|
||||
(defun configuration-layer//stable-elpa-directory ()
|
||||
"Return the local absolute path of the ELPA stable repository."
|
||||
(cdr (assoc configuration-layer--stable-elpa-name
|
||||
configuration-layer--elpa-archives)))
|
||||
(cdr (assoc configuration-layer-stable-elpa-name
|
||||
configuration-layer-elpa-archives)))
|
||||
|
||||
(defun configuration-layer//stable-elpa-tarball-local-file ()
|
||||
"Return the local absolute path for the file of the downloaded tarball of
|
||||
|
@ -2479,7 +2479,7 @@ ELPA stable repository."
|
|||
(with-current-buffer (find-file-noselect archive)
|
||||
;; verify signature
|
||||
(when dotspacemacs-verify-spacelpa-archives
|
||||
(let ((name configuration-layer--stable-elpa-name)
|
||||
(let ((name configuration-layer-stable-elpa-name)
|
||||
(sig-string (with-current-buffer (find-file-noselect sig-file)
|
||||
(buffer-string)))
|
||||
(context (epg-make-context 'OpenPGP))
|
||||
|
@ -2524,15 +2524,15 @@ ELPA stable repository."
|
|||
|
||||
(defun configuration-layer/stable-elpa-download-tarball ()
|
||||
"Download and extract the tarball of the stable ELPA repository if it used."
|
||||
(when (and (assoc configuration-layer--stable-elpa-name
|
||||
configuration-layer--elpa-archives)
|
||||
(when (and (assoc configuration-layer-stable-elpa-name
|
||||
configuration-layer-elpa-archives)
|
||||
(not (string-equal (configuration-layer/stable-elpa-version)
|
||||
configuration-layer--stable-elpa-version)))
|
||||
configuration-layer-stable-elpa-version)))
|
||||
(let ((url (configuration-layer//stable-elpa-tarball-distant-file))
|
||||
(local (configuration-layer//stable-elpa-tarball-local-file))
|
||||
(url-sig (configuration-layer//stable-elpa-tarball-distant-sign-file))
|
||||
(local-sig (configuration-layer//stable-elpa-tarball-local-sign-file))
|
||||
(name configuration-layer--stable-elpa-name))
|
||||
(name configuration-layer-stable-elpa-name))
|
||||
(spacemacs-buffer/set-mode-line
|
||||
(format (concat "Downloading stable ELPA repository: %s... "
|
||||
"(please wait)") name) t)
|
||||
|
@ -2548,7 +2548,7 @@ ELPA stable repository."
|
|||
"http://gnuwin32.sourceforge.net/packages/gzip.htm \n"
|
||||
"%s installation has been skipped!") name)))
|
||||
;; download tarball and detached signature
|
||||
(make-directory configuration-layer--stable-elpa-directory t)
|
||||
(make-directory configuration-layer-stable-elpa-directory t)
|
||||
(url-copy-file url local 'ok-if-already-exists)
|
||||
(when dotspacemacs-verify-spacelpa-archives
|
||||
(url-copy-file url-sig local-sig 'ok-if-already-exists))
|
||||
|
@ -2563,7 +2563,7 @@ ELPA stable repository."
|
|||
configuration-layer--stable-elpa-version-file)
|
||||
(erase-buffer)
|
||||
(beginning-of-buffer)
|
||||
(insert (format "%s" configuration-layer--stable-elpa-version))
|
||||
(insert (format "%s" configuration-layer-stable-elpa-version))
|
||||
(save-buffer)))))))
|
||||
|
||||
;; (configuration-layer/create-elpa-repository
|
||||
|
|
|
@ -34,7 +34,7 @@ Default installation location of the ELPA stable repository is in:
|
|||
If you want to disable the ELPA stable repository put this in your dotfile in
|
||||
the user-init function:
|
||||
|
||||
(setq configuration-layer--elpa-archives
|
||||
(setq configuration-layer-elpa-archives
|
||||
'(("melpa" . "melpa.org/packages/")
|
||||
("org" . "orgmode.org/elpa/")
|
||||
("gnu" . "elpa.gnu.org/packages/")))
|
||||
|
|
|
@ -94,7 +94,7 @@ If you want to use the Ensime backend, you should modify your =~/.spacemacs= to
|
|||
use the recommended Ensime version (Stable). Please add the following lines to
|
||||
=dotspacemacs/user-init=:
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(push '("melpa-stable" . "stable.melpa.org/packages/") configuration-layer--elpa-archives)
|
||||
(push '("melpa-stable" . "stable.melpa.org/packages/") configuration-layer-elpa-archives)
|
||||
(push '(ensime . "melpa-stable") package-pinned-packages)
|
||||
#+END_SRC
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ file.
|
|||
Then, you should modify your =~/.spacemacs= to use the recommended Ensime
|
||||
version (Stable). Please add the following lines to =dotspacemacs/user-init=:
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(push '("melpa-stable" . "stable.melpa.org/packages/") configuration-layer--elpa-archives)
|
||||
(push '("melpa-stable" . "stable.melpa.org/packages/") configuration-layer-elpa-archives)
|
||||
(push '(ensime . "melpa-stable") package-pinned-packages)
|
||||
#+END_SRC
|
||||
|
||||
|
|
Loading…
Reference in a new issue