Opened 11 months ago

Closed 3 months ago

Last modified 3 months ago

#14603 closed bug (fixed)

[pkgman] download progress is broken in non-interactive mode

Reported by: diver Owned by: waddlesplash
Priority: normal Milestone: Unscheduled
Component: Applications/Command Line Tools Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Has a Patch: no Platform: All

Description

Beta1.

pkgman either showsw green progress bar at the bottom of Terminal or something like this:

Now it shows this with no color background:
Continue? [yes/no] (yes) : yes
  0%100% vmware_addons-1.2.0-2-x86_64.hpkg [78.61 KiB]
Validating checksum for https://eu.hpkg.haiku-os.org/haikuports/master/x86_64/current/packages/vmware_addons-1.2.0-2-x86_64.hpkg...done.

Change History (7)

comment:1 Changed 9 months ago by waddlesplash

Still happening after the switch to NetApi for package kit downloads?

comment:2 Changed 8 months ago by diver

Just had it again in hrev52698.

comment:3 Changed 7 months ago by diver

Summary: [pkgman] download progress is broken sometimes[pkgman] download progress is broken in non-interactive mode

Ok, finally figured out. Progress is broken in non-interactive mode, e.g. when pkgman -y is used.

comment:4 Changed 3 months ago by waddlesplash

Resolution: fixed
Status: assignedclosed

Fixed in hrev53118.

comment:5 Changed 3 months ago by nzimmermann

Dear Augustin,

just noticed in https://git.haiku-os.org/haiku/commit/?id=45c3eb3a3c98041ab5543901a94cb511ff7fd1f6 that the new variable fShowProgress is not initialized in the constructor, which is bad practice in C++.

I did not check wheter this is true for the other variables, just spotted this and wanted to let you know.

Have a nice day, Niko

comment:6 Changed 3 months ago by waddlesplash

The variable is never used before it is initialized in ProgressPackageDownloadStarted. So it should be fine as-is.

comment:7 Changed 3 months ago by nzimmermann

Dear Augstin,

sure -- the logic is fine as-is at the moment, I did not claim it is a bug. Though, it is still bad practice, because if at a later stage code is added, that e.g. checks the fShowProgress state before it is set, uninitialized memory is read.

To avoid surprises, variables should always be initialized. Feel free to ignore it though, it is not crucial and you have for sure other things to take care of..

Have a nice day, Niko

Note: See TracTickets for help on using tickets.