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

fix: Installed-Size #160

Merged
merged 3 commits into from
Sep 27, 2023
Merged

fix: Installed-Size #160

merged 3 commits into from
Sep 27, 2023

Conversation

markisha64
Copy link
Contributor

fixed wrong calculation of Installed-Size in control file

@markisha64
Copy link
Contributor Author

#102

@markisha64
Copy link
Contributor Author

Copy link
Collaborator

@mdsteele mdsteele left a 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 Show resolved Hide resolved
writeln!(
&mut file,
"Installed-Size: {}",
total_dir_size(data_dir)? / 1024
Copy link
Collaborator

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().

Copy link
Contributor Author

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

Copy link
Collaborator

@mdsteele mdsteele left a comment

Choose a reason for hiding this comment

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

Oops, not compiling

src/bundle/linux/deb_bundle.rs Outdated Show resolved Hide resolved
@mdsteele mdsteele merged commit 7716e38 into burtonageo:master Sep 27, 2023
3 checks passed
@mdsteele
Copy link
Collaborator

Thanks!

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.

2 participants