def find_matching_packages(req)
      return {} unless req =~ Lyp::PACKAGE_RE

      req_package = $1
      req_version = $2

      req = nil
      if @opts[:forced_package_paths] && @opts[:forced_package_paths][req_package]
        req_version = 'forced'
      end

      req = Lyp.version_req(req_version || '>=0') rescue nil
      available_packages.select do |package, leaf|
        if (package =~ Lyp::PACKAGE_RE) && (req_package == $1)
          version = Lyp.version($2 || '0') rescue nil
          if version.nil? || req.nil?
            req_version.nil? || (req_version == $2)
          else
            req =~ version
          end
        else
          nil
        end
      end
    end
def find_matching_packages(req)
      return {} unless req =~ Lyp::PACKAGE_RE

      req_package = $1
      req_version = $2

      req = nil
      if @opts[:forced_package_paths] && @opts[:forced_package_paths][req_package]
        req_version = 'forced'
      end

      req = Lyp.version_req(req_version || '>=0') rescue nil
      available_packages.select do |package, leaf|
        if (package =~ Lyp::PACKAGE_RE) && (req_package == $1)
          version = Lyp.version($2 || '0') rescue nil
          if version.nil? || req.nil?
            req_version.nil? || (req_version == $2)
          else
            req =~ version
          end
        else
          nil
        end
      end
    end
Find packages meeting the version requirement