From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Thierry Volpiatto Newsgroups: gmane.emacs.devel Subject: Re: Proposal for 'package-isolate' command Date: Sun, 20 Aug 2023 20:24:30 +0000 Message-ID: <878ra5tq75.fsf@posteo.net> References: <87r0oftgye.fsf@posteo.net> <87350vt1wz.fsf@posteo.net> <871qgen1ln.fsf@posteo.net> <87edke4mou.fsf@posteo.net> <87wmy6kuan.fsf@posteo.net> <87wmy6w070.fsf@posteo.net> <87zg2sjleg.fsf@posteo.net> <87pm3nlbm7.fsf@posteo.net> <87zg2ri9g9.fsf@posteo.net> <87bkf7b7ls.fsf@posteo.net> <87v8dfi6zy.fsf@posteo.net> <877cpvb361.fsf@posteo.net> <87pm3mj0ot.fsf_-_@posteo.net> <87v8de9qel.fsf@posteo.net> <87pm3mgj8d.fsf@posteo.net> <877cpq9p7s.fsf@posteo.net> <878ra5d70p.fsf@posteo.net> <871qfxtv3v.fsf@posteo.net> <87h6otttfa.fsf@posteo.net> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8878"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Philip Kaludercic , emacs-devel@gnu.org To: Thierry Volpiatto Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Aug 20 22:27:47 2023 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qXp1W-00027R-CI for ged-emacs-devel@m.gmane-mx.org; Sun, 20 Aug 2023 22:27:46 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qXp1C-00085P-AP; Sun, 20 Aug 2023 16:27:26 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qXp1B-00080l-0H for emacs-devel@gnu.org; Sun, 20 Aug 2023 16:27:25 -0400 Original-Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qXp17-00046Q-GS for emacs-devel@gnu.org; Sun, 20 Aug 2023 16:27:24 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 98B89240027 for ; Sun, 20 Aug 2023 22:27:19 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1692563239; bh=d/qN0lDSWSGiJKaQO6qibN4C6y3rtCuAzVAaAL/U/Rk=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Autocrypt:OpenPGP: From; b=IENxzUuiN4vybaZNtPoBX8jrlwRnKLA8O4ln2A14o1QewxCH2ZZyYJYsP792Oen/U soLAHeeI5Dwih2d6QYlYjdvuRBKrCd5cFIlj5tgkv/lZuaJ3fEEnMbi+BQhjOggPOM BwIH4a4R3chX+/39bNMkL88mIyyeN+P4NtS6fgMuBIzcOI71EUaq3T7AqFcVcjDiVT cavsGunx16SfirHgnOt7O8l6aKQ2xV1udsP7xpBuaNULoZ5FSDUzjL7+TwYYSCTFGa r0Ky8tp2GRuQBgoj2vNJbxcFfr2P6qYMenB0aZ/UB5mw8kUbZmMIuOkYTbv3LgZzr2 Ol0Jq0TUQmwNw== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4RTRwz37lqz6tv5; Sun, 20 Aug 2023 22:27:15 +0200 (CEST) In-reply-to: <87h6otttfa.fsf@posteo.net> Autocrypt: addr=thievol@posteo.net; prefer-encrypt=mutual; keydata=xsDNBF8ylcIBDADG+hy+zR6L4/vbdDDZuSaMmSrU3A5QZJpeBCvxTr7MpzzruZbhLPW1K3R6N2MAedi8Y+C8o27FVRIjpdbaKMGu9je7JV/TbUQYo3SOwCK1vM4LUn4V6ZLzSYkuiEt4eyMoiDdyvN0pkcK6P9x9DCetcEVszXzQg+yzCVrQ2hXWDXWT4M18EC3wtO7RHPouMqGiwBFhBAYErCqFWFxQHkfbtG/4yGyJ58rglb65O3qijjMWvYwcWZun9/7qm8Z4/4mHopmo2zgU+OrptnLSZfkZGz3Y7Uf452xQGVq0Fv75NPvQru7y+DYVhuVXXyAmGxt+vf4rIiixMBbhKEPjcxEPAa2LTzex2IsTZR+QVG9uDnqCWcgaOEQ58fzXNvNhtwwF/Rgio2XWAJVdmFWS59/k9W58CIUSNKBMZh2XeGdEmtHvDtCxW3z6FJha36RzOM3fMNNiAGdFZJA84gcdloJR+sHCDTTPT3784fjr+V8An7sI581NGFzkRQqPvEQCZbUAEQEAAc0SdGhpZXZvbEBwb3N0ZW8ubmV0wsEOBBMBCgA4AhsDBQsJCAcCBhUKCQgLAgQWAgMBAh4BAheAFiEEI9twfRN7r3nig/xwDsVtFB0W75MFAmL3HCoACgkQDsVtFB0W75OVEAv/f6XxmtIFz08fUb8hBp/zJP6IC4/rhhh+0GMRIRzLN8DK0jV8JCzYdFHiRJOy2lNIOpmrrCmjRRxferc2G42+ePFIsslxhU46VSz1Z83NwIG3mpdYNV5WUTUdgzx ExHTNTFCd7NKv0nlHKQaAtdXm5bYnSHsnL7cx8z OpenPGP: url=https://posteo.de/keys/thievol@posteo.net.asc; preference=encrypt Received-SPF: pass client-ip=185.67.36.65; envelope-from=thievol@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -53 X-Spam_score: -5.4 X-Spam_bar: ----- X-Spam_report: (-5.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H5=-1, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:308997 Archived-At: --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Thierry Volpiatto writes: > Philip Kaludercic 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: =2D-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 o= nly-local (= cadr (assq (car req) package-alist)) (pa= ckage-get-descriptor (car req)))) (version<=3D (= version-list-<=3D (c= adr req) (p= ackage-desc-version matched)))) (more matched)) deps))) (delete-dups (cons pkg-desc deps))))) (more desc)))) (remq pkg (mapcar (if (package-desc-p pkg) #'identity #'package-d= esc-name) all))))) =2D-8<---------------cut here---------------end--------------->8--- =2D-=20 Thierry --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQHHBAEBCgAxFiEEI9twfRN7r3nig/xwDsVtFB0W75MFAmTidx4THHRoaWV2b2xA cG9zdGVvLm5ldAAKCRAOxW0UHRbvk95uC/0QVEXT0PIs9CxCgHqm5hbI6F10CEKB bDWna0tEytkVUNzoeVRemLIy+X/4L/MhKtAO3Y/fum2RmA2K0JiUvD7ebGBdjQED 6G0xp8bEmCdcyy7au5Qk0uwfVnYEpAzsDXeTWCr04iNOYdMFtoYUPxkMiVHAiVeJ CD2p5lGx7L+gUG7XS8/RGPu+MncFDUYtbgMwUbc9LWnre+V9NR9N9MqWRZVlQtpa Dabw3Z8cmLVupNLXIwaBj4mhngyq5WnQgJlf/01DNjSiKB6nzUr23kosNgT97lkL qAs3JFHWqSePpLCnho4UCp0hJE98Z70Vc8BBOKDTMSITZkjS9h03s9Va2eb6y922 xchG0ea0t+CHFpOV+JiksxyCA76/D8B0aTQuKIYz2t7lshLXh8RBnE4iP+/rLPtp /6c1BsC+zE3Wmfm2T1HCk/bCI8C/wKdDJge22YgVfxDtvXmMoRHOeG8rRvHuhlxu /uuqDhd9S2IjxMllcwtt19gVrecVq9SHm7I= =WVyN -----END PGP SIGNATURE----- --=-=-=--