Skip to content

Commit

Permalink
tweak(core): remove unneeded +package-download-from-urls
Browse files Browse the repository at this point in the history
  • Loading branch information
abougouffa committed Apr 7, 2024
1 parent 401d4bc commit 0e0c070
Showing 1 changed file with 0 additions and 27 deletions.
27 changes: 0 additions & 27 deletions core/me-lib.el
Original file line number Diff line number Diff line change
Expand Up @@ -579,29 +579,6 @@ Optionally, check also for the containing MODULE."
(and (memq package (apply #'append (mapcar #'ensure-list minemacs-disabled-packages))) t)
(and module (not (memq module (append minemacs-core-modules minemacs-modules))))))

(defvar +package--download-urls nil)

(defun +package-download-from-urls (pkgname &rest args)
"Download PKGNAME files from URLs in ARGS.
Pass `:redownload' to force redownloading the package files.
Returns the load path of the package, useful for usage with `use-package''s
`:load-path'."
(let* ((pkg-load-path (+directory-ensure minemacs-extra-packages-dir (format "%s/" pkgname)))
(default-directory pkg-load-path)
(redownload-p (memq :redownload args))
(urls (remq :redownload args)))
(add-to-list '+package--download-urls (cons pkgname urls))
(dolist (url urls)
(when-let* ((url-file-name (url-filename (url-generic-parse-url url)))
(url-file-name (file-name-nondirectory url-file-name))
(url-file-name (car (string-split url-file-name "?")))) ;; url/file.el?h=tag
(when (and redownload-p (file-exists-p url-file-name))
(delete-file url-file-name))
(unless (file-exists-p url-file-name)
(url-copy-file url url-file-name))))
pkg-load-path))

(defun minemacs-run-build-functions (&optional dont-ask-p)
"Run all build functions in `minemacs-build-functions'.
Expand Down Expand Up @@ -641,10 +618,6 @@ Call functions without asking when DONT-ASK-P is non-nil."
(message "[MinEmacs]: Rebuilding packages")
(straight-rebuild-all)

;; Updating packages installed from URLs
(message "[MinEmacs]: Updating packages installed from URLs")
(mapc (lambda (args) (apply #'+package-download-from-urls (append args '(:redownload)))) +package--download-urls)

;; Run package-specific build functions (ex: `pdf-tools-install')
(message "[MinEmacs]: Running additional package-specific build functions")
(minemacs-run-build-functions 'dont-ask))
Expand Down

0 comments on commit 0e0c070

Please sign in to comment.