-
Notifications
You must be signed in to change notification settings - Fork 400
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
refactor: maintain dracut version in dracut.sh #2500
base: master
Are you sure you want to change the base?
Conversation
@ahesford - do you have any thoughts on the approach in this PR ? |
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 didn't want to mean this in #2450 (comment), I was thinking of just setting DRACUT_VERSION
at the beginning of dracut.sh
and leave the rest of the code untouched.
If we have to sed
any .sh
script, I prefer #2450 and do it on the dedicated dracut-version.sh
.
I don't have strong opinions on how to handle versioning in project repositories. It's a hard enough problem that, in Python, a million different packages exist to try to divine the version from various markers. That said, the approach in this PR is pretty much how we handle versioning for ZFSBootMenu. A releng/tag-release.sh script does some git magic to extract release notes, prepare the branch for tagging, and overwrites the version of the one script that requires it. It works well enough for us! |
2cafa15
to
1e8777e
Compare
Just a nit, but this PR no longer a fix, it is more of a refactor. Just mentioning this to prioritize and help with reviews. |
This issue is being marked as stale because it has not had any recent activity. It will be closed if no further activity occurs. If this is still an issue in the latest release of Dracut and you would like to keep it open please comment on this issue within the next 7 days. Thank you for your contributions. |
1e8777e
to
fa9e86a
Compare
Maintain the dracut version directly in `dracut.sh` and call `dracut.sh --version` to get the version number. The version can be changed with a simple sed command to a new version (for releases or for distributors that want to include the packaging version): ``` sed -i "s/^DRACUT_VERSION=.*$/DRACUT_VERSION=\"${NEW_VERSION}\"/" dracut.sh ``` Fixes dracutdevs#2169 Signed-off-by: Benjamin Drung <[email protected]>
fa9e86a
to
3369b60
Compare
Changed |
This issue is being marked as stale because it has not had any recent activity. It will be closed if no further activity occurs. If this is still an issue in the latest release of Dracut and you would like to keep it open please comment on this issue within the next 7 days. Thank you for your contributions. |
Changes
The git release tag does not contain the
dracut-version.sh
file and thereforegit archive
will lack this file as well. The Makefile attempts to populate version information from git tags (which is impossible in an unpacked release tarball) and, failing that, reverts to whatever would be encoded in that file if it were sourced.Maintain the dracut version directly in
dracut.sh
and calldracut.sh --version
to get the version number. The version can be changed with a simple sed command to a new version (for releases or for distributors that want to include the packaging version):Checklist
Fixes #2169