Skip to content

Commit

Permalink
present more info
Browse files Browse the repository at this point in the history
  • Loading branch information
jcs090218 committed Feb 18, 2023
1 parent fe6b8a8 commit 56b8b0b
Showing 1 changed file with 18 additions and 13 deletions.
31 changes: 18 additions & 13 deletions lisp/_prepare.el
Original file line number Diff line number Diff line change
Expand Up @@ -832,18 +832,23 @@ This uses function `locate-dominating-file' to look up directory tree."

(defun eask--try-construct-package-desc (file)
"Try construct the package descriptor from FILE."
(with-temp-buffer
(insert-file-contents file)
(setq eask-package-desc (ignore-errors
(if (string-suffix-p "-pkg.el" file)
(package--read-pkg-desc 'dir)
(unless (eask-pkg-el)
(package-buffer-info))))))
(eask-msg (concat
(if eask-package-desc "" "")
"Try constructing the package-descriptor (%s)... "
(if eask-package-desc "succeeded! " "failed!"))
(file-name-nondirectory file)))
(let (skipped)
(with-temp-buffer
(insert-file-contents file)
(setq eask-package-desc
(ignore-errors
(cond ((string-suffix-p "-pkg.el" file) ; if ensure -pkg.el
(package--read-pkg-desc 'dir))
((eask-pkg-el) ; if -pkg.el is presented,
(setq skipped t) nil) ; skip it
(t (package-buffer-info)))))) ; default read main package file
(eask-msg (concat
(if eask-package-desc "" "")
"Try constructing the package-descriptor (%s)... "
(cond (eask-package-desc "succeeded!")
(skipped "skipped!")
(t "failed!")))
(file-name-nondirectory file))))

(defun eask-f-package-file (file)
"Set package FILE."
Expand All @@ -857,7 +862,7 @@ This uses function `locate-dominating-file' to look up directory tree."
(((and (not eask-package-descriptor) ; prevent multiple definition error
(not eask-package-desc))) ; check if constructed
(pkg-file (eask-pkg-el)))
(eask-f-package-descriptor pkg-file)
;;(eask-f-package-descriptor pkg-file)
;; XXX: Make sure DSL package descriptor is set back to `nil'
(setq eask-package-descriptor nil))))

Expand Down

0 comments on commit 56b8b0b

Please sign in to comment.