[Rpm-maint] [rpm-software-management/rpm] lua: rpm.glob() returns the supplied pattern if nothing matches (Issue #3794)
Paul Bolle
notifications at github.com
Sat Jun 7 19:52:50 UTC 2025
pebolle created an issue (rpm-software-management/rpm#3794)
**Describe the bug**
lua: rpm.glob() returns the supplied pattern if nothing matches. As a consequence it can be hard to distinguish failure and success. Moreover, the documentation states: "If flags contains "c", return the original pattern in case of no matches." But thid also happens when no flags are specified.
**To Reproduce**
$ ls bogus
ls: cannot access 'bogus': No such file or directory
$ rpmlua -e 'print( rpm.glob("bogus")[1] )'
bogus
**Expected behavior**
$ rpmlua -e 'print( rpm.glob("bogus")[1] )'
nil
(Or false or an empty string, or whatever is luaish.)
**Environment**
- OS / Distribution: Fedora 42
- Version: rpm-4.20.1
**Additional context**
Today was my first day of dabbling with lua. Did I miss something obvious?
--
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/3794
You are receiving this because you are subscribed to this thread.
Message ID: <rpm-software-management/rpm/issues/3794 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20250607/b25c197f/attachment.htm>
More information about the Rpm-maint
mailing list