Re: [Rpm-maint] [rpm-software-management/rpm] rpm --eval "%{lua:rpm.interactive()}" does not immediately print the output (#1215)

2021-04-16 Thread Miro Hrončok
Thanks. -- 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/1215#issuecomment-821376174___ Rpm-maint mailing list Rpm-maint@lists.

Re: [Rpm-maint] [rpm-software-management/rpm] rpm --eval "%{lua:rpm.interactive()}" does not immediately print the output (#1215)

2021-04-16 Thread Panu Matilainen
Closed #1215 via 180afaf3b1a7c5a3b8f31815fde1e398594e22fb. -- 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/1215#event-4604476436___

Re: [Rpm-maint] [rpm-software-management/rpm] rpm --eval "%{lua:rpm.interactive()}" does not immediately print the output (#1215)

2020-06-18 Thread Miro Hrončok
Would you accept a pull request that that adds a `rpmlua` executable and makes it behave more or less like my Python script? Note that my C skills are rusty and my autotools skills are almost nonexistent, so I will probably need some guidance. -- You are receiving this because you are subscrib

Re: [Rpm-maint] [rpm-software-management/rpm] rpm --eval "%{lua:rpm.interactive()}" does not immediately print the output (#1215)

2020-06-13 Thread Miro Hrončok
This gets the job done: ```python librpm = cdll.LoadLibrary("librpm.so.9") # Load general configuration (such as macros defined in standard places) # Second argument is target platform, NULL is the default librpm.rpmReadConfigFiles(librpm.rpmcliRcfile, None) ``` -- You are receiving this becaus

Re: [Rpm-maint] [rpm-software-management/rpm] rpm --eval "%{lua:rpm.interactive()}" does not immediately print the output (#1215)

2020-06-04 Thread Miro Hrončok
My script doesn't seem to see system defined macros. Do I need to call something explicitly to load them? ``` $ rpmlua RPM Interactive Lua 5.3 Interpreter > print(rpm.expand("%python3")) %python3 > rpm.define("test b") > print(rpm.expand("%test")) b > $ rpm --eval "%{lua:rpm.interactive()}"

Re: [Rpm-maint] [rpm-software-management/rpm] rpm --eval "%{lua:rpm.interactive()}" does not immediately print the output (#1215)

2020-05-14 Thread Panu Matilainen
Just a word of caution: rpmluaRunScript() and rpmluaRunScriptFile() are not considered public API and are not available in the public headers on C side, although the symbols are accessible in the ABI. So they are subject to change without further notice, although the likelihood of that happening

Re: [Rpm-maint] [rpm-software-management/rpm] rpm --eval "%{lua:rpm.interactive()}" does not immediately print the output (#1215)

2020-05-14 Thread Panu Matilainen
Wonderfully weird stuff :smile: -- 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/1215#issuecomment-628588855___ Rpm-maint maili

Re: [Rpm-maint] [rpm-software-management/rpm] rpm --eval "%{lua:rpm.interactive()}" does not immediately print the output (#1215)

2020-05-14 Thread Miro Hrončok
Here is my draft blog post about how to get a nicer console https://hackmd.io/@hroncok/SyNjuxcqL -- 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/1215#issuecomment-6285861

Re: [Rpm-maint] [rpm-software-management/rpm] rpm --eval "%{lua:rpm.interactive()}" does not immediately print the output (#1215)

2020-05-14 Thread Panu Matilainen
Adding a native way to flush the output shouldn't be hard. This is code that for all practical purposes nobody has touched in 16 years so it's not surprising if its a bit rusty and squeaky... -- You are receiving this because you are subscribed to this thread. Reply to this email directly or vi

Re: [Rpm-maint] [rpm-software-management/rpm] rpm --eval "%{lua:rpm.interactive()}" does not immediately print the output (#1215)

2020-05-14 Thread Vít Ondruch
Or if there was a way to flush to the output the content collected by the macro engine -- 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/1215#issuecomment-628566016___

Re: [Rpm-maint] [rpm-software-management/rpm] rpm --eval "%{lua:rpm.interactive()}" does not immediately print the output (#1215)

2020-05-14 Thread Vít Ondruch
I think it could be enough if the documentation give more reasonable example such as: ~~~ rpm.expand("%{echo:some message}") ~~~ Which provides expected output: ~~~ $ rpm --eval "%{lua:rpm.interactive()}" RPM Interactive Lua 5.3 Interpreter > rpm.expand("%{echo:some message}") some message > r

Re: [Rpm-maint] [rpm-software-management/rpm] rpm --eval "%{lua:rpm.interactive()}" does not immediately print the output (#1215)

2020-05-14 Thread Miro Hrončok
I meant something a bit more sophisticated. I have so far: ```python #!/usr/bin/python3 import sys from ctypes import cdll, c_char_p librpmio = cdll.LoadLibrary("librpmio.so.9") adjust_path = b""" if os.getenv("LUA_PATH") then package.path = os.getenv("LUA_PATH") .. ";" .. package.path end

Re: [Rpm-maint] [rpm-software-management/rpm] rpm --eval "%{lua:rpm.interactive()}" does not immediately print the output (#1215)

2020-05-14 Thread Panu Matilainen
If by "something like the above" you mean something that allows actual interactive experience, sure :sweat_smile: -- 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/1215#is

Re: [Rpm-maint] [rpm-software-management/rpm] rpm --eval "%{lua:rpm.interactive()}" does not immediately print the output (#1215)

2020-05-14 Thread Miro Hrončok
I have it all figured out. Blog post coming. Would you consider adding something like the above to rpm itself? -- 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/1215#issue

Re: [Rpm-maint] [rpm-software-management/rpm] rpm --eval "%{lua:rpm.interactive()}" does not immediately print the output (#1215)

2020-05-14 Thread Panu Matilainen
Ouch :rofl: The interactive interpreter was added years before my time, but as far as I can recall, you're the first person *ever* to try actually using it. There may be some resident fauna there... :beetle: :bug: -- You are receiving this because you are subscribed to this thread. Reply to t

Re: [Rpm-maint] [rpm-software-management/rpm] rpm --eval "%{lua:rpm.interactive()}" does not immediately print the output (#1215)

2020-05-13 Thread Miro Hrončok
This gets the job done: ```python from ctypes import cdll, c_char_p librpmio = cdll.LoadLibrary("librpmio.so.9") librpmio.rpmluaRunScript(None, c_char_p(b"rpm.interactive()"), None) ``` -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it o

Re: [Rpm-maint] [rpm-software-management/rpm] rpm --eval "%{lua:rpm.interactive()}" does not immediately print the output (#1215)

2020-05-13 Thread Miro Hrončok
Can I do anything to have the interneter not in the macro expansion mode? Dne st 13. 5. 2020 11:03 uživatel Michael Schroeder < notificati...@github.com> napsal: > This happens because you're in a macro expansion, so all the output is > collected and returned to the macro engine. > > — > You are

Re: [Rpm-maint] [rpm-software-management/rpm] rpm --eval "%{lua:rpm.interactive()}" does not immediately print the output (#1215)

2020-05-13 Thread Michael Schroeder
This happens because you're in a macro expansion, so all the output is collected and returned to the macro engine. -- 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/1215#is

[Rpm-maint] [rpm-software-management/rpm] rpm --eval "%{lua:rpm.interactive()}" does not immediately print the output (#1215)

2020-05-12 Thread Miro Hrončok
I'd liek to use the interactive Lua console, however, it doesn't seem to be very... interactive. ``` $ rpm --eval "%{lua:rpm.interactive()}" RPM Interactive Lua 5.3 Interpreter > ``` So far so good... ``` > print"a" > ``` Nothing... ``` > print"a" > print"a" > print"a" > print"a" > ``` Not