Re: [Rpm-maint] [rpm-software-management/rpm] Triple operator for conditional shortcut (#115)
I do not see any problem in the syntax that @pmatilai proposed in his previous comment: ```%{()?:}``` There are two similar options that are closer to the currently proposed triple condition operator syntax (#746): ```%{{}?:}``` ```%{{}::}``` Using these syntax the example from the previous @mlschroe comment looks: ```%{(0%?_include_minidebuginfo)?"mini:true":"mini:false"}``` ```%{{0%?_include_minidebuginfo}?"mini:true":"mini:false"}``` ```%{{0%?_include_minidebuginfo}:"mini:true":"mini:false"}``` Syntax: ```%{expr: 0%?_include_minidebuginfo ? "mini:true" : "mini:false" }``` can cause a small problem in deciding which ? divides the parts of the macro. But it can be solved - the first ? can be in {}: ```%{expr:0%{?_include_minidebuginfo}? "mini:true" : "mini:false"}``` -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/rpm-software-management/rpm/issues/115#issuecomment-527806699___ Rpm-maint mailing list Rpm-maint@lists.rpm.org http://lists.rpm.org/mailman/listinfo/rpm-maint
Re: [Rpm-maint] [rpm-software-management/rpm] Warn if a text is after %else or %endif (#625)
Indeed, this has come to bite us in the ass with endless streams of `extra tokens at the end of %endif directive in line 1068: %endif # with python3`. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/rpm-software-management/rpm/pull/625#issuecomment-527815221___ Rpm-maint mailing list Rpm-maint@lists.rpm.org http://lists.rpm.org/mailman/listinfo/rpm-maint
[Rpm-maint] [rpm-software-management/rpm] Cannot leave comments after %endif (#829)
https://github.com/rpm-software-management/rpm/pull/625 broke a rather reasonable use case, i.e. ``` %if %{with foo} ... %else # with foo ``` Not even our friendly neighborhood https://github.com/rpm-software-management/rpm/commit/44180fc7400ea8e67a13c5581459ad13f1d14103 can be used. What would be the proposed replacement for that, one that doesn’t disconnect the macro with the comment? -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/rpm-software-management/rpm/issues/829___ Rpm-maint mailing list Rpm-maint@lists.rpm.org http://lists.rpm.org/mailman/listinfo/rpm-maint
Re: [Rpm-maint] [rpm-software-management/rpm] Cannot leave comments after %endif (#829)
>From Fedora documentation [1]: "_To include comments in the spec file, use a # >character at the start of the line._" So the text "# with foo" in line ```%else # with foo``` is not a valid comment. If you need to use a comment near %else, you can write e.g.: ``` %if %{with foo} ... %else # with foo ``` [1] https://docs.fedoraproject.org/en-US/Fedora_Draft_Documentation/0.1/html/Packagers_Guide/chap-Packagers_Guide-Spec_File_Reference-Comments.html -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/rpm-software-management/rpm/issues/829#issuecomment-527839796___ Rpm-maint mailing list Rpm-maint@lists.rpm.org http://lists.rpm.org/mailman/listinfo/rpm-maint
Re: [Rpm-maint] [rpm-software-management/rpm] Cannot leave comments after %endif (#829)
But that’s just Fedora documentation, not RPM documentation, so it’s really you who sets the restrictions, because you own the parser. And notice how I mentioned not disconnecting the comment, because, if you do that, you introduce additional overhead when moving/removing. One has to be more careful to not leave a stray `# with foo` comment without an `%endif` macro to accompany it. Regardless, we still have the `%dnl` macro, but now we’re getting into the territory of special-casing things. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/rpm-software-management/rpm/issues/829#issuecomment-527852365___ Rpm-maint mailing list Rpm-maint@lists.rpm.org http://lists.rpm.org/mailman/listinfo/rpm-maint
Re: [Rpm-maint] [rpm-software-management/rpm] Cannot leave comments after %endif (#829)
Okay, my bad here. I was getting build errors, but seems that it’s because a test was failing prior. The output confused me. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/rpm-software-management/rpm/issues/829#issuecomment-527892863___ Rpm-maint mailing list Rpm-maint@lists.rpm.org http://lists.rpm.org/mailman/listinfo/rpm-maint