all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Automatically saving package sources
@ 2024-02-02 15:01 sbaugh
  2024-02-03 22:08 ` Stefan Kangas
  2024-02-04 10:22 ` Philip Kaludercic
  0 siblings, 2 replies; 4+ messages in thread
From: sbaugh @ 2024-02-02 15:01 UTC (permalink / raw)
  To: emacs-devel


It is nice for installed ELPA packages to be reinstalled when Emacs is
upgraded or changed, since there can be changes to autoload generation,
the byte compiler, the native compiler, or other things which will
change the output from the package installation.

Furthermore, it is nice (where possible) for this reinstallation to
happen with the same version of the package rather than by fetching the
latest version from ELPA.  This minimizes the number of changes that
happen at once.

However, right now there is no easy way to reinstall a package from the
same sources it was originally installed from, because those sources are
not saved separately from the package itself.  They are all mixed
together in the installed package directory.  This makes it impossible
to produce a "clean slate" environment for reinstalling the package,
which (since packages can create arbitrary files during
byte-compilation) means the package can't be reinstalled in a way that's
identical to its original installation.

If package.el supported saving the package source separately, however,
it could simply reinstall from that.

I would like to add an option package-save-sources which makes
package.el automatically save the package source for the currently
installed package version in a separate directory.  Perhaps in
~/.emacs.d/elpa-sources.

When package-save-sources is enabled, then package-reinstall would
reinstall a package from the saved source rather than upgrading the
package.  package-upgrade would delete the saved source and fetch a new
version.

Does this seem like a reasonable feature to add?

As an additional benefit, elpa-sources would be useful for reviewing
changes in the source when upgrading packages.  It could be optionally
maintained as a VCS repository, with packages saved to a constant path
based on their name (e.g. elpa-sources/xref.el instead of
elpa-sources/xref-1.2.3/xref.el).  Then a VCS could be used to review
the diff resulting from an upgrade.  This would be useful for any user
who wants to scrutinize package code changes before installing them.




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-02-04 10:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-02 15:01 Automatically saving package sources sbaugh
2024-02-03 22:08 ` Stefan Kangas
2024-02-03 22:28   ` Stefan Monnier
2024-02-04 10:22 ` Philip Kaludercic

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.