Skip to content
New issue

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

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

Already on GitHub? # to your account

Feature request - Show possible download size in status command #2381

Closed
DesigningKnights opened this issue Jul 11, 2018 · 12 comments · Fixed by #6035
Closed

Feature request - Show possible download size in status command #2381

DesigningKnights opened this issue Jul 11, 2018 · 12 comments · Fixed by #6035

Comments

@DesigningKnights
Copy link

DesigningKnights commented Jul 11, 2018

When doing a > scoop list command, it would be very helpful to show what apps have updates available, next to it's version number. Yes, I know that doing scoop update shows new available, but when having many apps installed it's hard to keep track of all that, and the main update command only shows the most recent anyway, not ones it listed in the past.

Also, a upgrade command, like what apt-get does would help:

scoop upgrade

much like the way apt-get upgrade works, it would be nice for scoop to get the list of upgradable apps, then have it show which ones will upgrade and the amount of data it may take.

Oh, speaking of, it may be helpful to actually put the file sizes in the scoop buckets and have the install command confirm the download first, showing the file size. I have a data cap, so every byte counts.

@chawyehsu
Copy link
Member

chawyehsu commented Jul 11, 2018

There is scoop status sub-command for checking installed apps updates, and scoop update <app> for upgrading an app (or scoop update * for upgrading all apps installed). Give them a try!
💯 ❤️

@DesigningKnights
Copy link
Author

Still, knowing how large a download is before doing it would be very helpful. Even apt-get tells you how much the install will take. Those of us on metered connections need to know how much data we will be consuming.

@chawyehsu
Copy link
Member

Oh, yeah. Calculating and showing the file size before confirming download would be a good feature. Don't know if we could get the file size of the package before triggering download. cc @r15ch13

I assume your request similar to below concept:

$ scoop list
# show installed apps, blablabla....
$ scoop status
# show updates available, blablabla...
$ scoop update *
Reading package lists... Done   
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
  7zip, git, openssh
Need to get around 48.5 MB of archives.
Do you want to continue? [Y/n] n
$ scoop update git
Reading package lists... Done   
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
  git
Need to get around 39.2 MB of archives.
Do you want to continue? [Y/n] n
$ scoop update git -y
# Trigger upgrade! blablabla

@r15ch13
Copy link
Member

r15ch13 commented Jul 11, 2018

@h404bi yeah, it may be possible, but this also requires a complete rewrite of lib/install.ps 😁

@DesigningKnights
Copy link
Author

well the bucket could have the file size added to it. During creation of the bucket, get the installer size from explorer, and add a field. This way the file size would be pre-known.

@rasa
Copy link
Member

rasa commented Jul 12, 2018

For http URLs, a HEAD request will often return the file size.

@rashil2000 rashil2000 changed the title Feature request - show apps with updates available with list command Feature request - Show possible download size in status command Jan 7, 2022
@tech189
Copy link
Member

tech189 commented Jul 8, 2022

In Scoop version 0.2.3, there is now a section in scoop info that shows the download size of an app - which you can check before installation 😄 Just use the verbose flag, e.g.: scoop info firefox -v will output the following:

Name          : firefox
Description   : Popular open source web browser.
    ...
Download size : 53.2 MB
    ...

I understand this is only a partial fix to this issue, but hopefully it will still be helpful!

@CHerSun
Copy link

CHerSun commented Aug 27, 2023

scoop info -v ... checks installed size in wrong location - current folder instead of scoop\apps folder:

# scoop info -v far:

Get-ChildItem : Cannot find path 'C:\Users\CHerSun\far' because it does not exist.
At C:\Users\CHerSun\scoop\apps\scoop\current\libexec\scoop-info.ps1:115 char:25
+ ... rentFiles = Get-ChildItem $appFiles -Filter (Select-CurrentVersion $a ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (C:\Users\CHerSun\far:String) [Get-ChildItem], ItemNotFoundException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetChildItemCommand

Measure-Object : The property "Length" cannot be found in the input for any objects.
At C:\Users\CHerSun\scoop\apps\scoop\current\libexec\scoop-info.ps1:123 char:64
+ ... ldItem $fileType -Recurse | Measure-Object -Property Length -Sum).Sum
+                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Measure-Object], PSArgumentException
    + FullyQualifiedErrorId : GenericMeasurePropertyNotFound,Microsoft.PowerShell.Commands.MeasureObjectCommand


Name           : far
Description    : A text-mode files and archives manager
Version        : 30b6060 (Update to 3.0.6161 available)
Bucket         : main
Website        : https://farmanager.com
License        : BSD-3-Clause (https://farmanager.com/license.php)
Updated at     : 09.06.2023 23:24:25
Updated by     : github-actions[bot]
Manifest       : C:\Users\CHerSun\scoop\buckets\main\bucket\far.json
Installed      : C:\Users\CHerSun\scoop\apps\far\30b6060
Installed size : Persisted data:   14,6 KB
                 Total:            14,6 KB
Binaries       : far.exe

# scoop --version:

Current Scoop version:
v0.3.1 - Released at 2022-11-15
...

Narrowed that down. pwsh runs everything correctly, windows original powershell (v5.1....) is where issue occurs.

@rashil2000
Copy link
Member

scoop info -v ... checks installed size in wrong location - current folder instead of scoop\apps folder:

Narrowed that down. pwsh runs everything correctly, windows original powershell (v5.1....) is where issue occurs.

I'm unable to repro this in PowerShell 5.1

@ToNyRANDRIAMANANTSOA
Copy link

If using aria2c, the file size is previewed in the progress info, but that way it still needs to start the download before knowing its size.
image

Using scoop info -v gave the wrong download size though 🤨, here for example 49B vs 120MiB (the actual size previewed with aria2c)
image

@tech189
Copy link
Member

tech189 commented May 10, 2024

Using scoop info -v gave the wrong download size though 🤨, here for example 49B vs 120MiB (the actual size previewed with aria2c)

If you put the download link through https://httpheader.io/ you can see there is a 302 redirect, so Scoop gets the Content-Length of the first response but doesn't follow through any further. I'm not at my computer right now but it might be possible to send a follow up request if the HTTP status code is a redirect. You're very welcome to send a PR if you can!

@niheaven
Copy link
Member

No, the issue pertains to a header that is being returned as an array. I'll fix it soon.

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

Successfully merging a pull request may close this issue.

9 participants