Open Aster-the-Med-Stu opened 4 years ago
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.
scoop help hold
scoop help hold
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 install_app
called exit_when_error, default to true, and if false use error function to output error instead of abort for the other functions may abort the process. May I know if that is a okay solution?
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
install_app
called exit_when_error, default to true, and if false use error function to output error instead of abort for the other functions may abort the process. May I know if that is a okay solution?
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:
foreach ($APP in (scoop status)) {
if ($APP.Info -eq "Held package") {
Write-Host -ForegroundColor DARKBLUE -BackgroundColor WHITE "`"$($APP.Name)`"" -NoNewline
Write-Host ": skipped held package."
continue
}
scoop update $APP.Name;
if ($LASTEXITCODE -ne 0) {
Write-Host -ForegroundColor RED -BackgroundColor WHITE "`"$($APP.Name)`""
Write-Host ": failed to update!"
scoop reset $APP.Name;
}
}
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()
I wrote a temporary and simple python3 script for batch updating.
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?
I wrote a temporary and simple python3 script for batch updating.
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.
https://github.com/ScoopInstaller/Scoop/issues/4135#issuecomment-1886146727
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.