pulsar-edit / ppm

Pulsar Package Manager
MIT License
35 stars 13 forks source link

Don't Reinstall Installed Packages (when installing from package-file) #117

Open emendir opened 8 months ago

emendir commented 8 months ago

Have you checked for existing feature requests?

Summary

The Problem

When installing a list of packages from a file using the command ppm install --packages-file ./MyPackages.txt, and for some reason the installation of a single package in this list fails (e.g. broken internet connection), re-running the command results in all packages, even those that have already been successfully installed, being rebuilt and reinstalled.

The Solution

When ppm installs packages from a file, it should only install those packages which aren't yet installed, skipping those packages that are already installed.

This behaviour could be optional, e.g. activated by a CLI argument such as --dont-reinstall

What benefits does this feature provide?

This feature would greatly improve the resiliency of PPM when installing multiple packages at once, as it would allow an interrupted installation process to continue where it left off instead of started all over again.

Any alternatives?

I don't see any similarly efficient or effective solutions to the described problem.

Other examples:

No response

confused-Techie commented 8 months ago

This is a great suggestion, and would love to see any PRs attempting an implementation, otherwise is hopefully something that can be looked at soon. Thanks for the contribution!

Daeraxa commented 8 months ago

This does technically introduce a breaking change if we were to add it.

i.e. currently ppm install can be used to both install a package from scratch as well as updating an existing package.

Of course there are other commands, namely ppm upgrade and ppm update (and ppm outdated) which, when run alone will perform updates for everything on the system but can accept the package name as an argument.

Although technically breaking I think there is a case for making some changes to some of these commands. Essentially what is being requested here is unrelated to the package file but asking to change the behaviour of how the install command works.

emendir commented 6 months ago

This does technically introduce a breaking change if we were to add it.

i.e. currently ppm install can be used to both install a package from scratch as well as updating an existing package.

It wouldn't be a breaking change if ppm install were to update out-of-date packages and skip reinstalling up-to-date packages.

2colours commented 4 months ago

@emendir this already seems to be the intended behavior for everything that isn't "installed globally", whatever that means. https://github.com/pulsar-edit/ppm/blob/bc06ac66615eb90e0977e46f45603acefd49c5b0/src/install.js#L267

I don't know if that is supposed to be an option somehow coming from the user, all I can see is that it's set to false for dependencies.

The question really is whether lifting that if-check could break anything elsewhere.