fix(cli): inconsistent system hash between sessions
sxhash doesn't guarantee hashes are consistent across Emacs sessions, so
use md5 instead. Also simplifies what's getting hashed;
`system-configuration` is a sufficient substitute for both `system-type`
and what I wanted to glean from changes in
`system-configuration-features`.
Amend: 80e9263b85
Close: #8030
Ref: #8024
Co-authored-by: yaaama <yaaama@users.noreply.github.com>
This commit is contained in:
parent
83fedf1fff
commit
7f175ab6d9
1 changed files with 3 additions and 2 deletions
|
@ -79,7 +79,7 @@ OPTIONS:
|
||||||
(when (and old-version (not (equal old-version emacs-version)))
|
(when (and old-version (not (equal old-version emacs-version)))
|
||||||
(print! (warn "Emacs version has changed since last sync (from %s to %s)") old-version emacs-version)
|
(print! (warn "Emacs version has changed since last sync (from %s to %s)") old-version emacs-version)
|
||||||
(setq to-rebuild t))
|
(setq to-rebuild t))
|
||||||
(when (and (integerp hash)
|
(when (and (stringp hash)
|
||||||
(not (equal hash (doom-sync--system-hash))))
|
(not (equal hash (doom-sync--system-hash))))
|
||||||
(print! (warn "Your system has changed since last sync"))
|
(print! (warn "Your system has changed since last sync"))
|
||||||
(setq to-rebuild t))
|
(setq to-rebuild t))
|
||||||
|
@ -113,7 +113,8 @@ OPTIONS:
|
||||||
;;; Helpers
|
;;; Helpers
|
||||||
|
|
||||||
(defun doom-sync--system-hash ()
|
(defun doom-sync--system-hash ()
|
||||||
(sxhash (list doom-local-dir system-type system-configuration-features)))
|
(secure-hash
|
||||||
|
'md5 (mapconcat #'identity (list doom-local-dir system-configuration))))
|
||||||
|
|
||||||
(defun doom-sync--abort-warning-h ()
|
(defun doom-sync--abort-warning-h ()
|
||||||
(print! (warn "Script was abruptly aborted, leaving Doom in an incomplete state!"))
|
(print! (warn "Script was abruptly aborted, leaving Doom in an incomplete state!"))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue