Re: [Rpm-maint] [rpm-software-management/rpm] "load" does not work with RPM 4.16.90 (#1669)
@pmatilai I must say that the error as well as your answer puzzles me. Just FTR, this is the origin of the question mark: https://src.fedoraproject.org/rpms/ruby/c/8e2921fd5a3125b7ce2487bb449b2e6db40cc3c0 IOW the question mark was always guarding the existence of the `load` macro/builtin. If I am not mistaken, at that time, the question mark allowed to build at least SRPM via older RPM. What it does ATM is hard to decode, because honestly the error message is quite unexpected and unhelpful. -- 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/1669#issuecomment-833824814___ Rpm-maint mailing list Rpm-maint@lists.rpm.org http://lists.rpm.org/mailman/listinfo/rpm-maint
Re: [Rpm-maint] [rpm-software-management/rpm] "load" does not work with RPM 4.16.90 (#1669)
> Sorry could you tell me what's wrong in the following code? I was able to implement the own exists macro like this. I expect `rpmlint` skips the load. But `rpmlint` still checks the load macro printing parsing error. Now what we need to fix is rpmlint. ``` %global exists_file %{lua: posix.access(rpm.expand("%{1}"))} %if %exists_file "%{SOURCE4}" %{echo:loading %{SOURCE4}} %{load:%{SOURCE4}} %endif ``` -- 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/1669#issuecomment-833612235___ Rpm-maint mailing list Rpm-maint@lists.rpm.org http://lists.rpm.org/mailman/listinfo/rpm-maint
Re: [Rpm-maint] [rpm-software-management/rpm] "load" does not work with RPM 4.16.90 (#1669)
@pmatilai I am seeing `doc/manual/lua.md` and https://rpm.org/user_doc/lua.html . Sorry could you tell me what's wrong in the following code? ``` %load_if_exists(path) %{lua: if posix.access(arg.path, "r") then print("Loading " .. arg.path .. "..") load(arg.path) end } %load_if_exists %{SOURCE4} ``` ``` $ fedpkg --release rawhide srpm error: lua script failed: [string ""]:2: attempt to index a nil value (global 'arg') error: query of specfile /home/jaruga/git/pkg/fed/ruby/ruby.spec failed, can't parse ``` -- 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/1669#issuecomment-833497556___ Rpm-maint mailing list Rpm-maint@lists.rpm.org http://lists.rpm.org/mailman/listinfo/rpm-maint
Re: [Rpm-maint] [rpm-software-management/rpm] "load" does not work with RPM 4.16.90 (#1669)
@pmatilai ok thanks I will try it! -- 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/1669#issuecomment-833461866___ Rpm-maint mailing list Rpm-maint@lists.rpm.org http://lists.rpm.org/mailman/listinfo/rpm-maint
Re: [Rpm-maint] [rpm-software-management/rpm] "load" does not work with RPM 4.16.90 (#1669)
Well you can program whatever logic you want if you use %{lua:..} This behavior isn't changing back. -- 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/1669#issuecomment-833453580___ Rpm-maint mailing list Rpm-maint@lists.rpm.org http://lists.rpm.org/mailman/listinfo/rpm-maint
Re: [Rpm-maint] [rpm-software-management/rpm] "load" does not work with RPM 4.16.90 (#1669)
Closed #1669. -- 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/1669#event-4694612288___ Rpm-maint mailing list Rpm-maint@lists.rpm.org http://lists.rpm.org/mailman/listinfo/rpm-maint
Re: [Rpm-maint] [rpm-software-management/rpm] "load" does not work with RPM 4.16.90 (#1669)
Reopened #1669. -- 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/1669#event-4689242420___ Rpm-maint mailing list Rpm-maint@lists.rpm.org http://lists.rpm.org/mailman/listinfo/rpm-maint
Re: [Rpm-maint] [rpm-software-management/rpm] "load" does not work with RPM 4.16.90 (#1669)
@pmatilai when using `%{load:...}`, the rpmlint failed to part the spec file. https://github.com/rpm-software-management/rpmlint/issues/632 . The rpmlint can not detect the loaded file's existence. I see the `%{exists...}` is still new in RPM 4.17. http://rpm.org/user_doc/macros.html Is there a way to avoid the rpmlnt error? -- 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/1669#issuecomment-832699304___ Rpm-maint mailing list Rpm-maint@lists.rpm.org http://lists.rpm.org/mailman/listinfo/rpm-maint
Re: [Rpm-maint] [rpm-software-management/rpm] "load" does not work with RPM 4.16.90 (#1669)
Closed #1669. -- 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/1669#event-4688478118___ Rpm-maint mailing list Rpm-maint@lists.rpm.org http://lists.rpm.org/mailman/listinfo/rpm-maint
Re: [Rpm-maint] [rpm-software-management/rpm] "load" does not work with RPM 4.16.90 (#1669)
Thanks! I confirmed it works with `%{load: ...}`. I would close this ticket. -- 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/1669#issuecomment-832622783___ Rpm-maint mailing list Rpm-maint@lists.rpm.org http://lists.rpm.org/mailman/listinfo/rpm-maint
Re: [Rpm-maint] [rpm-software-management/rpm] "load" does not work with RPM 4.16.90 (#1669)
Thanks for the info! Let me check it. -- 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/1669#issuecomment-832605314___ Rpm-maint mailing list Rpm-maint@lists.rpm.org http://lists.rpm.org/mailman/listinfo/rpm-maint
Re: [Rpm-maint] [rpm-software-management/rpm] "load" does not work with RPM 4.16.90 (#1669)
%{load:...} works as always but any undocumented special behaviors of conditionals on built-in macros are gone in 4.17, %{?foo} always tests whether said macro is defined or not, both built-ins and user-defined macros. Conditional load can be constructed with more control using expressions and the like, eg `%[%{exists:/some/file}?"%{load:/some/file}":""]` -- 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/1669#issuecomment-831838733___ Rpm-maint mailing list Rpm-maint@lists.rpm.org http://lists.rpm.org/mailman/listinfo/rpm-maint
Re: [Rpm-maint] [rpm-software-management/rpm] "load" does not work with RPM 4.16.90 (#1669)
I can try to create a minimal reproducer if you want. -- 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/1669#issuecomment-830852900___ Rpm-maint mailing list Rpm-maint@lists.rpm.org http://lists.rpm.org/mailman/listinfo/rpm-maint