diff options
| author | Jacob McDonnell <jacob@jacobmcdonnell.com> | 2026-04-30 21:07:09 -0400 |
|---|---|---|
| committer | Jacob McDonnell <jacob@jacobmcdonnell.com> | 2026-04-30 21:07:09 -0400 |
| commit | 56290ea83fe3ca0e05ec1507453505e2391218fe (patch) | |
| tree | f584d06df637037eaf1af7b5ed556c591d7cee55 /build-db | |
| parent | 493557444fb6adfdc6ad97670db76b0b80d5a4f3 (diff) | |
Initial implementation of code to register the manual sections per
operating system in the database.
Diffstat (limited to 'build-db')
| -rwxr-xr-x | build-db | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -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[*]}; |
