2018-09-07 21:49:49 -04:00
|
|
|
;; -*- no-byte-compile: t; -*-
|
|
|
|
;;; core/cli/packages.el
|
|
|
|
|
2020-01-09 03:31:05 -05:00
|
|
|
(defcli! (update u)
|
|
|
|
((discard-p ["--discard"] "All local changes to packages are discarded"))
|
2019-07-12 14:16:53 +02:00
|
|
|
"Updates packages.
|
|
|
|
|
2019-08-15 01:34:28 -04:00
|
|
|
This works by fetching all installed package repos and checking the distance
|
|
|
|
between HEAD and FETCH_HEAD. This can take a while.
|
|
|
|
|
2019-07-12 14:16:53 +02:00
|
|
|
This excludes packages whose `package!' declaration contains a non-nil :freeze
|
Rewrite core-cli
Highlights:
- 'doom purge' now purges builds, elpa packages, and repos by default.
Regrafting repos is now opt-in with the -g/--regraft switches.
Negation flags have been added for elpa/repos: -e/--no-elpa and
-r/--no-repos.
- Removed 'doom rebuild' (it is now just 'doom build' or 'doom b').
- Removed 'doom build's -f flag, this is now the default. Added the -r
flag instead, which only builds packages that need rebuilding.
- 'doom update' now updates packages synchronously, but produces more
informative output about the updating process.
- Straight can now prompt in batch mode, which resolves a lot of issues
with 'doom update' (and 'doom upgrade') freezing indefinitely or
throwing repo branch errors.
- 'bin/doom's switches are now positional. Switches aimed at `bin/doom`
must precede any subcommands. e.g.
Do: 'doom -yd upgrade'
Don't do: 'doom upgrade -yd'
- Moved 'doom doctor' from bin/doom-doctor to core/cli/doctor, and
integrated core/doctor.el into it, as to avoid naming conflicts
between it and Emacs doctor.
- The defcli! macro now has a special syntax for declaring flags, their
arguments and descriptions.
Addresses #1981, #1925, #1816, #1721, #1322
2019-11-07 15:59:56 -05:00
|
|
|
or :ignore property."
|
|
|
|
(straight-check-all)
|
2020-01-09 03:31:05 -05:00
|
|
|
(let ((doom-auto-discard discard-p))
|
|
|
|
(doom-cli-reload-core-autoloads)
|
|
|
|
(when (doom-cli-packages-update)
|
|
|
|
(doom-cli-reload-package-autoloads))
|
|
|
|
t))
|
2019-07-21 15:39:45 +02:00
|
|
|
|
Rewrite core-cli
Highlights:
- 'doom purge' now purges builds, elpa packages, and repos by default.
Regrafting repos is now opt-in with the -g/--regraft switches.
Negation flags have been added for elpa/repos: -e/--no-elpa and
-r/--no-repos.
- Removed 'doom rebuild' (it is now just 'doom build' or 'doom b').
- Removed 'doom build's -f flag, this is now the default. Added the -r
flag instead, which only builds packages that need rebuilding.
- 'doom update' now updates packages synchronously, but produces more
informative output about the updating process.
- Straight can now prompt in batch mode, which resolves a lot of issues
with 'doom update' (and 'doom upgrade') freezing indefinitely or
throwing repo branch errors.
- 'bin/doom's switches are now positional. Switches aimed at `bin/doom`
must precede any subcommands. e.g.
Do: 'doom -yd upgrade'
Don't do: 'doom upgrade -yd'
- Moved 'doom doctor' from bin/doom-doctor to core/cli/doctor, and
integrated core/doctor.el into it, as to avoid naming conflicts
between it and Emacs doctor.
- The defcli! macro now has a special syntax for declaring flags, their
arguments and descriptions.
Addresses #1981, #1925, #1816, #1721, #1322
2019-11-07 15:59:56 -05:00
|
|
|
(defcli! (build b)
|
|
|
|
((rebuild-p ["-r"] "Only rebuild packages that need rebuilding"))
|
|
|
|
"Byte-compiles & symlinks installed packages.
|
2019-07-21 15:39:45 +02:00
|
|
|
|
|
|
|
This ensures that all needed files are symlinked from their package repo and
|
Rewrite core-cli
Highlights:
- 'doom purge' now purges builds, elpa packages, and repos by default.
Regrafting repos is now opt-in with the -g/--regraft switches.
Negation flags have been added for elpa/repos: -e/--no-elpa and
-r/--no-repos.
- Removed 'doom rebuild' (it is now just 'doom build' or 'doom b').
- Removed 'doom build's -f flag, this is now the default. Added the -r
flag instead, which only builds packages that need rebuilding.
- 'doom update' now updates packages synchronously, but produces more
informative output about the updating process.
- Straight can now prompt in batch mode, which resolves a lot of issues
with 'doom update' (and 'doom upgrade') freezing indefinitely or
throwing repo branch errors.
- 'bin/doom's switches are now positional. Switches aimed at `bin/doom`
must precede any subcommands. e.g.
Do: 'doom -yd upgrade'
Don't do: 'doom upgrade -yd'
- Moved 'doom doctor' from bin/doom-doctor to core/cli/doctor, and
integrated core/doctor.el into it, as to avoid naming conflicts
between it and Emacs doctor.
- The defcli! macro now has a special syntax for declaring flags, their
arguments and descriptions.
Addresses #1981, #1925, #1816, #1721, #1322
2019-11-07 15:59:56 -05:00
|
|
|
their elisp files are byte-compiled. This is especially necessary if you upgrade
|
|
|
|
Emacs (as byte-code is generally not forward-compatible)."
|
|
|
|
(when (doom-cli-packages-build (not rebuild-p))
|
2020-01-01 13:31:40 -05:00
|
|
|
(doom-cli-reload-package-autoloads))
|
Rewrite core-cli
Highlights:
- 'doom purge' now purges builds, elpa packages, and repos by default.
Regrafting repos is now opt-in with the -g/--regraft switches.
Negation flags have been added for elpa/repos: -e/--no-elpa and
-r/--no-repos.
- Removed 'doom rebuild' (it is now just 'doom build' or 'doom b').
- Removed 'doom build's -f flag, this is now the default. Added the -r
flag instead, which only builds packages that need rebuilding.
- 'doom update' now updates packages synchronously, but produces more
informative output about the updating process.
- Straight can now prompt in batch mode, which resolves a lot of issues
with 'doom update' (and 'doom upgrade') freezing indefinitely or
throwing repo branch errors.
- 'bin/doom's switches are now positional. Switches aimed at `bin/doom`
must precede any subcommands. e.g.
Do: 'doom -yd upgrade'
Don't do: 'doom upgrade -yd'
- Moved 'doom doctor' from bin/doom-doctor to core/cli/doctor, and
integrated core/doctor.el into it, as to avoid naming conflicts
between it and Emacs doctor.
- The defcli! macro now has a special syntax for declaring flags, their
arguments and descriptions.
Addresses #1981, #1925, #1816, #1721, #1322
2019-11-07 15:59:56 -05:00
|
|
|
t)
|
|
|
|
|
|
|
|
(defcli! (purge p)
|
|
|
|
((nobuilds-p ["-b" "--no-builds"] "Don't purge unneeded (built) packages")
|
|
|
|
(noelpa-p ["-p" "--no-elpa"] "Don't purge ELPA packages")
|
|
|
|
(norepos-p ["-r" "--no-repos"] "Don't purge unused straight repos")
|
|
|
|
(regraft-p ["-g" "--regraft"] "Regraft git repos (ie. compact them)"))
|
|
|
|
"Deletes orphaned packages & repos, and compacts them.
|
|
|
|
|
|
|
|
Purges all installed ELPA packages (as they are considered temporary). Purges
|
|
|
|
all orphaned package repos and builds. If -g/--regraft is supplied, the git
|
|
|
|
repos among them will be regrafted and compacted to ensure they are as small as
|
|
|
|
possible.
|
|
|
|
|
|
|
|
It is a good idea to occasionally run this doom purge -g to ensure your package
|
|
|
|
list remains lean."
|
|
|
|
(straight-check-all)
|
|
|
|
(when (doom-cli-packages-purge
|
|
|
|
(not noelpa-p)
|
|
|
|
(not norepos-p)
|
|
|
|
(not nobuilds-p)
|
|
|
|
regraft-p)
|
2020-01-01 13:31:40 -05:00
|
|
|
(doom-cli-reload-package-autoloads))
|
Rewrite core-cli
Highlights:
- 'doom purge' now purges builds, elpa packages, and repos by default.
Regrafting repos is now opt-in with the -g/--regraft switches.
Negation flags have been added for elpa/repos: -e/--no-elpa and
-r/--no-repos.
- Removed 'doom rebuild' (it is now just 'doom build' or 'doom b').
- Removed 'doom build's -f flag, this is now the default. Added the -r
flag instead, which only builds packages that need rebuilding.
- 'doom update' now updates packages synchronously, but produces more
informative output about the updating process.
- Straight can now prompt in batch mode, which resolves a lot of issues
with 'doom update' (and 'doom upgrade') freezing indefinitely or
throwing repo branch errors.
- 'bin/doom's switches are now positional. Switches aimed at `bin/doom`
must precede any subcommands. e.g.
Do: 'doom -yd upgrade'
Don't do: 'doom upgrade -yd'
- Moved 'doom doctor' from bin/doom-doctor to core/cli/doctor, and
integrated core/doctor.el into it, as to avoid naming conflicts
between it and Emacs doctor.
- The defcli! macro now has a special syntax for declaring flags, their
arguments and descriptions.
Addresses #1981, #1925, #1816, #1721, #1322
2019-11-07 15:59:56 -05:00
|
|
|
t)
|
|
|
|
|
|
|
|
;; (defcli! rollback () ; TODO doom rollback
|
2019-07-21 15:39:45 +02:00
|
|
|
;; "<Not implemented yet>"
|
|
|
|
;; (user-error "Not implemented yet, sorry!"))
|
2019-06-16 23:01:17 +02:00
|
|
|
|
|
|
|
|
|
|
|
;;
|
|
|
|
;;; Library
|
2018-09-07 21:49:49 -04:00
|
|
|
|
2020-01-26 21:21:06 -05:00
|
|
|
(defun doom--same-commit-p (abbrev-ref ref)
|
|
|
|
(and (stringp abbrev-ref)
|
|
|
|
(stringp ref)
|
|
|
|
(string-match-p (concat "^" (regexp-quote abbrev-ref))
|
|
|
|
ref)))
|
2020-01-25 03:49:42 -05:00
|
|
|
|
2020-01-26 21:21:06 -05:00
|
|
|
(defun doom--abbrev-commit (commit &optional full)
|
|
|
|
(if full commit (substring commit 0 7)))
|
|
|
|
|
|
|
|
(defun doom--commit-log-between (start-ref end-ref)
|
|
|
|
(and (straight--call
|
|
|
|
"git" "log" "--oneline" "--no-merges"
|
|
|
|
"-n" "25" end-ref (concat "^" (regexp-quote start-ref)))
|
|
|
|
(straight--process-get-output)))
|
2019-12-25 13:34:36 -05:00
|
|
|
|
Rewrite core-cli
Highlights:
- 'doom purge' now purges builds, elpa packages, and repos by default.
Regrafting repos is now opt-in with the -g/--regraft switches.
Negation flags have been added for elpa/repos: -e/--no-elpa and
-r/--no-repos.
- Removed 'doom rebuild' (it is now just 'doom build' or 'doom b').
- Removed 'doom build's -f flag, this is now the default. Added the -r
flag instead, which only builds packages that need rebuilding.
- 'doom update' now updates packages synchronously, but produces more
informative output about the updating process.
- Straight can now prompt in batch mode, which resolves a lot of issues
with 'doom update' (and 'doom upgrade') freezing indefinitely or
throwing repo branch errors.
- 'bin/doom's switches are now positional. Switches aimed at `bin/doom`
must precede any subcommands. e.g.
Do: 'doom -yd upgrade'
Don't do: 'doom upgrade -yd'
- Moved 'doom doctor' from bin/doom-doctor to core/cli/doctor, and
integrated core/doctor.el into it, as to avoid naming conflicts
between it and Emacs doctor.
- The defcli! macro now has a special syntax for declaring flags, their
arguments and descriptions.
Addresses #1981, #1925, #1816, #1721, #1322
2019-11-07 15:59:56 -05:00
|
|
|
(defun doom-cli-packages-install ()
|
2019-06-16 23:01:17 +02:00
|
|
|
"Installs missing packages.
|
|
|
|
|
|
|
|
This function will install any primary package (i.e. a package with a `package!'
|
Rewrite core-cli
Highlights:
- 'doom purge' now purges builds, elpa packages, and repos by default.
Regrafting repos is now opt-in with the -g/--regraft switches.
Negation flags have been added for elpa/repos: -e/--no-elpa and
-r/--no-repos.
- Removed 'doom rebuild' (it is now just 'doom build' or 'doom b').
- Removed 'doom build's -f flag, this is now the default. Added the -r
flag instead, which only builds packages that need rebuilding.
- 'doom update' now updates packages synchronously, but produces more
informative output about the updating process.
- Straight can now prompt in batch mode, which resolves a lot of issues
with 'doom update' (and 'doom upgrade') freezing indefinitely or
throwing repo branch errors.
- 'bin/doom's switches are now positional. Switches aimed at `bin/doom`
must precede any subcommands. e.g.
Do: 'doom -yd upgrade'
Don't do: 'doom upgrade -yd'
- Moved 'doom doctor' from bin/doom-doctor to core/cli/doctor, and
integrated core/doctor.el into it, as to avoid naming conflicts
between it and Emacs doctor.
- The defcli! macro now has a special syntax for declaring flags, their
arguments and descriptions.
Addresses #1981, #1925, #1816, #1721, #1322
2019-11-07 15:59:56 -05:00
|
|
|
declaration) or dependency thereof that hasn't already been."
|
2019-12-28 14:01:36 -05:00
|
|
|
(straight--transaction-finalize)
|
2020-01-25 03:49:42 -05:00
|
|
|
(print! (start "Installing packages..."))
|
2020-01-28 17:54:51 -05:00
|
|
|
(let ((pinned (doom-package-pinned-list)))
|
|
|
|
(print-group!
|
|
|
|
(if-let (built
|
|
|
|
(doom-with-package-recipes (doom-package-recipe-list)
|
|
|
|
(recipe package type local-repo)
|
|
|
|
(condition-case-unless-debug e
|
2020-01-25 03:49:42 -05:00
|
|
|
(straight-use-package (intern package))
|
2020-01-28 17:54:51 -05:00
|
|
|
(error
|
|
|
|
(signal 'doom-package-error
|
|
|
|
(list package e (straight--process-get-output)))))))
|
|
|
|
(print! (success "Installed %d packages")
|
|
|
|
(length built))
|
|
|
|
(print! (info "No packages need to be installed"))
|
|
|
|
nil))))
|
2019-07-21 15:39:45 +02:00
|
|
|
|
|
|
|
|
Rewrite core-cli
Highlights:
- 'doom purge' now purges builds, elpa packages, and repos by default.
Regrafting repos is now opt-in with the -g/--regraft switches.
Negation flags have been added for elpa/repos: -e/--no-elpa and
-r/--no-repos.
- Removed 'doom rebuild' (it is now just 'doom build' or 'doom b').
- Removed 'doom build's -f flag, this is now the default. Added the -r
flag instead, which only builds packages that need rebuilding.
- 'doom update' now updates packages synchronously, but produces more
informative output about the updating process.
- Straight can now prompt in batch mode, which resolves a lot of issues
with 'doom update' (and 'doom upgrade') freezing indefinitely or
throwing repo branch errors.
- 'bin/doom's switches are now positional. Switches aimed at `bin/doom`
must precede any subcommands. e.g.
Do: 'doom -yd upgrade'
Don't do: 'doom upgrade -yd'
- Moved 'doom doctor' from bin/doom-doctor to core/cli/doctor, and
integrated core/doctor.el into it, as to avoid naming conflicts
between it and Emacs doctor.
- The defcli! macro now has a special syntax for declaring flags, their
arguments and descriptions.
Addresses #1981, #1925, #1816, #1721, #1322
2019-11-07 15:59:56 -05:00
|
|
|
(defun doom-cli-packages-build (&optional force-p)
|
2019-07-21 15:39:45 +02:00
|
|
|
"(Re)build all packages."
|
2019-12-28 14:01:36 -05:00
|
|
|
(straight--transaction-finalize)
|
2020-01-01 23:52:02 -05:00
|
|
|
(print! (start "(Re)building %spackages...") (if force-p "all " ""))
|
2019-07-21 15:39:45 +02:00
|
|
|
(print-group!
|
2020-01-25 03:49:42 -05:00
|
|
|
(let ((straight-check-for-modifications
|
|
|
|
(when (file-directory-p (straight--modified-dir))
|
|
|
|
'(find-when-checking)))
|
|
|
|
(straight--allow-find
|
|
|
|
(and straight-check-for-modifications
|
|
|
|
(executable-find straight-find-executable)
|
|
|
|
t))
|
|
|
|
(straight--packages-not-to-rebuild
|
|
|
|
(or straight--packages-not-to-rebuild (make-hash-table :test #'equal)))
|
|
|
|
(straight--packages-to-rebuild
|
|
|
|
(or (if force-p :all straight--packages-to-rebuild)
|
2020-01-28 17:54:51 -05:00
|
|
|
(make-hash-table :test #'equal)))
|
|
|
|
(recipes (doom-package-recipe-list)))
|
2020-01-01 14:29:40 -05:00
|
|
|
(unless force-p
|
2020-02-19 17:52:05 -05:00
|
|
|
(straight--make-build-cache-available))
|
2020-01-25 03:49:42 -05:00
|
|
|
(if-let (built
|
2020-01-28 17:54:51 -05:00
|
|
|
(doom-with-package-recipes recipes (package local-repo)
|
2020-01-30 15:31:30 -05:00
|
|
|
(unless force-p
|
|
|
|
;; Ensure packages with outdated files/bytecode are rebuilt
|
|
|
|
(let ((build-dir (straight--build-dir package))
|
|
|
|
(repo-dir (straight--repos-dir local-repo)))
|
|
|
|
(and (or (file-newer-than-file-p repo-dir build-dir)
|
2020-02-19 17:52:05 -05:00
|
|
|
(file-exists-p (straight--modified-dir (or local-repo package)))
|
2020-01-30 15:31:30 -05:00
|
|
|
;; Doesn't make sense to compare el and elc files
|
|
|
|
;; when the former isn't a symlink to their source.
|
|
|
|
(when straight-use-symlinks
|
|
|
|
(cl-loop for file
|
|
|
|
in (doom-files-in build-dir :match "\\.el$" :full t)
|
|
|
|
for elc-file = (byte-compile-dest-file file)
|
|
|
|
if (and (file-exists-p elc-file)
|
|
|
|
(file-newer-than-file-p file elc-file))
|
|
|
|
return t)))
|
|
|
|
(puthash package t straight--packages-to-rebuild))))
|
2020-01-25 03:49:42 -05:00
|
|
|
(straight-use-package (intern package))))
|
|
|
|
(print! (success "Rebuilt %d package(s)") (length built))
|
|
|
|
(print! (success "No packages need rebuilding"))
|
|
|
|
nil))))
|
2019-07-21 15:39:45 +02:00
|
|
|
|
2018-09-07 21:49:49 -04:00
|
|
|
|
Rewrite core-cli
Highlights:
- 'doom purge' now purges builds, elpa packages, and repos by default.
Regrafting repos is now opt-in with the -g/--regraft switches.
Negation flags have been added for elpa/repos: -e/--no-elpa and
-r/--no-repos.
- Removed 'doom rebuild' (it is now just 'doom build' or 'doom b').
- Removed 'doom build's -f flag, this is now the default. Added the -r
flag instead, which only builds packages that need rebuilding.
- 'doom update' now updates packages synchronously, but produces more
informative output about the updating process.
- Straight can now prompt in batch mode, which resolves a lot of issues
with 'doom update' (and 'doom upgrade') freezing indefinitely or
throwing repo branch errors.
- 'bin/doom's switches are now positional. Switches aimed at `bin/doom`
must precede any subcommands. e.g.
Do: 'doom -yd upgrade'
Don't do: 'doom upgrade -yd'
- Moved 'doom doctor' from bin/doom-doctor to core/cli/doctor, and
integrated core/doctor.el into it, as to avoid naming conflicts
between it and Emacs doctor.
- The defcli! macro now has a special syntax for declaring flags, their
arguments and descriptions.
Addresses #1981, #1925, #1816, #1721, #1322
2019-11-07 15:59:56 -05:00
|
|
|
(defun doom-cli-packages-update ()
|
|
|
|
"Updates packages."
|
2019-12-28 14:01:36 -05:00
|
|
|
(straight--transaction-finalize)
|
2020-01-01 23:52:02 -05:00
|
|
|
(print! (start "Updating packages (this may take a while)..."))
|
2020-01-27 00:51:12 -05:00
|
|
|
(let* ((repo-dir (straight--repos-dir))
|
2020-01-28 17:54:51 -05:00
|
|
|
(pinned (doom-package-pinned-list))
|
2020-01-26 21:21:06 -05:00
|
|
|
(packages-to-rebuild (make-hash-table :test 'equal))
|
|
|
|
(repos-to-rebuild (make-hash-table :test 'equal))
|
|
|
|
(recipes (doom-package-recipe-list))
|
2020-01-25 03:49:42 -05:00
|
|
|
(total (length recipes))
|
2020-01-27 00:51:12 -05:00
|
|
|
(esc (unless doom-debug-mode "\033[1A"))
|
2020-01-25 03:49:42 -05:00
|
|
|
(i 0)
|
|
|
|
errors)
|
2020-01-26 21:21:06 -05:00
|
|
|
(doom-with-package-recipes recipes (recipe package type local-repo)
|
2020-01-25 03:49:42 -05:00
|
|
|
(cl-incf i)
|
|
|
|
(print-group!
|
|
|
|
(unless (straight--repository-is-available-p recipe)
|
2020-01-27 00:51:12 -05:00
|
|
|
(print! (error "(%d/%d) Couldn't find local repo for %s") i total package)
|
2020-01-25 03:49:42 -05:00
|
|
|
(cl-return))
|
2020-01-26 21:21:06 -05:00
|
|
|
(when (gethash local-repo repos-to-rebuild)
|
|
|
|
(puthash package t packages-to-rebuild)
|
|
|
|
(print! (success "(%d/%d) %s was updated indirectly (with %s)") i total package local-repo)
|
2020-01-25 03:49:42 -05:00
|
|
|
(cl-return))
|
2020-01-26 21:21:06 -05:00
|
|
|
(let ((default-directory (straight--repos-dir local-repo)))
|
2020-01-27 00:51:12 -05:00
|
|
|
(unless (file-in-directory-p default-directory repo-dir)
|
2020-01-26 21:21:06 -05:00
|
|
|
(print! (warn "(%d/%d) Skipping %s because it is local") i total package)
|
2020-01-25 03:49:42 -05:00
|
|
|
(cl-return))
|
|
|
|
(condition-case-unless-debug e
|
2020-01-26 21:21:06 -05:00
|
|
|
(let ((ref (straight-vc-get-commit type local-repo))
|
2020-01-28 17:54:51 -05:00
|
|
|
(target-ref (cdr (assoc local-repo pinned)))
|
2020-01-26 21:21:06 -05:00
|
|
|
output)
|
|
|
|
(or (cond
|
|
|
|
((not (stringp target-ref))
|
|
|
|
(print! (start "\033[K(%d/%d) Fetching %s...%s") i total package esc)
|
|
|
|
(when (straight-vc-fetch-from-remote recipe)
|
|
|
|
(setq output (straight--process-get-output))
|
|
|
|
(straight-merge-package package)
|
|
|
|
(setq target-ref (straight-vc-get-commit type local-repo))
|
2020-01-28 14:06:20 -05:00
|
|
|
(or (not (doom--same-commit-p target-ref ref))
|
|
|
|
(cl-return))))
|
2020-01-26 21:21:06 -05:00
|
|
|
|
|
|
|
((doom--same-commit-p target-ref ref)
|
2020-01-27 00:51:12 -05:00
|
|
|
(print! (info "\033[K(%d/%d) %s is up-to-date...%s") i total package esc)
|
2020-01-26 21:21:06 -05:00
|
|
|
(cl-return))
|
|
|
|
|
2020-03-01 13:23:39 -05:00
|
|
|
((if (straight-vc-commit-present-p recipe target-ref)
|
|
|
|
(print! (start "\033[K(%d/%d) Checking out %s (%s)...%s")
|
|
|
|
i total package (doom--abbrev-commit target-ref) esc)
|
|
|
|
(print! (start "\033[K(%d/%d) Fetching %s...%s") i total package esc)
|
|
|
|
(and (straight-vc-fetch-from-remote recipe)
|
|
|
|
(straight-vc-commit-present-p recipe target-ref)))
|
2020-01-26 21:21:06 -05:00
|
|
|
(straight-vc-check-out-commit recipe target-ref)
|
|
|
|
(or (not (eq type 'git))
|
|
|
|
(setq output (doom--commit-log-between ref target-ref)))
|
|
|
|
(doom--same-commit-p target-ref (straight-vc-get-commit type local-repo)))
|
|
|
|
|
2020-02-01 02:07:24 -05:00
|
|
|
((print! (start "\033[K(%d/%d) Re-cloning %s...") i total local-repo esc)
|
2020-01-27 01:44:30 -05:00
|
|
|
(let ((repo (straight--repos-dir local-repo)))
|
|
|
|
(ignore-errors
|
|
|
|
(delete-directory repo 'recursive))
|
|
|
|
(print-group!
|
|
|
|
(straight-use-package (intern package) nil 'no-build))
|
|
|
|
(prog1 (file-directory-p repo)
|
|
|
|
(or (not (eq type 'git))
|
|
|
|
(setq output (doom--commit-log-between ref target-ref)))))))
|
2020-01-26 21:21:06 -05:00
|
|
|
(progn
|
2020-01-27 01:44:30 -05:00
|
|
|
(print! (warn "\033[K(%d/%d) Failed to fetch %s")
|
|
|
|
i total local-repo)
|
|
|
|
(unless (string-empty-p output)
|
|
|
|
(print-group! (print! (info "%s" output))))
|
2020-01-26 21:21:06 -05:00
|
|
|
(cl-return)))
|
|
|
|
(puthash local-repo t repos-to-rebuild)
|
|
|
|
(puthash package t packages-to-rebuild)
|
|
|
|
(unless (string-empty-p output)
|
2020-01-30 18:37:48 -05:00
|
|
|
(print! (start "\033[K(%d/%d) Updating %s...") i total local-repo)
|
2020-02-01 02:07:24 -05:00
|
|
|
(print-group! (print! (indent 2 output))))
|
2020-01-30 18:37:48 -05:00
|
|
|
(print! (success "\033[K(%d/%d) %s updated (%s -> %s)")
|
2020-01-26 21:21:06 -05:00
|
|
|
i total local-repo
|
|
|
|
(doom--abbrev-commit ref)
|
|
|
|
(doom--abbrev-commit target-ref)))
|
2020-01-25 03:49:42 -05:00
|
|
|
(user-error
|
|
|
|
(signal 'user-error (error-message-string e)))
|
|
|
|
(error
|
|
|
|
(print! (warn "\033[K(%d/%d) Encountered error with %s" i total package))
|
|
|
|
(print-group!
|
2020-01-26 21:21:06 -05:00
|
|
|
(print! (error "%s") e)
|
2020-01-25 03:49:42 -05:00
|
|
|
(print-group! (print! (info "%s" (straight--process-get-output)))))
|
2020-01-26 21:21:06 -05:00
|
|
|
(push package errors))))))
|
|
|
|
(princ "\033[K")
|
|
|
|
(when errors
|
|
|
|
(print! (error "Encountered %d error(s), the offending packages: %s")
|
|
|
|
(length errors) (string-join errors ", ")))
|
|
|
|
(if (hash-table-empty-p packages-to-rebuild)
|
|
|
|
(ignore (print! (success "All %d packages are up-to-date") total))
|
|
|
|
(let ((default-directory (straight--build-dir)))
|
|
|
|
(mapc (doom-rpartial #'delete-directory 'recursive)
|
|
|
|
(hash-table-keys packages-to-rebuild)))
|
|
|
|
(print! (success "Updated %d package(s)")
|
|
|
|
(hash-table-count packages-to-rebuild))
|
|
|
|
(doom-cli-packages-build)
|
|
|
|
t)))
|
2019-07-21 15:39:45 +02:00
|
|
|
|
|
|
|
|
2019-07-29 21:04:58 +02:00
|
|
|
;;; PURGE (for the emperor)
|
Rewrite core-cli
Highlights:
- 'doom purge' now purges builds, elpa packages, and repos by default.
Regrafting repos is now opt-in with the -g/--regraft switches.
Negation flags have been added for elpa/repos: -e/--no-elpa and
-r/--no-repos.
- Removed 'doom rebuild' (it is now just 'doom build' or 'doom b').
- Removed 'doom build's -f flag, this is now the default. Added the -r
flag instead, which only builds packages that need rebuilding.
- 'doom update' now updates packages synchronously, but produces more
informative output about the updating process.
- Straight can now prompt in batch mode, which resolves a lot of issues
with 'doom update' (and 'doom upgrade') freezing indefinitely or
throwing repo branch errors.
- 'bin/doom's switches are now positional. Switches aimed at `bin/doom`
must precede any subcommands. e.g.
Do: 'doom -yd upgrade'
Don't do: 'doom upgrade -yd'
- Moved 'doom doctor' from bin/doom-doctor to core/cli/doctor, and
integrated core/doctor.el into it, as to avoid naming conflicts
between it and Emacs doctor.
- The defcli! macro now has a special syntax for declaring flags, their
arguments and descriptions.
Addresses #1981, #1925, #1816, #1721, #1322
2019-11-07 15:59:56 -05:00
|
|
|
(defun doom--cli-packages-purge-build (build)
|
2019-07-29 21:04:58 +02:00
|
|
|
(let ((build-dir (straight--build-dir build)))
|
2019-07-29 21:18:49 +02:00
|
|
|
(delete-directory build-dir 'recursive)
|
2019-07-29 21:04:58 +02:00
|
|
|
(if (file-directory-p build-dir)
|
|
|
|
(ignore (print! (error "Failed to purg build/%s" build)))
|
|
|
|
(print! (success "Purged build/%s" build))
|
|
|
|
t)))
|
|
|
|
|
Rewrite core-cli
Highlights:
- 'doom purge' now purges builds, elpa packages, and repos by default.
Regrafting repos is now opt-in with the -g/--regraft switches.
Negation flags have been added for elpa/repos: -e/--no-elpa and
-r/--no-repos.
- Removed 'doom rebuild' (it is now just 'doom build' or 'doom b').
- Removed 'doom build's -f flag, this is now the default. Added the -r
flag instead, which only builds packages that need rebuilding.
- 'doom update' now updates packages synchronously, but produces more
informative output about the updating process.
- Straight can now prompt in batch mode, which resolves a lot of issues
with 'doom update' (and 'doom upgrade') freezing indefinitely or
throwing repo branch errors.
- 'bin/doom's switches are now positional. Switches aimed at `bin/doom`
must precede any subcommands. e.g.
Do: 'doom -yd upgrade'
Don't do: 'doom upgrade -yd'
- Moved 'doom doctor' from bin/doom-doctor to core/cli/doctor, and
integrated core/doctor.el into it, as to avoid naming conflicts
between it and Emacs doctor.
- The defcli! macro now has a special syntax for declaring flags, their
arguments and descriptions.
Addresses #1981, #1925, #1816, #1721, #1322
2019-11-07 15:59:56 -05:00
|
|
|
(defun doom--cli-packages-purge-builds (builds)
|
2019-07-29 21:04:58 +02:00
|
|
|
(if (not builds)
|
|
|
|
(progn (print! (info "No builds to purge"))
|
|
|
|
0)
|
2019-12-28 14:02:07 -05:00
|
|
|
(print! (start "Purging straight builds..." (length builds)))
|
|
|
|
(print-group!
|
|
|
|
(length
|
|
|
|
(delq nil (mapcar #'doom--cli-packages-purge-build builds))))))
|
2019-07-29 21:04:58 +02:00
|
|
|
|
2020-01-26 21:21:06 -05:00
|
|
|
(cl-defun doom--cli-packages-regraft-repo (repo)
|
2019-07-29 21:04:58 +02:00
|
|
|
(let ((default-directory (straight--repos-dir repo)))
|
2020-01-26 21:21:06 -05:00
|
|
|
(unless (file-directory-p ".git")
|
|
|
|
(print! (warn "\033[Krepos/%s is not a git repo, skipping" repo))
|
|
|
|
(cl-return))
|
|
|
|
(unless (file-in-directory-p default-directory straight-base-dir)
|
|
|
|
(print! (warn "\033[KSkipping repos/%s because it is local" repo))
|
|
|
|
(cl-return))
|
|
|
|
(let ((before-size (doom-directory-size default-directory)))
|
|
|
|
(straight--call "git" "reset" "--hard")
|
|
|
|
(straight--call "git" "clean" "-ffd")
|
|
|
|
(if (not (car (straight--call "git" "replace" "--graft" "HEAD")))
|
|
|
|
(print! (info "\033[Krepos/%s is already compact\033[1A" repo))
|
2020-02-10 20:18:51 -05:00
|
|
|
(straight--call "git" "reflog" "expire" "--expire=all" "--all")
|
|
|
|
(straight--call "git" "gc" "--prune=now")
|
2020-01-26 21:21:06 -05:00
|
|
|
(print! (success "\033[KRegrafted repos/%s (from %0.1fKB to %0.1fKB)")
|
|
|
|
repo before-size (doom-directory-size default-directory))
|
|
|
|
(print-group! (print! "%s" (straight--process-get-output))))
|
2019-07-29 21:04:58 +02:00
|
|
|
t)))
|
|
|
|
|
Rewrite core-cli
Highlights:
- 'doom purge' now purges builds, elpa packages, and repos by default.
Regrafting repos is now opt-in with the -g/--regraft switches.
Negation flags have been added for elpa/repos: -e/--no-elpa and
-r/--no-repos.
- Removed 'doom rebuild' (it is now just 'doom build' or 'doom b').
- Removed 'doom build's -f flag, this is now the default. Added the -r
flag instead, which only builds packages that need rebuilding.
- 'doom update' now updates packages synchronously, but produces more
informative output about the updating process.
- Straight can now prompt in batch mode, which resolves a lot of issues
with 'doom update' (and 'doom upgrade') freezing indefinitely or
throwing repo branch errors.
- 'bin/doom's switches are now positional. Switches aimed at `bin/doom`
must precede any subcommands. e.g.
Do: 'doom -yd upgrade'
Don't do: 'doom upgrade -yd'
- Moved 'doom doctor' from bin/doom-doctor to core/cli/doctor, and
integrated core/doctor.el into it, as to avoid naming conflicts
between it and Emacs doctor.
- The defcli! macro now has a special syntax for declaring flags, their
arguments and descriptions.
Addresses #1981, #1925, #1816, #1721, #1322
2019-11-07 15:59:56 -05:00
|
|
|
(defun doom--cli-packages-regraft-repos (repos)
|
2019-07-29 21:04:58 +02:00
|
|
|
(if (not repos)
|
|
|
|
(progn (print! (info "No repos to regraft"))
|
|
|
|
0)
|
2019-12-28 14:02:07 -05:00
|
|
|
(print! (start "Regrafting %d repos..." (length repos)))
|
Rewrite core-cli
Highlights:
- 'doom purge' now purges builds, elpa packages, and repos by default.
Regrafting repos is now opt-in with the -g/--regraft switches.
Negation flags have been added for elpa/repos: -e/--no-elpa and
-r/--no-repos.
- Removed 'doom rebuild' (it is now just 'doom build' or 'doom b').
- Removed 'doom build's -f flag, this is now the default. Added the -r
flag instead, which only builds packages that need rebuilding.
- 'doom update' now updates packages synchronously, but produces more
informative output about the updating process.
- Straight can now prompt in batch mode, which resolves a lot of issues
with 'doom update' (and 'doom upgrade') freezing indefinitely or
throwing repo branch errors.
- 'bin/doom's switches are now positional. Switches aimed at `bin/doom`
must precede any subcommands. e.g.
Do: 'doom -yd upgrade'
Don't do: 'doom upgrade -yd'
- Moved 'doom doctor' from bin/doom-doctor to core/cli/doctor, and
integrated core/doctor.el into it, as to avoid naming conflicts
between it and Emacs doctor.
- The defcli! macro now has a special syntax for declaring flags, their
arguments and descriptions.
Addresses #1981, #1925, #1816, #1721, #1322
2019-11-07 15:59:56 -05:00
|
|
|
(let ((before-size (doom-directory-size (straight--repos-dir))))
|
2019-11-25 02:14:58 -05:00
|
|
|
(print-group!
|
|
|
|
(prog1 (delq nil (mapcar #'doom--cli-packages-regraft-repo repos))
|
|
|
|
(princ "\033[K")
|
|
|
|
(let ((after-size (doom-directory-size (straight--repos-dir))))
|
|
|
|
(print! (success "Finished regrafting. Size before: %0.1fKB and after: %0.1fKB (%0.1fKB)")
|
|
|
|
before-size after-size
|
|
|
|
(- after-size before-size))))))))
|
Rewrite core-cli
Highlights:
- 'doom purge' now purges builds, elpa packages, and repos by default.
Regrafting repos is now opt-in with the -g/--regraft switches.
Negation flags have been added for elpa/repos: -e/--no-elpa and
-r/--no-repos.
- Removed 'doom rebuild' (it is now just 'doom build' or 'doom b').
- Removed 'doom build's -f flag, this is now the default. Added the -r
flag instead, which only builds packages that need rebuilding.
- 'doom update' now updates packages synchronously, but produces more
informative output about the updating process.
- Straight can now prompt in batch mode, which resolves a lot of issues
with 'doom update' (and 'doom upgrade') freezing indefinitely or
throwing repo branch errors.
- 'bin/doom's switches are now positional. Switches aimed at `bin/doom`
must precede any subcommands. e.g.
Do: 'doom -yd upgrade'
Don't do: 'doom upgrade -yd'
- Moved 'doom doctor' from bin/doom-doctor to core/cli/doctor, and
integrated core/doctor.el into it, as to avoid naming conflicts
between it and Emacs doctor.
- The defcli! macro now has a special syntax for declaring flags, their
arguments and descriptions.
Addresses #1981, #1925, #1816, #1721, #1322
2019-11-07 15:59:56 -05:00
|
|
|
|
|
|
|
(defun doom--cli-packages-purge-repo (repo)
|
2019-07-29 21:04:58 +02:00
|
|
|
(let ((repo-dir (straight--repos-dir repo)))
|
|
|
|
(delete-directory repo-dir 'recursive)
|
|
|
|
(ignore-errors
|
|
|
|
(delete-file (straight--modified-file repo)))
|
|
|
|
(if (file-directory-p repo-dir)
|
|
|
|
(ignore (print! (error "Failed to purge repos/%s" repo)))
|
|
|
|
(print! (success "Purged repos/%s" repo))
|
|
|
|
t)))
|
|
|
|
|
Rewrite core-cli
Highlights:
- 'doom purge' now purges builds, elpa packages, and repos by default.
Regrafting repos is now opt-in with the -g/--regraft switches.
Negation flags have been added for elpa/repos: -e/--no-elpa and
-r/--no-repos.
- Removed 'doom rebuild' (it is now just 'doom build' or 'doom b').
- Removed 'doom build's -f flag, this is now the default. Added the -r
flag instead, which only builds packages that need rebuilding.
- 'doom update' now updates packages synchronously, but produces more
informative output about the updating process.
- Straight can now prompt in batch mode, which resolves a lot of issues
with 'doom update' (and 'doom upgrade') freezing indefinitely or
throwing repo branch errors.
- 'bin/doom's switches are now positional. Switches aimed at `bin/doom`
must precede any subcommands. e.g.
Do: 'doom -yd upgrade'
Don't do: 'doom upgrade -yd'
- Moved 'doom doctor' from bin/doom-doctor to core/cli/doctor, and
integrated core/doctor.el into it, as to avoid naming conflicts
between it and Emacs doctor.
- The defcli! macro now has a special syntax for declaring flags, their
arguments and descriptions.
Addresses #1981, #1925, #1816, #1721, #1322
2019-11-07 15:59:56 -05:00
|
|
|
(defun doom--cli-packages-purge-repos (repos)
|
2019-07-29 21:04:58 +02:00
|
|
|
(if (not repos)
|
|
|
|
(progn (print! (info "No repos to purge"))
|
|
|
|
0)
|
2019-12-28 14:02:07 -05:00
|
|
|
(print! (start "Purging straight repositories..."))
|
|
|
|
(print-group!
|
|
|
|
(length
|
|
|
|
(delq nil (mapcar #'doom--cli-packages-purge-repo repos))))))
|
2019-07-29 21:04:58 +02:00
|
|
|
|
Rewrite core-cli
Highlights:
- 'doom purge' now purges builds, elpa packages, and repos by default.
Regrafting repos is now opt-in with the -g/--regraft switches.
Negation flags have been added for elpa/repos: -e/--no-elpa and
-r/--no-repos.
- Removed 'doom rebuild' (it is now just 'doom build' or 'doom b').
- Removed 'doom build's -f flag, this is now the default. Added the -r
flag instead, which only builds packages that need rebuilding.
- 'doom update' now updates packages synchronously, but produces more
informative output about the updating process.
- Straight can now prompt in batch mode, which resolves a lot of issues
with 'doom update' (and 'doom upgrade') freezing indefinitely or
throwing repo branch errors.
- 'bin/doom's switches are now positional. Switches aimed at `bin/doom`
must precede any subcommands. e.g.
Do: 'doom -yd upgrade'
Don't do: 'doom upgrade -yd'
- Moved 'doom doctor' from bin/doom-doctor to core/cli/doctor, and
integrated core/doctor.el into it, as to avoid naming conflicts
between it and Emacs doctor.
- The defcli! macro now has a special syntax for declaring flags, their
arguments and descriptions.
Addresses #1981, #1925, #1816, #1721, #1322
2019-11-07 15:59:56 -05:00
|
|
|
(defun doom--cli-packages-purge-elpa ()
|
2019-12-28 14:02:07 -05:00
|
|
|
(require 'core-packages)
|
|
|
|
(let ((dirs (doom-files-in package-user-dir :type t :depth 0)))
|
|
|
|
(if (not dirs)
|
2019-09-02 13:12:57 -04:00
|
|
|
(progn (print! (info "No ELPA packages to purge"))
|
|
|
|
0)
|
2019-12-28 14:02:07 -05:00
|
|
|
(print! (start "Purging ELPA packages..."))
|
|
|
|
(dolist (path dirs (length dirs))
|
|
|
|
(condition-case e
|
|
|
|
(print-group!
|
|
|
|
(if (file-directory-p path)
|
|
|
|
(delete-directory path 'recursive)
|
|
|
|
(delete-file path))
|
2019-12-30 17:28:31 -05:00
|
|
|
(print! (success "Deleted %s") (filename path)))
|
2019-12-28 14:02:07 -05:00
|
|
|
(error
|
|
|
|
(print! (error "Failed to delete %s because: %s")
|
2019-12-30 17:28:31 -05:00
|
|
|
(filename path)
|
|
|
|
e)))))))
|
2019-07-25 18:46:18 +02:00
|
|
|
|
Rewrite core-cli
Highlights:
- 'doom purge' now purges builds, elpa packages, and repos by default.
Regrafting repos is now opt-in with the -g/--regraft switches.
Negation flags have been added for elpa/repos: -e/--no-elpa and
-r/--no-repos.
- Removed 'doom rebuild' (it is now just 'doom build' or 'doom b').
- Removed 'doom build's -f flag, this is now the default. Added the -r
flag instead, which only builds packages that need rebuilding.
- 'doom update' now updates packages synchronously, but produces more
informative output about the updating process.
- Straight can now prompt in batch mode, which resolves a lot of issues
with 'doom update' (and 'doom upgrade') freezing indefinitely or
throwing repo branch errors.
- 'bin/doom's switches are now positional. Switches aimed at `bin/doom`
must precede any subcommands. e.g.
Do: 'doom -yd upgrade'
Don't do: 'doom upgrade -yd'
- Moved 'doom doctor' from bin/doom-doctor to core/cli/doctor, and
integrated core/doctor.el into it, as to avoid naming conflicts
between it and Emacs doctor.
- The defcli! macro now has a special syntax for declaring flags, their
arguments and descriptions.
Addresses #1981, #1925, #1816, #1721, #1322
2019-11-07 15:59:56 -05:00
|
|
|
(defun doom-cli-packages-purge (&optional elpa-p builds-p repos-p regraft-repos-p)
|
2019-07-21 15:39:45 +02:00
|
|
|
"Auto-removes orphaned packages and repos.
|
2019-06-16 23:01:17 +02:00
|
|
|
|
|
|
|
An orphaned package is a package that isn't a primary package (i.e. doesn't have
|
|
|
|
a `package!' declaration) or isn't depended on by another primary package.
|
|
|
|
|
2019-07-25 18:46:18 +02:00
|
|
|
If BUILDS-P, include straight package builds.
|
|
|
|
If REPOS-P, include straight repos.
|
Rewrite core-cli
Highlights:
- 'doom purge' now purges builds, elpa packages, and repos by default.
Regrafting repos is now opt-in with the -g/--regraft switches.
Negation flags have been added for elpa/repos: -e/--no-elpa and
-r/--no-repos.
- Removed 'doom rebuild' (it is now just 'doom build' or 'doom b').
- Removed 'doom build's -f flag, this is now the default. Added the -r
flag instead, which only builds packages that need rebuilding.
- 'doom update' now updates packages synchronously, but produces more
informative output about the updating process.
- Straight can now prompt in batch mode, which resolves a lot of issues
with 'doom update' (and 'doom upgrade') freezing indefinitely or
throwing repo branch errors.
- 'bin/doom's switches are now positional. Switches aimed at `bin/doom`
must precede any subcommands. e.g.
Do: 'doom -yd upgrade'
Don't do: 'doom upgrade -yd'
- Moved 'doom doctor' from bin/doom-doctor to core/cli/doctor, and
integrated core/doctor.el into it, as to avoid naming conflicts
between it and Emacs doctor.
- The defcli! macro now has a special syntax for declaring flags, their
arguments and descriptions.
Addresses #1981, #1925, #1816, #1721, #1322
2019-11-07 15:59:56 -05:00
|
|
|
If ELPA-P, include packages installed with package.el (M-x package-install)."
|
2019-12-29 21:25:40 -05:00
|
|
|
(print! (start "Purging orphaned packages (for the emperor)..."))
|
2019-07-29 21:04:58 +02:00
|
|
|
(cl-destructuring-bind (&optional builds-to-purge repos-to-purge repos-to-regraft)
|
2019-08-18 11:24:44 -04:00
|
|
|
(let ((rdirs (straight--directory-files (straight--repos-dir) nil nil 'sort))
|
|
|
|
(bdirs (straight--directory-files (straight--build-dir) nil nil 'sort)))
|
2019-08-22 16:12:22 -04:00
|
|
|
(list (cl-remove-if (doom-rpartial #'gethash straight--profile-cache)
|
2019-08-18 11:24:44 -04:00
|
|
|
bdirs)
|
2019-08-22 16:12:22 -04:00
|
|
|
(cl-remove-if (doom-rpartial #'straight--checkhash straight--repo-cache)
|
2019-08-18 11:24:44 -04:00
|
|
|
rdirs)
|
2019-08-22 16:12:22 -04:00
|
|
|
(cl-remove-if-not (doom-rpartial #'straight--checkhash straight--repo-cache)
|
2019-08-18 11:24:44 -04:00
|
|
|
rdirs)))
|
2019-07-26 13:59:14 +02:00
|
|
|
(let (success)
|
|
|
|
(print-group!
|
2019-07-29 21:04:58 +02:00
|
|
|
(if (not builds-p)
|
|
|
|
(print! (info "Skipping builds"))
|
Rewrite core-cli
Highlights:
- 'doom purge' now purges builds, elpa packages, and repos by default.
Regrafting repos is now opt-in with the -g/--regraft switches.
Negation flags have been added for elpa/repos: -e/--no-elpa and
-r/--no-repos.
- Removed 'doom rebuild' (it is now just 'doom build' or 'doom b').
- Removed 'doom build's -f flag, this is now the default. Added the -r
flag instead, which only builds packages that need rebuilding.
- 'doom update' now updates packages synchronously, but produces more
informative output about the updating process.
- Straight can now prompt in batch mode, which resolves a lot of issues
with 'doom update' (and 'doom upgrade') freezing indefinitely or
throwing repo branch errors.
- 'bin/doom's switches are now positional. Switches aimed at `bin/doom`
must precede any subcommands. e.g.
Do: 'doom -yd upgrade'
Don't do: 'doom upgrade -yd'
- Moved 'doom doctor' from bin/doom-doctor to core/cli/doctor, and
integrated core/doctor.el into it, as to avoid naming conflicts
between it and Emacs doctor.
- The defcli! macro now has a special syntax for declaring flags, their
arguments and descriptions.
Addresses #1981, #1925, #1816, #1721, #1322
2019-11-07 15:59:56 -05:00
|
|
|
(and (/= 0 (doom--cli-packages-purge-builds builds-to-purge))
|
2019-07-29 21:04:58 +02:00
|
|
|
(setq success t)
|
|
|
|
(straight-prune-build-cache)))
|
2019-07-26 13:59:14 +02:00
|
|
|
(if (not elpa-p)
|
|
|
|
(print! (info "Skipping elpa packages"))
|
Rewrite core-cli
Highlights:
- 'doom purge' now purges builds, elpa packages, and repos by default.
Regrafting repos is now opt-in with the -g/--regraft switches.
Negation flags have been added for elpa/repos: -e/--no-elpa and
-r/--no-repos.
- Removed 'doom rebuild' (it is now just 'doom build' or 'doom b').
- Removed 'doom build's -f flag, this is now the default. Added the -r
flag instead, which only builds packages that need rebuilding.
- 'doom update' now updates packages synchronously, but produces more
informative output about the updating process.
- Straight can now prompt in batch mode, which resolves a lot of issues
with 'doom update' (and 'doom upgrade') freezing indefinitely or
throwing repo branch errors.
- 'bin/doom's switches are now positional. Switches aimed at `bin/doom`
must precede any subcommands. e.g.
Do: 'doom -yd upgrade'
Don't do: 'doom upgrade -yd'
- Moved 'doom doctor' from bin/doom-doctor to core/cli/doctor, and
integrated core/doctor.el into it, as to avoid naming conflicts
between it and Emacs doctor.
- The defcli! macro now has a special syntax for declaring flags, their
arguments and descriptions.
Addresses #1981, #1925, #1816, #1721, #1322
2019-11-07 15:59:56 -05:00
|
|
|
(and (/= 0 (doom--cli-packages-purge-elpa))
|
2019-07-29 21:04:58 +02:00
|
|
|
(setq success t)))
|
|
|
|
(if (not repos-p)
|
|
|
|
(print! (info "Skipping repos"))
|
Rewrite core-cli
Highlights:
- 'doom purge' now purges builds, elpa packages, and repos by default.
Regrafting repos is now opt-in with the -g/--regraft switches.
Negation flags have been added for elpa/repos: -e/--no-elpa and
-r/--no-repos.
- Removed 'doom rebuild' (it is now just 'doom build' or 'doom b').
- Removed 'doom build's -f flag, this is now the default. Added the -r
flag instead, which only builds packages that need rebuilding.
- 'doom update' now updates packages synchronously, but produces more
informative output about the updating process.
- Straight can now prompt in batch mode, which resolves a lot of issues
with 'doom update' (and 'doom upgrade') freezing indefinitely or
throwing repo branch errors.
- 'bin/doom's switches are now positional. Switches aimed at `bin/doom`
must precede any subcommands. e.g.
Do: 'doom -yd upgrade'
Don't do: 'doom upgrade -yd'
- Moved 'doom doctor' from bin/doom-doctor to core/cli/doctor, and
integrated core/doctor.el into it, as to avoid naming conflicts
between it and Emacs doctor.
- The defcli! macro now has a special syntax for declaring flags, their
arguments and descriptions.
Addresses #1981, #1925, #1816, #1721, #1322
2019-11-07 15:59:56 -05:00
|
|
|
(and (/= 0 (doom--cli-packages-purge-repos repos-to-purge))
|
|
|
|
(setq success t)))
|
|
|
|
(if (not regraft-repos-p)
|
|
|
|
(print! (info "Skipping regrafting"))
|
|
|
|
(and (doom--cli-packages-regraft-repos repos-to-regraft)
|
2019-07-29 21:04:58 +02:00
|
|
|
(setq success t)))
|
2019-12-27 03:30:03 -05:00
|
|
|
success))))
|