mirror of
https://github.com/mudler/luet.git
synced 2025-09-03 08:14:46 +00:00
Allow to search by file
Also make possible to retrieve the artifact when searching for matches between repositories list. This made possible to show the package list when calling `luet search`.
This commit is contained in:
@@ -436,9 +436,9 @@ func (db *BoltDatabase) FindPackageLabel(labelKey string) (Packages, error) {
|
||||
func (db *BoltDatabase) FindPackageLabelMatch(pattern string) (Packages, error) {
|
||||
var ans []Package
|
||||
|
||||
re := regexp.MustCompile(pattern)
|
||||
if re == nil {
|
||||
return nil, errors.New("Invalid regex " + pattern + "!")
|
||||
re, err := regexp.Compile(pattern)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "Invalid regex "+pattern+"!")
|
||||
}
|
||||
|
||||
for _, pack := range db.World() {
|
||||
@@ -450,12 +450,15 @@ func (db *BoltDatabase) FindPackageLabelMatch(pattern string) (Packages, error)
|
||||
return Packages(ans), nil
|
||||
}
|
||||
|
||||
func (db *BoltDatabase) FindPackageByFile(pattern string) (Packages, error) {
|
||||
return findPackageByFile(db, pattern)
|
||||
}
|
||||
func (db *BoltDatabase) FindPackageMatch(pattern string) (Packages, error) {
|
||||
var ans []Package
|
||||
|
||||
re := regexp.MustCompile(pattern)
|
||||
if re == nil {
|
||||
return nil, errors.New("Invalid regex " + pattern + "!")
|
||||
re, err := regexp.Compile(pattern)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "Invalid regex "+pattern+"!")
|
||||
}
|
||||
|
||||
for _, pack := range db.World() {
|
||||
|
Reference in New Issue
Block a user