Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env ruby
- Dir[ "/var/db/pkg/*/*/" ].each do |filepath|
- puts "checking #{filepath}"
- next unless File.read("#{filepath}/environment.bz2") =~ /^GCC_SPECS=(.*)/
- value = $1 # the match from the regex above
- puts "checking for value in variable"
- next if (val = value.split("=")[1]).empty?
- puts "shortening value for display"
- pkgname = filepath.slice( 12, filepath.length ).sub(/\/$/,":")
- val = val.split("hardened")[1].sub(/.specs$/,"")
- puts "#{pkgname} #{val}"
- end
Add Comment
Please, Sign In to add comment