Commit a305155e authored by Casey Strouse's avatar Casey Strouse Committed by Ed Reel

Make crew list installed run faster (#3749)

* Make crew list installed run faster

Generate the list of installed packages in a more efficient manner.

* Bump version
parent e8f8257f
...@@ -134,14 +134,9 @@ def list_available ...@@ -134,14 +134,9 @@ def list_available
end end
def list_installed def list_installed
Find.find (CREW_LIB_PATH + 'packages') do |filename| Dir["#{CREW_CONFIG_PATH}/meta/*.directorylist"].sort.map { |f|
Find.find(CREW_CONFIG_PATH + 'meta/') do |packageList| File.basename(f, ".directorylist")
packageName = File.basename filename, '.rb' }
if packageList == CREW_CONFIG_PATH + 'meta/' + packageName + '.filelist'
puts File.basename filename, '.rb' if File.extname(filename) == '.rb'
end
end
end
end end
def search (pkgName, silent = false) def search (pkgName, silent = false)
...@@ -935,7 +930,7 @@ def list_command (args) ...@@ -935,7 +930,7 @@ def list_command (args)
if args['available'] if args['available']
list_available list_available
elsif args['installed'] elsif args['installed']
list_installed puts list_installed
end end
end end
......
# Defines common constants used in different parts of crew # Defines common constants used in different parts of crew
CREW_VERSION = '1.2.8' CREW_VERSION = '1.2.9'
ARCH = `uname -m`.strip ARCH = `uname -m`.strip
ARCH_LIB = if ARCH == 'x86_64' then 'lib64' else 'lib' end ARCH_LIB = if ARCH == 'x86_64' then 'lib64' else 'lib' end
......
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