kisslinux / kiss

KISS Linux - Package Manager
https://kisslinux.github.io
MIT License
464 stars 62 forks source link

kiss-revdepends: print only exact matches #277

Closed aabacchus closed 2 years ago

aabacchus commented 2 years ago

The ERE matches the package name, followed by either a space character or an end-of-line. This prevents matching packages whose names contain the target name. A word boundary '\>' is not used, because this matches a hyphen '-' and not end-of-lines. The end-of-line anchor '$' cannot be used in a bracket expression.

dylanaraps commented 2 years ago

Thanks

aabacchus commented 2 years ago

@dylanaraps Is alternation part of POSIX BREs? As far as I can tell, the sequence \| isn't defined for POSIX BREs, but \ is specified for EREs. Despite this, all the implementations I've tested - GNU, Busybox, sbase - accept it, except for 9base, which uses EREs of the type "before egrep got complicated". I think the widest compatibility is to use extended mode?

aabacchus commented 2 years ago

From the most recent draft of POSIX 1003.1 202x, Rationale for Base Definitions:

Some implementations have extended the BRE syntax to add alternation. For example, the subexpression "\(foo$\|bar\)" would match either "foo" at the end of the string or "bar" anywhere. The extension is triggered by the use of the undefined "\|" sequence.

dylanaraps commented 2 years ago

Fixed, thanks.