def get_available_packages(dir)
      packages = Dir["#{Lyp.packages_dir}/**/*"].inject({}) do |m, p|
        entry_point_path = File.join(p, MAIN_PACKAGE_FILE)
        if File.file?(entry_point_path)
          package_name = p.gsub(/^#{Lyp.packages_dir}\//, '')
          m[package_name] = DependencyPackage.new(entry_point_path)
        end
        m
      end

      forced_paths = @opts[:forced_package_paths] || {}

      if @opts[:forced_package_paths]
        @opts[:forced_package_paths].each do |package, path|
          packages["#{package}@forced"] = DependencyPackage.new(File.join(path, MAIN_PACKAGE_FILE))
        end
      end

      packages
    end
def get_available_packages(dir)
      packages = Dir["#{Lyp.packages_dir}/**/*"].inject({}) do |m, p|
        entry_point_path = File.join(p, MAIN_PACKAGE_FILE)
        if File.file?(entry_point_path)
          package_name = p.gsub(/^#{Lyp.packages_dir}\//, '')
          m[package_name] = DependencyPackage.new(entry_point_path)
        end
        m
      end

      forced_paths = @opts[:forced_package_paths] || {}

      if @opts[:forced_package_paths]
        @opts[:forced_package_paths].each do |package, path|
          packages["#{package}@forced"] = DependencyPackage.new(File.join(path, MAIN_PACKAGE_FILE))
        end
      end

      packages
    end
Return a hash of all packages found in the packages directory, creating a
 leaf for each package