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

Difference in comment parsing #1638

Open
rowlap opened this issue Dec 13, 2023 · 1 comment
Open

Difference in comment parsing #1638

rowlap opened this issue Dec 13, 2023 · 1 comment
Labels
Triaged Someone on the DNF 5 team has read the issue and determined the next steps to take

Comments

@rowlap
Copy link

rowlap commented Dec 13, 2023

#1484 was closed last year, but I think there's a difference worth documenting in the comment syntax.

$ cat dnf.conf
[main]

excludepkgs =
  # packages we don't want
  nginx

$ python3 -c "import configparser; c = configparser.ConfigParser(); c.read('dnf.conf'); print(dict(c.items('main')))"
{'excludepkgs': '\nnginx'}


$ dnf -v --config dnf.conf help | grep Exclude
Excludes in dnf.conf: #, don't, nginx, packages, want, we

The code in libdnf IniParser only considers comments to begin in column 0.

For a boolean/int option this is more obvious as trailing comments will be invalid, but for list options it's an easy trap to fall in to (guess why I'm filing this issue).

Please either document the libdnf comment syntax, or change the parser to align with python configparser, and even then it's still worth documenting.

@jan-kolarik
Copy link
Member

Thanks for the report. We should definitely at least document the behavior.

@jan-kolarik jan-kolarik added the Triaged Someone on the DNF 5 team has read the issue and determined the next steps to take label Dec 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Triaged Someone on the DNF 5 team has read the issue and determined the next steps to take
Projects
None yet
Development

No branches or pull requests

2 participants