Path: blob/main/documentation/tools/global-pgpkeys-creator.rb
18081 views
#!/usr/bin/env ruby12=begin34BSD 2-Clause License5Copyright (c) 2020-2026, The FreeBSD Project6Copyright (c) 2020-2026, Sergio Carlavilla <[email protected]>78This script will merge all the pgpkeys into one single file910=end1112def getAllPGPKeys()13return Dir.glob('./static/pgpkeys/*.key').sort14end1516def processAllPGPKeys(keysFiles, pgpKeysFile)17keysFiles.each{ |keyFile|18processPGPKey(keyFile, pgpKeysFile)19}20end2122def processPGPKey(keyFile, pgpKeysFile)23File.readlines(keyFile).each do |line|24if # remove script comment and AsciiDoc syntax25not line.include? "// sh addkey.sh" and26not line.include? "[.literal-block-margin]" and27not line.include? "...."28pgpKeysFile.puts(line)29end30end31end3233# Main method34keysFiles = getAllPGPKeys()3536pgpKeysFile = File.new("./static/pgpkeys/pgpkeys.txt", "w")3738processAllPGPKeys(keysFiles, pgpKeysFile)394041