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 this 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?
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 this 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
Additional context
Today was my first day of dabbling with lua. Did I miss something obvious?