summaryrefslogtreecommitdiff
path: root/build-db
diff options
context:
space:
mode:
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[*]};