Skip to main content

50.5 Fetching Package Sources

By default package-install downloads a Tarball from a package archive and installs its files. This might be inadequate if you wish to hack on the package sources and share your changes with others. In that case, you may prefer to directly fetch and work on the upstream source. This often makes it easier to develop patches and report bugs.

One way to do this is to use package-vc-install, to fetch the source code for a package directly from source. The command will also automatically ensure that all files are byte-compiled and auto-loaded, just like with a regular package. Packages installed this way behave just like any other package. You can upgrade them using package-upgrade or package-upgrade-all and delete them again using package-delete. They are even displayed in the regular package listing. If you just wish to clone the source of a package, without adding it to the package list, use package-vc-checkout.

Note that currently, built-in packages cannot be upgraded using package-vc-install.

With the source checkout, you might want to reproduce a bug against the current development head or implement a new feature to scratch an itch. If the package metadata indicates how to contact the maintainer, you can use the command package-report-bug to report a bug via Email. This report will include all the user options that you have customized. If you have made a change you wish to share with the maintainers, first commit your changes then use the command package-vc-prepare-patch to share it. See Preparing Patches.

If you maintain your own packages you might want to use a local checkout instead of cloning a remote repository. You can do this by using package-vc-install-from-checkout, which creates a symbolic link from the package directory (see Package Files and Directory Layout) to your checkout and initializes the code. Note that you might have to use package-vc-rebuild to repeat the initialization and update the autoloads.