From owner-dev-commits-doc-all@freebsd.org Sun May 16 20:44:37 2021 Return-Path: Delivered-To: dev-commits-doc-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C4EFB63046E for ; Sun, 16 May 2021 20:44:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FjvQF5BFrz3nmf; Sun, 16 May 2021 20:44:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9B7AC1F24E; Sun, 16 May 2021 20:44:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 14GKibW2093486; Sun, 16 May 2021 20:44:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 14GKibcE093485; Sun, 16 May 2021 20:44:37 GMT (envelope-from git) Date: Sun, 16 May 2021 20:44:37 GMT Message-Id: <202105162044.14GKibcE093485@gitrepo.freebsd.org> To: doc-committers@FreeBSD.org, dev-commits-doc-all@FreeBSD.org From: Sergio Carlavilla Delgado Subject: git: 5a9f8ba840 - main - Add new tool to generate the pgpkeys.txt file MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: carlavilla X-Git-Repository: doc X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5a9f8ba84024192b35746faa2a665f2e79571ed0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-doc-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the doc repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 May 2021 20:44:37 -0000 The branch main has been updated by carlavilla: URL: https://cgit.FreeBSD.org/doc/commit/?id=5a9f8ba84024192b35746faa2a665f2e79571ed0 commit 5a9f8ba84024192b35746faa2a665f2e79571ed0 Author: Sergio Carlavilla Delgado AuthorDate: 2021-05-16 20:41:00 +0000 Commit: Sergio Carlavilla Delgado 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 + +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)