Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] scoop import scoopfile.json --update #6116

Open
W1M0R opened this issue Aug 22, 2024 · 2 comments
Open

[Feature] scoop import scoopfile.json --update #6116

W1M0R opened this issue Aug 22, 2024 · 2 comments

Comments

@W1M0R
Copy link

W1M0R commented Aug 22, 2024

Feature Request

Is your feature request related to a problem? Please describe.

I want to use scoop import scoopfile.json, but can't because I also want to update the installed apps listed in that file.

Describe the solution you'd like

It would be nice to have a scoop import scoopfile.json --update command, that would install the packages if they are not already present, and update the installed packages if they are already present.

Since the scoopfile.json can also contain buckets, the --update could also update the buckets, or an alternative flag could be added that would update what you desire, e.g. both --update-apps and --update-buckets could be used.

The --update-x flags don't necessarily have to update the data stored inside the scoopfile.json. That file can remain untouched by the update process, if this makes the feature request simpler to implement.

Describe alternatives you've considered

I decided not to use the scoop import functionality, and just add all do the following in a script:

scoop install fzf
scoop update fzf
scoop install gum
scoop update gum
...

Another method might require parsing the json file and calling scoop update for every package listed. What I like about scoop import, is its fast execution (since one execution of the scoop process is controlling the entire process). It would be nice not to have to call manually into scoop for every update:

  scoop import scoopfile.json
  # update the buckets:
  scoop update
  # update the apps:
  jq -r '.apps[].Name' scoopfile.json | foreach { scoop update $_ }

Another method is:

scoop import scoopfile.json
scoop update "*"

ERROR Hash check failed!
App:         extras/foxit-reader
URL:         https://cdn78.foxitsoftware.com/product/reader/desktop/win/2024.2.3/FoxitPDFReader202423_enu_Setup_Prom.exe
First bytes: 4D 5A 50 00 02 00 00 00
Expected:    0bd3513df6e2bbe2f394154c81278e5fd997c93232a76ff047d61ee25dddbc7b
Actual:      2a40501c6f663d29b7d7865f7166b6665fc5b689ab8e8a575a1656c4c5e7f526

Please try again or create a new issue by using the following link and paste your console output:
https://github.com/ScoopInstaller/Extras/issues/new?title=foxit-reader%402024.2.3%3a+hash+check+failed 

But this is problematic, because sometimes updating unrelated packages causes the process to fail. In this example, foxit-reader is not in the scoopfile.json and not relevant to my project, but it fails my project setup task.

@rashil2000 Thanks for adding the original import functionality, it is very useful! #5014

@JTBrinkmann
Copy link

Any particular reason to not simply update all scoop apps? scoop update *
To me, it looks like importing scoop installations and updating your already installed apps are two separate use cases, not sure why those should be mixed. When doing scoop import, it already ignores the version field and installs the latest version anyways (for non-autogenerated manifests).

@W1M0R
Copy link
Author

W1M0R commented Sep 4, 2024

Any particular reason to not simply update all scoop apps? scoop update *

I would use the proposed functionality for automating updates of a specific set of apps (as listed in a manually created scoopfile). Using scoop update * will update all scoop apps on the system, and may have unintended consequences (such as broken apps etc) or be too pervasive for users or too costly (in terms of downloads and time spent). A scoopfile that only contains git for example, that installs updates to git on a periodic basis, should not require an update to every scoop app on the system.

To me, it looks like importing scoop installations and updating your already installed apps are two separate use cases, not sure why those should be mixed.

You are right, they don't have to be mixed. There could be a separate command called scoop update scoopfile.json.

When doing scoop import, it already ignores the version field and installs the latest version anyways (for non-autogenerated manifests).

That's correct. This request is specifically to update existing installed apps to their latest available version (so the version field can be ignored here as well). Currently, the import will just ignore installed apps, which is correct. But adding an --update flag could inform it to update installed apps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants