From 56290ea83fe3ca0e05ec1507453505e2391218fe Mon Sep 17 00:00:00 2001 From: Jacob McDonnell Date: Thu, 30 Apr 2026 21:07:09 -0400 Subject: wip: Reading Sections from Section File Initial implementation of code to register the manual sections per operating system in the database. --- build-db | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'build-db') diff --git a/build-db b/build-db index 5f1aa9bc..0545eafe 100755 --- a/build-db +++ b/build-db @@ -39,16 +39,28 @@ cat < "$SQL_FILE" CREATE TABLE manpages ( os TEXT, name TEXT, - section INTEGER, + section TEXT, path TEXT, PRIMARY KEY (os, name, section) ); EOF +cat <> "$SQL_FILE" +CREATE TABLE sections ( + os TEXT, + section TEXT, + description TEXT, + PRIMARY KEY (os, section) +); +EOF + printf '{ "AllowedFiles" : [\n' > Allowed.json for SUBDIR in ${SUBDIRS[*]}; do + awk -F '\t' -v OS="$SUBDIR" \ + '{print "INSERT INTO sections (os, section, description) VALUES (\"OS\", \"$1\", \"$2\");"}' >> "$SQL_FILE" + FILES=$(find "$SUBDIR" -type f -regex "$SUBDIR/man[0-9]/.*\.[0-9]\.html") for FILE in ${FILES[*]}; -- cgit v1.2.3