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
%{dirname:foo} is returning foo #2928
Comments
My suspicion is that %dirname was used there not to test for it returning the filename unchanged but it was chosen as leaving the parameter unchanged made it a good test case for undefined arguments. |
ffesti
added a commit
to ffesti/rpm
that referenced
this issue
Mar 5, 2024
Strip trailing '/' unless "/" itself Keep "." untouched Keep root dir for files in the root dir Return "." for files without directory and empty strings See man 3 dirname Resolves: rpm-software-management#2928
Indeed, there's no deeper meaning to the test, it's all about argument handling and nothing to do with dirname itself (the context of c5909bd makes it quite clear) |
ffesti
added a commit
to ffesti/rpm
that referenced
this issue
Mar 5, 2024
ffesti
added a commit
to ffesti/rpm
that referenced
this issue
Mar 5, 2024
This changes the behaviour of %dirname to something sane. No longer return the argument unchanged if there is no / found. Also handle several cornercases properly. Resolves: rpm-software-management#2928
ffesti
added a commit
to ffesti/rpm
that referenced
this issue
Mar 7, 2024
This changes the behaviour of %dirname to something sane. No longer return the argument unchanged if there is no / found. Also handle several cornercases properly. Resolves: rpm-software-management#2928
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We're testing for it in the test cases so it might be intentional, but is there any good reason why
%{dirname:foo}
returnsfoo
instead of `` or.
? At least the documentation says it is a "dirname(1) macro analogue"...The text was updated successfully, but these errors were encountered: