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

Tito report --nvr #495

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

praiskup
Copy link
Member

@praiskup praiskup commented Feb 21, 2024

Draft only. Not sure what would have to be done to make this eventually happen?

@praiskup praiskup marked this pull request as draft February 21, 2024 09:24
@FrostyX
Copy link
Member

FrostyX commented Feb 23, 2024

Not sure what would have to be done to make this eventually happen?

Soo, it seems to do something:

[jkadlcik@zeratul tito]$ PYTHONPATH=/home/jkadlcik/git/tito/src/ python3 /home/jkadlcik/git/tito/src/tito/cli.py report --nvr
Creating output directory: /tmp/tito
tito-0.6.25.post1-1.git.2.9c99222

What is the expected result?

@praiskup
Copy link
Member Author

The output is expected, though I'm not sure about the Creating output directory: /tmp/tito. I'll try to take another look once the time permits me to.

@praiskup
Copy link
Member Author

I retook a quick look today, but #502 IMO proves this solution is
sub-optimal. We are duplicating the munge_specfile logic
together with get_spec_version_and_release. And we should do things in
one place.

Also, ideally, things like this should work fine on a read-only filesystem (so
no temporary files or dirs are needed). I think we should refactor
munge_specfile so it doesn't decide the Release/Version itself, but it accepts
these values from the caller (pre-parsed & read-only). Then, the NVR is "known"
before we even start munging.

The builder.display_version has a tricky value. That doesn't match anything
else, so it is not reusable (tito-git-<sha-ref> basically). We should make it
match the overall src.rpm pattern, like tito-<Version>-<sha-ref>. Then we
could use it on many other places (like report --nvr).

Then, I tend to think we should have tito report nvr sub-command (instead of
--nvr), because we need to add, e.g., the --test option which doesn't
logically match with the other report options).

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