summaryrefslogtreecommitdiff
path: root/index_repo
diff options
context:
space:
mode:
authorKatolaZ <[email protected]>2020-01-12 18:34:13 +0000
committerKatolaZ <[email protected]>2020-01-12 18:34:13 +0000
commitb50158a8f3d1ae29658206a4d591426a51df3e28 (patch)
tree1b43f8745e95e604a502947aadb31121e755a3b2 /index_repo
parent7acd17b36e16815a1a4f0e304e1ed979b2bdded0 (diff)
Add static index files
- index_repo creates them - search_repo now looks for those indices
Diffstat (limited to 'index_repo')
-rwxr-xr-xindex_repo24
1 files changed, 24 insertions, 0 deletions
diff --git a/index_repo b/index_repo
new file mode 100755
index 0000000..f1f28d7
--- /dev/null
+++ b/index_repo
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+#
+# Index a repo
+#
+
+REPOIDX="repo_idx.txt"
+DSCRIDX="descr_idx.txt"
+RDMEIDX="readme_idx.txt"
+
+if [ $# -eq 0 ]; then
+ start="./"
+else
+ start="$@"
+fi
+
+find $start -type d | grep -E "\/.*\/" | sed -E 's/.\/([a-z]+)\//\1:\/\//1' \
+ > ${REPOIDX}
+
+find $start -type f -name 'DESCR' | tr '\n' ' ' \
+ > ${DSCRIDX}
+
+find $start -type f -iname 'readme*' | tr '\n' ' ' \
+ > ${RDMEIDX}