diff options
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[*]}; |
