-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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 Request] Offer a flag to skip installs/updates that failed to download #4135
Comments
I think even if this function cannot be implemented, the update command can add the function of excluding certain software during the update, which should be more convenient. |
|
Okk,thank you! |
Any updates on this one? If no one is working on this issue, may I work on this one? I would like to introduce a new flag, but I didn't know which name is okay for this feature. What I planned is to introduce a parameter for |
Yes @Lutra-Fs, please go ahead! |
I just wrote a quick script which does this for anyone who's interested: scoop update;
foreach ($app in (scoop status)) {
if ($APP.Info -eq "Held package") {
continue;
}
try {
scoop update $app.Name;
}
catch {
Write-Output "$($app.Name) failed to update!"
scoop reset $app.Name;
}
if ($LASTEXITCODE -ne 0 -or $? -eq $FALSE) {
Write-Output "$($app.Name) failed to update!"
scoop reset $app.Name;
}
} If there are any improvements that can be made to this, please let me know! updated 2024-02-29 to fix this script not working with gifsicle broke |
Thanks for the idea and code :) As I allways have some "frozen" packages, I'd sipping those "held" ones with an extra IF check. Therefore my code would look like below:
|
thank you guys for the powershell scripts.. that helps.. i wanted to ask nevertheless if this feature is going to be implemented or what the status is. |
I wrote a temporary and simple python3 script for batch updating. #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
@Date : 2024/1/11
@Author : vicrack
The scoop update command is too slow.
This script uses multiple processes to update Scoop programs concurrently, increasing speed.
Even if one program fails to update, it won't affect the others.
"""
import re
import subprocess
import multiprocessing
def get_updates():
status_output = subprocess.check_output("scoop.cmd status")
lines = status_output.decode().splitlines()
# Find the programs that need updating
updates = set()
in_updates = False
for line in lines:
line = line.strip()
if line:
data = line.split()
if data[0].endswith("----"):
in_updates = True
elif in_updates:
program = data[0]
if not line.endswith(('Held package', 'Manifest removed')):
updates.add(program)
return updates
def update_program(program):
# Skip hash validation!
subprocess.run(f"scoop.cmd update {program} -s")
def main():
# update scoop, buckets
subprocess.run('scoop.cmd update')
updates = get_updates()
if not updates:
print("No updates available.")
exit(0)
print(updates)
# Update multiple programs concurrently using multiple processes
with multiprocessing.Pool(processes=5) as pool:
pool.map(update_program, updates)
# subprocess.run('scoop.cmd cache rm *')
# subprocess.run('scoop.cmd cleanup *')
if __name__ == "__main__":
main()
|
This script works under Windows 11 but doesn't work under Windows 10. Apparently scoop status appends to the output the ascii for color codes and it always output No updates available. even when there are updates available. Do you know how to fix this? |
possibly a bug, I will fix this. |
a good solution now ~~ I hope Scoop can add a parameter |
When installing more apps using scoop, upgrading all applications using
scoop update *
would frequently fail, mainly because a maintainer didn't keep up with the newest version.And one failed update would break others to continue! I know I could hold an app and retry again, but that would be too painful.
The text was updated successfully, but these errors were encountered: