Opened 6 years ago

Closed 5 years ago

Last modified 4 years ago

#14603 closed bug (fixed)

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

Reported by: diver Owned by: waddlesplash
Priority: normal Milestone: R1/beta2
Component: Applications/Command Line Tools Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
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 (8)

comment:1 by waddlesplash, 6 years ago

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

comment:2 by diver, 5 years ago

Just had it again in hrev52698.

comment:3 by diver, 5 years ago

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 by waddlesplash, 5 years ago

Resolution: fixed
Status: assignedclosed

Fixed in hrev53118.

comment:5 by nzimmermann, 5 years ago

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 by waddlesplash, 5 years ago

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

comment:7 by nzimmermann, 5 years ago

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

comment:8 by nielx, 4 years ago

Milestone: UnscheduledR1/beta2

Assign tickets with status=closed and resolution=fixed within the R1/beta2 development window to the R1/beta2 Milestone

Note: See TracTickets for help on using tickets.