Skip to content

Commit

Permalink
Merge pull request #510 from kbrock/system-rpms2
Browse files Browse the repository at this point in the history
Fix performance issue of looking up rpms
  • Loading branch information
Fryguy authored Sep 26, 2024
2 parents f97c35d + e68c6a7 commit 538b5cc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions bin/requirements.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ class ParseRequirements

# These packages are installed via rpm
def os_packages
# Leaving his as pure bash so we can run from the command line to fix issues.
# Leaving this as pure bash so we can run from the command line to fix issues.
@os_packages ||=
`for pkg in $(rpm -qa | grep python3- | sort) ; do rpm -ql $pkg | awk -F/ '/site-packages.*-info$/ { print $6 }' | sed 's/-[0-9].*//' | tr '_A-Z' '-a-z' | sort -u; done`.chomp.split
`rpm -ql $(rpm -qa | grep python3- | sort) | awk -F/ '/site-packages.*-info$/ { print $6 }' | sed 's/-[0-9].*//' | tr '_A-Z' '-a-z' | sort -u`.chomp.split
end

def os_package_regex
Expand Down Expand Up @@ -111,7 +111,7 @@ def parse
next if lib.start_with?("git")

# Defer to version requirements provided by rpm system packages.
ver = "" if lib.match?(/^(#{os_package_regex.to_s})($|\[)/)
ver = "" if lib.match?(/^(#{os_package_regex})($|\[)/)

final[lib] ||= {}
(final[lib][ver] ||= []) << mod
Expand Down

0 comments on commit 538b5cc

Please sign in to comment.