mirror of
https://github.com/chromebrew/chromebrew.git
synced 2026-01-09 15:37:56 -05:00
Fix regex in crew whatprovides. (#10387)
* Fix regex in crew whatprovides. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Add regex test. Signed-off-by: Satadru Pramanik <satadru@gmail.com> --------- Signed-off-by: Satadru Pramanik <satadru@gmail.com>
This commit is contained in:
committed by
GitHub
parent
68f183bdfb
commit
34e6887026
@@ -4,7 +4,7 @@ require_relative '../lib/package_utils'
|
||||
|
||||
class Command
|
||||
def self.whatprovides(regex)
|
||||
matched_list = `grep -R "#{regex}" #{CREW_LIB_PATH}/manifest/#{ARCH}`.lines(chomp: true).flat_map do |result|
|
||||
matched_list = `grep -ER "#{regex}" #{CREW_LIB_PATH}/manifest/#{ARCH}`.lines(chomp: true).flat_map do |result|
|
||||
filelist, matched_file = result.split(':', 2)
|
||||
pkg_name = File.basename(filelist, '.filelist')
|
||||
pkg_name_status = File.file?(File.join(CREW_PACKAGES_PATH, "#{pkg_name}.rb")) ? pkg_name : nil
|
||||
|
||||
Reference in New Issue
Block a user