Re: [Rpm-maint] [rpm-software-management/rpm] Macro arguments do not support quoting (#222)

2018-08-03 Thread Jeff Johnson
(after looking at recent changes to macro expansion) Parameterized macros use posix getopt(3) for parsing macro options/arguments, and getopt is perfectly capable of honoring quoting similar to bash. Sadly the implementation in rpm does not use getopt argv but attempts its own parser in order t

Re: [Rpm-maint] [rpm-software-management/rpm] Macro arguments do not support quoting (#222)

2018-08-02 Thread Jeff Johnson
There are 2 issues that would need to be solved if you wish portability within versions of rpm macro expansion: * adding -I to the Python interpreter in use * handling a possible space in the file name There are means to solve both of those issues by not using parameterized macros (because it's

Re: [Rpm-maint] [rpm-software-management/rpm] Macro arguments do not support quoting (#222)

2018-08-02 Thread Jeff Johnson
RPM macros are context free: expanded within quotes, within comments, everywhere a % is found. Always been that way. -- 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/222#

Re: [Rpm-maint] [rpm-software-management/rpm] Macro arguments do not support quoting (#222)

2018-08-02 Thread Jan Pokorný
Looks like a perfect timing regarding discovery and fixing of silent issues in one of my specfiles: ``` %py_byte_compile '%{__python3} \-I' '%{buildroot}%{_datarootdir}/%{name}/ext-plugins' ``` Why nobody told me that quotes are taken literally and only spaces/tabs play the role in word/argument

Re: [Rpm-maint] [rpm-software-management/rpm] Macro arguments do not support quoting (#222)

2017-08-31 Thread Panu Matilainen
Closed #222. -- 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/222#event-1229211727___ Rpm-maint mailing list Rpm-maint@lists.rpm

Re: [Rpm-maint] [rpm-software-management/rpm] Macro arguments do not support quoting (#222)

2017-08-31 Thread Panu Matilainen
Since there are no nice quote characters left, implemented with the help of a special %{quote:...} macro. It might not be the prettiest solution in existence but at least it makes it *possible* to quote the arguments without stepping on any existing uses I'd hope. -- You are receiving this bec

Re: [Rpm-maint] [rpm-software-management/rpm] Macro arguments do not support quoting (#222)

2017-08-23 Thread proyvind
Lack of quoting support was actually what made me put the python interpreter support implemented @rpm5.org to use, which in turn made templating a shitload easier with a language which supports overloading of parameters, OOP etc. Lack of support for such in lua (combined with not exactly widespre

Re: [Rpm-maint] [rpm-software-management/rpm] Macro arguments do not support quoting (#222)

2017-08-14 Thread Jeff Johnson
Leave bad enough alone imho. Every macro templating language in the world has quoting problems: its the nature of the beast. And a Principle of Least Surprise "Do what bash does!" sets expectations that are wildly out of line with reality. FWIW, the only place that macros MUST be used (instead

Re: [Rpm-maint] [rpm-software-management/rpm] Macro arguments do not support quoting (#222)

2017-08-14 Thread Panu Matilainen
Examples of stuff that broke: https://bugzilla.redhat.com/show_bug.cgi?id=1481025 https://bugzilla.redhat.com/show_bug.cgi?id=1481133 -- 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/

Re: [Rpm-maint] [rpm-software-management/rpm] Macro arguments do not support quoting (#222)

2017-08-14 Thread Panu Matilainen
@mlschroe and others too of course: ideas welcome... -- 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/222#issuecomment-322135297

Re: [Rpm-maint] [rpm-software-management/rpm] Macro arguments do not support quoting (#222)

2017-08-14 Thread Panu Matilainen
Reopened #222. -- 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/222#event-1204413195___ Rpm-maint mailing list Rpm-maint@lists.r

Re: [Rpm-maint] [rpm-software-management/rpm] Macro arguments do not support quoting (#222)

2017-08-14 Thread Panu Matilainen
So... this is not going to fly, too many macros rely on quotes passing untouched (and why shouldn't they, that's the way its been all this time). We'll need some other kind of solution that's opt-in one way or the other. Reopening. -- You are receiving this because you are subscribed to this t

Re: [Rpm-maint] [rpm-software-management/rpm] Macro arguments do not support quoting (#222)

2017-08-09 Thread Panu Matilainen
Closed #222. -- 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/222#event-1198810344___ Rpm-maint mailing list Rpm-maint@lists.rpm

Re: [Rpm-maint] [rpm-software-management/rpm] Macro arguments do not support quoting (#222)

2017-08-09 Thread Panu Matilainen
Implemented in commit 47f0a899eff78230d2b9a00d23474845579d1582, thanks Pavlina. -- 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/222#issuecomment-321215086_

Re: [Rpm-maint] [rpm-software-management/rpm] Macro arguments do not support quoting (#222)

2017-08-04 Thread Igor Gnatenko
@pmatilai ohhh, sorry then -- 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/222#issuecomment-320239362___ Rpm-maint mailing list

Re: [Rpm-maint] [rpm-software-management/rpm] Macro arguments do not support quoting (#222)

2017-08-04 Thread Panu Matilainen
@ignatenkobrain, that's the unquoted case. What we're interested about here is: ``` rpm --define "%foo() 1:%1 2:%2" --eval "%foo '%nil' bar" ``` ...which should return "1: 2:bar". This is not resolved yet, the patches were reverted in commit fe7cf85bff534f97025ef1701deaa209a485004e as it wasn't r

Re: [Rpm-maint] [rpm-software-management/rpm] Macro arguments do not support quoting (#222)

2017-08-04 Thread Panu Matilainen
Reopened #222. -- 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/222#event-1193066577___ Rpm-maint mailing list Rpm-maint@lists.r

Re: [Rpm-maint] [rpm-software-management/rpm] Macro arguments do not support quoting (#222)

2017-07-30 Thread Igor Gnatenko
Closed #222. -- 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/222#event-1184895706___ Rpm-maint mailing list Rpm-maint@lists.rpm

Re: [Rpm-maint] [rpm-software-management/rpm] Macro arguments do not support quoting (#222)

2017-07-30 Thread Igor Gnatenko
``` [brain@ignatenko-w541 kojilogs]$ ~/Projects/upstream/rpm/rpm --define "%foo() 1:%1 2:%2" --eval "%foo %nil bar" 1:bar 2:%2 ``` -- 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/rp

[Rpm-maint] [rpm-software-management/rpm] Macro arguments do not support quoting (#222)

2017-05-23 Thread Panu Matilainen
Originally came up while discussing #217: Especially now that rpm is expanding macro arguments, it needs a way to quote the arguments to handle whitespace, empty arguments etc. This matches what shell does when undefined arguments are passed to functions: ``` rpm --define "%foo() 1:%1 2:%2" --eva