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

feat(quickget): Show download path #1516

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

abitrolly
Copy link

Description

I want to know where big files are stored without opening the browser.

Type of change

  • New feature (non-breaking change which adds functionality)

Checklist:

  • I have performed a self-review of my code
  • I have tested my code in common scenarios and confirmed there are no regressions
  • I have added comments to my code, particularly in hard-to-understand sections
  • I have made corresponding changes to the documentation (remove if no documentation changes were required)

@popey
Copy link
Contributor

popey commented Nov 20, 2024

Thanks for the PR @abitrolly. I'm in two minds about this. I appreciate extra debug information in the output from quickget. However, in this case, the line immediately after download and check, prints the exact same path. Here's the run with your patch, and note after the #### 100.0% line is followed by a line confirming a good sha256sum, while printing out the path.

./quickget alpine v3.20
Downloading Alpine Linux v3.20
- URL: https://dl-cdn.alpinelinux.org/alpine/v3.20/releases/x86_64/alpine-virt-3.20.3-x86_64.iso
- PATH: alpine-v3.20/alpine-virt-3.20.3-x86_64.iso
################################################# 100.0%
Checking alpine-v3.20/alpine-virt-3.20.3-x86_64.iso with sha256sum... Good!
Making alpine-v3.20.conf
 - Setting alpine-v3.20.conf executable

To start your Alpine Linux virtual machine run:
    quickemu --vm alpine-v3.20.conf

@popey popey requested a review from flexiondotorg November 20, 2024 17:22
@abitrolly
Copy link
Author

Well, it is hard to notice from the checksum line that the filename actually contains the path. In any case I don't think it hurts much to have both download and checksum show file they operate with. Maybe the checksum line can be omitted.

Caught strange thing - if v prefix is omitted, no checksum check is being done.

$ ./quickget alpine 3.20
Downloading Alpine Linux 3.20 
- URL: https://dl-cdn.alpinelinux.org/alpine/3.20/releases/x86_64/alpine-virt--x86_64.iso
################################################################################################################################################################# 100.0%

To start your Alpine Linux virtual machine run:
    quickemu --vm alpine-3.20.conf

@philclifford
Copy link
Contributor

philclifford commented Dec 30, 2024

@abitrolly if you omit the v the download fails so there's nothing to check (the release check really could be tighter and should fail before attempting the download).
@popey at the moment not every installation medium comes with a hash to check so some might not output the path as part of the check. (see #1545 )
I'd be minded to add this little extra output, but I wonder if outputting the apparent absolute rather than the relative path would be better.

@@ -1218,6 +1218,7 @@ function web_get() {
if [[ ${OS} != windows && ${OS} != macos && ${OS} != windows-server ]]; then
echo "Downloading $(pretty_name "${OS}") ${RELEASE} ${EDITION}"
echo "- URL: ${URL}"
echo "- PATH: ${DIR}/${FILE}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
echo "- PATH: ${DIR}/${FILE}"
echo "- PATH: ${PWD}/${DIR}/${FILE}"

Maybe useful for those with several collections of VMs dotted around the filesystem or on several external drives

@lj3954
Copy link
Member

lj3954 commented Jan 2, 2025

@abitrolly if you omit the v the download fails so there's nothing to check (the release check really could be tighter and should fail before attempting the download). @popey at the moment not every installation medium comes with a hash to check so some might not output the path as part of the check. (see #1545 ) I'd be minded to add this little extra output, but I wonder if outputting the apparent absolute rather than the relative path would be better.

Why do we proceed if the download fails? That's a bug as well.

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

Successfully merging this pull request may close these issues.

4 participants