Re: [Rpm-maint] [rpm-software-management/rpm] Allow parametric macros to opt out of option processing (#547) (#1392)

2020-10-13 Thread Panu Matilainen
Yeah, thanks for spotting. Will fix.

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


Re: [Rpm-maint] [rpm-software-management/rpm] Implement a table-like shortcut to rpm macros in Lua (#1398)

2020-10-13 Thread Panu Matilainen
Yup. The reason it's not there now is that from wherever I had this idea it 
might prevent macro expansion in said arguments, and somehow never got around 
to check what it actually did :roll_eyes:  (I'm getting old, it's just three 
years since I added that thing...)

Now actually checking, yeah always quoting the args is quite clearly the right 
thing to do for this.

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


Re: [Rpm-maint] [rpm-software-management/rpm] pythondistdeps: Switch to importlib.metadata (#1317)

2020-10-13 Thread lgtm-com[bot]
This pull request **fixes 1 alert** when merging 
62f43dbb7bffc9f978d1c3427a94b8cf7e2bfd52 into 
b766e63de30d2e2ee103d132e35a13e82a62cd27 - [view on 
LGTM.com](https://lgtm.com/projects/g/rpm-software-management/rpm/rev/pr-12f4bd115540f9a4fa1bf4c75bd4314b1d88a7bd)

**fixed alerts:**

* 1 for Module is imported more than once

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


Re: [Rpm-maint] [rpm-software-management/rpm] Allow parametric macros to opt out of option processing (#547) (#1392)

2020-10-13 Thread Michael Schroeder
I think you mean optopt instead of opterr, because opterr is for configuring 
getopt()'s error handling.

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


Re: [Rpm-maint] [rpm-software-management/rpm] Implement a table-like shortcut to rpm macros in Lua (#1398)

2020-10-13 Thread Michael Schroeder
You can easily implement quoting by always surrounding the arguments with 0x1f 
characters, see splitQuoted() and the %quote macro.

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


Re: [Rpm-maint] [rpm-software-management/rpm] Translations update from Weblate (#1356)

2020-10-13 Thread Florian Festi
Merged #1356 into master.

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


Re: [Rpm-maint] [rpm-software-management/rpm] Tag documentation updates (#1387)

2020-10-13 Thread Florian Festi
Merged #1387 into master.

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


Re: [Rpm-maint] [rpm-software-management/rpm] Implement a table-like shortcut to rpm macros in Lua (#1398)

2020-10-13 Thread Panu Matilainen
Other random remarks of the day:
- We could of course put it into rpm namespace, and macro-heavy users can 
declare their own shortcut, eg `m = rpm.macro; m._libdir = "foo"`, but then if 
every Lua macro starts with that, we've failed somewhere
- This doesn't enable *anything* new, it's all just for convenience. And as 
such, all this could be also implemented in pure Lua instead. Doing that might 
open some other possibilities, OTOH keeping things in one place and one 
language has other benefits.
- I realized this is missing the mapping for Lua native deletion, ie `m[key] = 
nil` to undefine. Will add in a later version.

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


Re: [Rpm-maint] [rpm-software-management/rpm] Implement a table-like shortcut to rpm macros in Lua (#1398)

2020-10-13 Thread Panu Matilainen
Could of course call the table `macro`to make it blindingly obvious what that 
is, although I do think the context makes it quite clear anyhow. It's not like 
rpm macros ever were nice or readable to begin with 
:stuck_out_tongue_winking_eye: 

Macros are by far the most accessed thing from rpm Lua so I think sheer 
convenience should be high on priorities.

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


Re: [Rpm-maint] [rpm-software-management/rpm] Implement a table-like shortcut to rpm macros in Lua (#1398)

2020-10-13 Thread Vít Ondruch
> > There's ample potential for bikeshedding here (eg what to call the global 
> > table)
> 
> Indeed :) `m` is nice and short, but possibly a bit too much? What about 
> including it in the `rpm` namespace as `rpm.m`?

I agree with @hroncok. I think the code should be readable on the first place. 
`m` does not add to readability. Not mentioning if somebody wants to find 
reference using search 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/pull/1398#issuecomment-707664516___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Implement a table-like shortcut to rpm macros in Lua (#1398)

2020-10-13 Thread Panu Matilainen
It stops being nice and short if we put it into the rpm namespace :-/ 

Unlike a generic Lua library extension, rpm owns the environment in which these 
things run so I don't see a reason we couldn't maximise the convenience. Too 
bad `%` is not a legitimate character in Lua names... OTOH, `_` is and could be 
used, but underscores tend to hint at something you shouldn't touch, which is 
not the case here.

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


Re: [Rpm-maint] [rpm-software-management/rpm] Implement a table-like shortcut to rpm macros in Lua (#1398)

2020-10-13 Thread Miro Hrončok
> There's ample potential for bikeshedding here (eg what to call the global 
> table)

Indeed :) `m` is nice and short, but possibly a bit too much? What about 
including it in the `rpm` namespace as `rpm.m`?

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


Re: [Rpm-maint] [rpm-software-management/rpm] Implement a table-like shortcut to rpm macros in Lua (#1398)

2020-10-13 Thread Panu Matilainen
https://copr.fedorainfracloud.org/coprs/pmatilai/rpm-snapshot/ has pre-built 
binaries for Fedora, updated manually once/twice a week. Usually those are 
strictly from rpm git master but it's not like I can't make exceptions... 
https://copr.fedorainfracloud.org/coprs/pmatilai/rpm-snapshot/build/1705701/ 
has this PR included (this also includes the native option/argument stuff from 
last week of course)

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


Re: [Rpm-maint] [rpm-software-management/rpm] Implement a table-like shortcut to rpm macros in Lua (#1398)

2020-10-13 Thread nim-nim
If that works that will be terrific! However as usual the devil is in the 
detail, is it available as a pre-built rpm somewhere or do one need to build 
his own binary?

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


Re: [Rpm-maint] [rpm-software-management/rpm] Implement a table-like shortcut to rpm macros in Lua (#1398)

2020-10-13 Thread Panu Matilainen
See the docs + test cases in the commit for details, if something isn't covered 
then do ask.

There's ample potential for bikeshedding here (eg what to call the global 
table), should it do some sort of auto-quoting for empty strings as arguments 
etc.

Tagging @hroncok @nim-nim @mlschroe @jasontibbitts for past interest/activities 
in this area, feel free to invite more. 

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


[Rpm-maint] [rpm-software-management/rpm] Implement a table-like shortcut to rpm macros in Lua (#1398)

2020-10-13 Thread Panu Matilainen
Add rpm macro context as a global table-like entity named m for
typing convenience into the Lua environment.

Support basic access with table indexing syntaxes (m[k] and m.k),
undefined macros return nil here. As a specialty, parametric macros
are returned as native callable variadic Lua functions, arguments
are converted to strings.
You can view, comment on, or merge this pull request online at:

  https://github.com/rpm-software-management/rpm/pull/1398

-- Commit Summary --

  * Implement a table-like shortcut to rpm macros in Lua

-- File Changes --

M doc/manual/lua.md (22)
M rpmio/rpmlua.c (72)
M tests/rpmmacro.at (18)

-- Patch Links --

https://github.com/rpm-software-management/rpm/pull/1398.patch
https://github.com/rpm-software-management/rpm/pull/1398.diff

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


Re: [Rpm-maint] [rpm-software-management/rpm] pythondistdeps: Switch to importlib.metadata (#1317)

2020-10-13 Thread torsava
@torsava commented on this pull request.



> @@ -142,9 +210,23 @@ def convert(name, operator, version_id):
 
 
 def normalize_name(name):

@s-t-e-v-e-n-k Thinking more on this, since we have to keep this function, and 
since the class/static methods you currently use are used inside 2 different 
classes anyway, how about implementing the functionality as normal global 
functions? That way they could be used outside this script easily, and we would 
not need this wrapper.

-- 
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/1317#discussion_r503744048___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] pythondistdeps: Switch to importlib.metadata (#1317)

2020-10-13 Thread lgtm-com[bot]
This pull request **fixes 1 alert** when merging 
62088ae736b4eac30758209d9537fa1089f6e02c into 
6163c6cfd99f1dbafd89962598729e7a81932311 - [view on 
LGTM.com](https://lgtm.com/projects/g/rpm-software-management/rpm/rev/pr-44669caf5b3c6cb2c541d0f66685a0972b6ae983)

**fixed alerts:**

* 1 for Module is imported more than once

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


Re: [Rpm-maint] [rpm-software-management/rpm] pythondistdeps: Switch to importlib.metadata (#1317)

2020-10-13 Thread Miro Hrončok
@hroncok commented on this pull request.



> @@ -142,9 +210,23 @@ def convert(name, operator, version_id):
 
 
 def normalize_name(name):

Happy to adapt that script when we integrate this. 

-- 
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/1317#discussion_r503740667___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] pythondistdeps: Switch to importlib.metadata (#1317)

2020-10-13 Thread torsava
@torsava commented on this pull request.



> @@ -142,9 +210,23 @@ def convert(name, operator, version_id):
 
 
 def normalize_name(name):

Ah, right. In that case, yeah, a comment would be 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/1317#discussion_r503734008___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint