summaryrefslogtreecommitdiff
path: root/build-db
diff options
context:
space:
mode:
authorJacob McDonnell <jacob@jacobmcdonnell.com>2026-04-30 21:07:09 -0400
committerJacob McDonnell <jacob@jacobmcdonnell.com>2026-04-30 21:07:09 -0400
commit56290ea83fe3ca0e05ec1507453505e2391218fe (patch)
treef584d06df637037eaf1af7b5ed556c591d7cee55 /build-db
parent493557444fb6adfdc6ad97670db76b0b80d5a4f3 (diff)
wip: Reading Sections from Section FileHEADmain
Initial implementation of code to register the manual sections per operating system in the database.
Diffstat (limited to 'build-db')
-rwxr-xr-xbuild-db14
1 files changed, 13 insertions, 1 deletions
diff --git a/build-db b/build-db
index 5f1aa9bc..0545eafe 100755
--- a/build-db
+++ b/build-db
@@ -39,16 +39,28 @@ cat <<EOF > "$SQL_FILE"
CREATE TABLE manpages (
os TEXT,
name TEXT,
- section INTEGER,
+ section TEXT,
path TEXT,
PRIMARY KEY (os, name, section)
);
EOF
+cat <<EOF >> "$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[*]};