-
Notifications
You must be signed in to change notification settings - Fork 74
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
fix: Installed-Size #160
fix: Installed-Size #160
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for catching this!
src/bundle/linux/deb_bundle.rs
Outdated
writeln!( | ||
&mut file, | ||
"Installed-Size: {}", | ||
total_dir_size(data_dir)? / 1024 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From the doc you linked, looks like this is supposed to be total size / 1024, rounded up? This is currently rounding down.
One way to do this would be to write (total_dir_size(data_dir)? + 1023) / 1024
(see https://stackoverflow.com/a/2745086). Or I guess you could cast to float and use ceil()
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather not cast as float, the SO solution looks good
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, not compiling
Thanks! |
fixed wrong calculation of Installed-Size in control file