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

RepomdRecord "size_open" is initialized to -1, but "size" is uninitialized #297

Open
dralley opened this issue Dec 8, 2021 · 2 comments

Comments

@dralley
Copy link
Contributor

dralley commented Dec 8, 2021

I came across this unintuitive behavior just now. The value size on RepomdRecord defaults to 0 if not touched (but I think it's not an actual default, it's just uninitialized [0]). Whereas the value open_size defaults to -1.

[0] https://github.com/rpm-software-management/createrepo_c/blob/master/src/repomd.c#L55

Is this intended?

@dralley
Copy link
Contributor Author

dralley commented Jan 4, 2022

@kontura ^

@kontura
Copy link
Contributor

kontura commented Jan 5, 2022

Unfortunately the commit which introduced this isn't very helpful: eb9c50e

Looking at the code I think open_size is supposed to be optional, there is a condition which dumps the element only if it is different from -1 whereas size is dumped every time but this could have been possibly achieved with 0 as well..
(It is possible to use modifyrepo_c to add a --no-compress record which doesn't have open_size but it also doesn't set size which is present but 0. It doesn't seem to work very well.)

I can't think of any specific reason for this.

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

No branches or pull requests

2 participants