Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 16 May 2021 20:44:37 GMT
From:      Sergio Carlavilla Delgado <carlavilla@FreeBSD.org>
To:        doc-committers@FreeBSD.org, dev-commits-doc-all@FreeBSD.org
Subject:   git: 5a9f8ba840 - main - Add new tool to generate the pgpkeys.txt file
Message-ID:  <202105162044.14GKibcE093485@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by carlavilla:

URL: https://cgit.FreeBSD.org/doc/commit/?id=5a9f8ba84024192b35746faa2a665f2e79571ed0

commit 5a9f8ba84024192b35746faa2a665f2e79571ed0
Author:     Sergio Carlavilla Delgado <carlavilla@FreeBSD.org>
AuthorDate: 2021-05-16 20:41:00 +0000
Commit:     Sergio Carlavilla Delgado <carlavilla@FreeBSD.org>
CommitDate: 2021-05-16 20:41:00 +0000

    Add new tool to generate the pgpkeys.txt file
---
 documentation/Makefile                        |  8 +++++--
 documentation/tools/global-pgpkeys-creator.rb | 34 +++++++++++++++++++++++++++
 2 files changed, 40 insertions(+), 2 deletions(-)

diff --git a/documentation/Makefile b/documentation/Makefile
index b9fa304050..72616084fa 100644
--- a/documentation/Makefile
+++ b/documentation/Makefile
@@ -18,6 +18,7 @@ MAINTAINER=carlavilla@FreeBSD.org
 LOCALBASE?=	/usr/local
 
 PYTHON_CMD =	${LOCALBASE}/bin/python3
+RUBY_CMD =	${LOCALBASE}/bin/ruby
 HUGO_CMD =	${LOCALBASE}/bin/hugo
 LANGUAGES =	en,es,pt-br,de,ja,zh-cn,zh-tw,ru,el,hu,it,mn,nl,pl,fr
 RUBYLIB =	../shared/lib
@@ -41,8 +42,8 @@ RUN_DEPENDS=	${PYTHON_CMD} \
 .ORDER: starting-message build
 .ORDER: generate-books-toc build
 
-all: requirements starting-message generate-books-toc build
-run: requirements starting-message generate-books-toc run-local
+all: requirements starting-message generate-books-toc generate-pgpkeys-txt build
+run: requirements starting-message generate-books-toc generate-pgpkeys-txt run-local
 
 requirements:
 .for dep in ${RUN_DEPENDS}
@@ -63,6 +64,9 @@ generate-books-toc: .PHONY
 	${PYTHON_CMD} ./tools/books-toc-tables-creator.py -l ${LANGUAGES}
 	${PYTHON_CMD} ./tools/books-toc-examples-creator.py -l ${LANGUAGES}
 
+generate-pgpkeys-txt: .PHONY
+	${RUBY_CMD} ./tools/global-pgpkeys-creator.rb
+
 run-local: .PHONY
 	${HUGO_CMD} server -D $(BIND:D--bind=$(BIND)) --baseURL="http://$(.HOST):1313"
 
diff --git a/documentation/tools/global-pgpkeys-creator.rb b/documentation/tools/global-pgpkeys-creator.rb
new file mode 100644
index 0000000000..37eb94fe32
--- /dev/null
+++ b/documentation/tools/global-pgpkeys-creator.rb
@@ -0,0 +1,34 @@
+#!/usr/bin/env ruby
+
+=begin
+
+BSD 2-Clause License
+Copyright (c) 2020-2021, The FreeBSD Project
+Copyright (c) 2020-2021, 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|
+    pgpKeysFile.puts(line)
+  end
+end
+
+# Main method
+keysFiles = getAllPGPKeys()
+
+pgpKeysFile = File.new("./static/pgpkeys/pgpkeys.txt", "w")
+
+processAllPGPKeys(keysFiles, pgpKeysFile)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202105162044.14GKibcE093485>