Commit 4ada4e25 authored by Ed Reel's avatar Ed Reel

Change regex pattern as suggested by @lyxell

parent 0d442031
......@@ -67,40 +67,12 @@ end
def whatprovides (pkgName)
fileArray = []
op = '*'
search = pkgName.dup
if search[/\*/]
search = search.gsub! '*', ''
end
abort if not search
if search[0] == '^'
op = '^'
search = search[1..search.length - 1]
end
if search[-1] == '$'
if op == '^'
op = '^$'
else
op = '$'
end
search = search[0..search.length - 2]
end
Find.find (CREW_CONFIG_PATH + 'meta/') do |packageList|
if File.file? packageList
if packageList[/\.filelist$/]
packageName = File.basename packageList, '.filelist'
File.readlines(packageList).each do |line|
found = nil
case op
when '*'
found = line[/#{Regexp.quote(search)}/]
when '^'
found = line[/^#{Regexp.quote(search)}/]
when '$'
found = line[/#{Regexp.quote(search)}$/]
when '^$'
found = line[/^#{Regexp.quote(search)}$/]
end
found = line[/#{Regexp.new(pkgName)}/]
if found
fileLine = packageName + ': ' + line
if not fileArray.include? fileLine
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment