[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Proposal for 'package-isolate' command
|
From: |
Thierry Volpiatto |
|
Subject: |
Re: Proposal for 'package-isolate' command |
|
Date: |
Sun, 20 Aug 2023 20:24:30 +0000 |
Thierry Volpiatto <thievol@posteo.net> writes:
> Philip Kaludercic <philipk@posteo.net> writes:
>
>> An issue I see here, is that a required version might not be satisfied
>> by the version of the package returned by `package-get-descriptor'. Or
>> am I mistaken?
>
> So I guess we need a function that get the dependencies from installed
> packages and one from all to fit with what we previously had.
Or use an optional arg:
--8<---------------cut here---------------start------------->8---
(defun package--dependencies (pkg &optional only-local)
"Return a list of all transitive dependencies of PKG.
If PKG is a package descriptor, the return value is a list of
package descriptors. If PKG is a symbol designating a package,
the return value is a list of symbols designating packages."
(when-let* ((desc (if (package-desc-p pkg) pkg
(cadr (assq pkg package-archive-contents)))))
;; Can we have circular dependencies? Assume "nope".
(let ((all (cl-labels ((more (pkg-desc)
(let (deps)
(dolist (req (package-desc-reqs pkg-desc))
(setq deps (nconc
(when-let* ((matched (if
only-local
(cadr
(assq (car req) package-alist))
(package-get-descriptor (car req))))
(version<=
(version-list-<=
(cadr
req)
(package-desc-version matched))))
(more matched))
deps)))
(delete-dups (cons pkg-desc deps)))))
(more desc))))
(remq pkg (mapcar (if (package-desc-p pkg) #'identity
#'package-desc-name) all)))))
--8<---------------cut here---------------end--------------->8---
--
Thierry
signature.asc
Description: PGP signature
- Re: Proposal for 'package-isolate' command, (continued)
- Re: Proposal for 'package-isolate' command, Thierry Volpiatto, 2023/08/18
- Re: Proposal for 'package-isolate' command, Eli Zaretskii, 2023/08/18
- Re: Proposal for 'package-isolate' command, Philip Kaludercic, 2023/08/18
- Re: Proposal for 'package-isolate' command, Thierry Volpiatto, 2023/08/18
- Re: Adding package and package-vc to ELPA, Philip Kaludercic, 2023/08/18
- Re: Adding package and package-vc to ELPA, Thierry Volpiatto, 2023/08/19
- Re: Proposal for 'package-isolate' command, Thierry Volpiatto, 2023/08/20
- Re: Proposal for 'package-isolate' command, Thierry Volpiatto, 2023/08/20
- Re: Proposal for 'package-isolate' command, Philip Kaludercic, 2023/08/20
- Re: Proposal for 'package-isolate' command, Thierry Volpiatto, 2023/08/20
- Re: Proposal for 'package-isolate' command,
Thierry Volpiatto <=
- Re: Proposal for 'package-isolate' command, Philip Kaludercic, 2023/08/20
- Re: Changes to make in elpa-packages file for nongnu elpa, Eli Zaretskii, 2023/08/16
- Re: Changes to make in elpa-packages file for nongnu elpa, Philip Kaludercic, 2023/08/16
- Re: Changes to make in elpa-packages file for nongnu elpa, Thierry Volpiatto, 2023/08/08
- Re: Changes to make in elpa-packages file for nongnu elpa, Michael Albinus, 2023/08/08
- Re: Changes to make in elpa-packages file for nongnu elpa, Philip Kaludercic, 2023/08/08
- Re: Changes to make in elpa-packages file for nongnu elpa, Michael Albinus, 2023/08/08
- Re: Changes to make in elpa-packages file for nongnu elpa, Philip Kaludercic, 2023/08/09
- Re: Changes to make in elpa-packages file for nongnu elpa, Eli Zaretskii, 2023/08/09
- Re: Changes to make in elpa-packages file for nongnu elpa, Philip Kaludercic, 2023/08/09