Re: [Rpm-maint] [rpm-software-management/rpm] Make parametric macro arguments available as native Lua table (#1063)

2020-03-02 Thread Panu Matilainen
Okay, this is not going to go anywhere without further infrastructure 
improvements in the rpmlua department. Opened an RFE ticket to be handled later 
and closing this one, thanks for the feedback everybody.

-- 
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/1063#issuecomment-593359130___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Make parametric macro arguments available as native Lua table (#1063)

2020-03-02 Thread Panu Matilainen
Closed #1063.

-- 
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/1063#event-3087565056___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Make parametric macro arguments available as native Lua table (#1063)

2020-02-25 Thread Panu Matilainen
(I'm really having a strange week with accidentally closing stuff when 
intending to comment or cancel... :roll_eyes: )

-- 
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/1063#issuecomment-590933608___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Make parametric macro arguments available as native Lua table (#1063)

2020-02-25 Thread Panu Matilainen
Reopened #1063.

-- 
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/1063#event-3069978068___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Make parametric macro arguments available as native Lua table (#1063)

2020-02-25 Thread Panu Matilainen
Closed #1063.

-- 
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/1063#event-3069975156___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Make parametric macro arguments available as native Lua table (#1063)

2020-02-25 Thread Panu Matilainen
Ookkay, looks like the global "arg" convention used in rpm is a leftover from 
olden days of Lua to work around lack of proper support for variadic arguments. 
More than one way to do this, feedback on what people actually want would be 
welcome. Possibilities include (but not limited to):
1) pass all macro arguments as variadic native Lua arguments without any option 
etc processing (rpm's argument/option view can be retrieved via rpm.expand() as 
presently)
2) pass processed macro arguments and options natively to Lua through two 
tables (opt and arg)
3) something in between

1 has the benefit of handing all 

-- 
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/1063#issuecomment-590930630___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Make parametric macro arguments available as native Lua table (#1063)

2020-02-25 Thread Panu Matilainen
Yeah that'd would need to be sorted out before an alleged merge.
However this is back to the drawing board until we find a way to make the arg 
table local within callers.

-- 
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/1063#issuecomment-590818935___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Make parametric macro arguments available as native Lua table (#1063)

2020-02-25 Thread Michael Schroeder
I must admit I liked the old implementation better as it didn't do the lua 
setup if it is not needed by some lua macro. I.e. it had a more lazy approach.

-- 
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/1063#issuecomment-590800408___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Make parametric macro arguments available as native Lua table (#1063)

2020-02-24 Thread Panu Matilainen
Adding options as another table, accessed via option name as the key isn't hard.

BUT.

This uses global tables for local arguments, which means that such macros could 
not nest, which seems like a bit of a showstopper...

-- 
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/1063#issuecomment-590369640___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Make parametric macro arguments available as native Lua table (#1063)

2020-02-24 Thread Panu Matilainen
Pushed a saner implementation of the thing, but options not done yet.

-- 
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/1063#issuecomment-590356294___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Make parametric macro arguments available as native Lua table (#1063)

2020-02-24 Thread Panu Matilainen
Yup, like already noted in the above, "if we do this then we'd really want to 
export options natively to Lua too".

-- 
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/1063#issuecomment-590235510___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Make parametric macro arguments available as native Lua table (#1063)

2020-02-20 Thread nim-nim
That would definitely be useful, thanks for looking at it! Can you extend the 
concept to macro arguments please? My macro files are full of:

```lua
local processall = (rpm.expand("%{-a}") ~= "") and (rpm.expand("%{-z}") == "")
localverbose = (rpm.expand("%{-v}") ~= "")


-- 
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/1063#issuecomment-589226237___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Make parametric macro arguments available as native Lua table (#1063)

2020-02-12 Thread Panu Matilainen
Okay, at least someone thinks this would be useful, so I guess it makes it 
worth pursuing :slightly_smiling_face: 

The implementation here is a icky and slow as it has to go backwards and out of 
its way to reconstruct what grabArgs() had readily available, probably 
grabArgs() just needs to become Lua-aware instead to make it more sensible.

-- 
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/1063#issuecomment-585181974___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Make parametric macro arguments available as native Lua table (#1063)

2020-02-11 Thread Jason Tibbitts
Oh, this would be so great.

-- 
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/1063#issuecomment-585008636___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Make parametric macro arguments available as native Lua table (#1063)

2020-02-11 Thread Panu Matilainen
RFC only for now: if we do this then we'd really want to export options 
natively to Lua too, and probably some other stuff too.

-- 
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/1063#issuecomment-584564977___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint