-
Notifications
You must be signed in to change notification settings - Fork 86
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
SWIG bindings and unit tests for Vars::detect_release()
#1804
base: main
Are you sure you want to change the base?
SWIG bindings and unit tests for Vars::detect_release()
#1804
Conversation
The vars.hpp file is included in the conf module and the Vars class is wrapped in the conf module. VarsWeakPtr was packaged in the base module. Which will bring problems in the following changes. So the VarsWeakPtr wrapper has been moved to the conf module.
The original `Vars::detect_release` returns `std::unique_ptr<std::string>` This makes it complicated for wrapping into other languages. The modified version returns `char *` - a standard C string.
Tests in Python, Ruby, Perl. It only tests the situation where a release cannot be detected. To detect an installed release, a system database with the corresponding installed packages is required.
a77b80e
to
ec76b7a
Compare
fedrq has the following which uses the original version of this that @j-mracek added as a "raw prototype" after discussion in #281. def get_releasever() -> str:
"""
Return the system releasever
"""
# libdnf5 >= 5.0.10
# https://github.com/rpm-software-management/dnf5/pull/448
base = libdnf5.base.Base()
return libdnf5.conf.Vars.detect_release(base.get_weak_ptr(), "/").get() Returning a proper string instead of a wrapper type is definitely nicer but does represent a breaking change. Although, with |
Returning a proper string is nicer.
But as you write. It's breaking change. |
This partially reverts commit 467bdfe. See explanation in the code comments for why this was reverted. Ref: rpm-software-management/dnf5#281 Ref: rpm-software-management/dnf5#1804
Closes: #1803