Skip to content

lua: rpm.glob() returns the supplied pattern if nothing matches #3794

Description

@pebolle

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugluaLua bindings/interface

Type

Projects

  • Status
    Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions