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

[conf] Add limited shell-style variable expansion #1622

Conversation

evan-goode
Copy link
Member

Ported from the DNF 5 implementation here: rpm-software-management/dnf5#800.

Adds support for ${variable:-word} and ${variable:+word} POSIX-shell-like expansions of vars.

${variable:-word} means if variable is unset or empty, the expansion of word is substituted. Otherwise, the value of variable is substituted.

${variable:+word} means if variable is unset or empty, nothing is substituted. Otherwise, the expansion of word is substituted.

Zypper supports these expansions, see here:
https://doc.opensuse.org/projects/libzypp/HEAD/structzypp_1_1repo_1_1RepoVarExpand.html

For: https://bugzilla.redhat.com/show_bug.cgi?id=1789346

Ported from the DNF 5 implementation here:
rpm-software-management/dnf5#800.

Adds support for ${variable:-word} and ${variable:+word}
POSIX-shell-like expansions of vars.

${variable:-word} means if `variable` is unset or empty, the expansion
of `word` is substituted. Otherwise, the value of `variable` is
substituted.

${variable:+word} means if `variable` is unset or empty, nothing is
substituted. Otherwise, the expansion of `word` is substituted.

Zypper supports these expansions, see here:
https://doc.opensuse.org/projects/libzypp/HEAD/structzypp_1_1repo_1_1RepoVarExpand.html

For: https://bugzilla.redhat.com/show_bug.cgi?id=1789346
@Conan-Kudo Conan-Kudo merged commit fde443f into rpm-software-management:dnf-4-master Oct 11, 2023
3 checks passed
Conan-Kudo pushed a commit to rpm-software-management/dnf that referenced this pull request Oct 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

2 participants