1
0
mirror of https://git.FreeBSD.org/doc.git synced 2026-06-02 19:35:07 +00:00
Files
doc/documentation/tools/global-pgpkeys-creator.rb
T
Sergio Carlavilla Delgado b3c6ff6ee1 Upgrade copyright year
2026-02-19 11:28:04 +01:00

40 lines
891 B
Ruby

#!/usr/bin/env ruby
=begin
BSD 2-Clause License
Copyright (c) 2020-2026, The FreeBSD Project
Copyright (c) 2020-2026, Sergio Carlavilla <carlavilla@FreeBSD.org>
This script will merge all the pgpkeys into one single file
=end
def getAllPGPKeys()
return Dir.glob('./static/pgpkeys/*.key').sort
end
def processAllPGPKeys(keysFiles, pgpKeysFile)
keysFiles.each{ |keyFile|
processPGPKey(keyFile, pgpKeysFile)
}
end
def processPGPKey(keyFile, pgpKeysFile)
File.readlines(keyFile).each do |line|
if # remove script comment and AsciiDoc syntax
not line.include? "// sh addkey.sh" and
not line.include? "[.literal-block-margin]" and
not line.include? "...."
pgpKeysFile.puts(line)
end
end
end
# Main method
keysFiles = getAllPGPKeys()
pgpKeysFile = File.new("./static/pgpkeys/pgpkeys.txt", "w")
processAllPGPKeys(keysFiles, pgpKeysFile)