aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2019-04-18 23:20:46 +0300
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2019-04-18 23:20:46 +0300
commit481c69be02c95fbf20567d8de617315484e2d692 (patch)
tree71bf406543586f278a5e779a0befa57f0fe529e9 /Makefile
parent07d4fa1fe85eba554becb20bb4a872acb320a423 (diff)
downloadopenrussian-cli-481c69be02c95fbf20567d8de617315484e2d692.tar.gz
major changes (unfortunately not done systematically)
* keep the openrussian-sql.zip to avoid bitrot (sudden breakage when building the project against a recent DB) * allow lookups against inflections. A special table `bare_inflections` was added to the DB in order to speed this up. * authentic autocompletions taking every parameter into account, using a magic `-C` parameter * language selection via locale or -L<lang> * translation lookup * allow multiple search terms on the command line without escaping * all SQL strings are properly escaped now to avoid (accidental) code insertion * luautf8 is mandatory now and used much more, which is safer than handling Unicode strings with the builtin functions * ignore "disable" database entries * added option -V (verbatim) * more protections against empty fields * print "DERIVED FROM", "AUDIO", "USAGE" and various word relation sections * print word ranking and level (A1-C2...)
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile16
1 files changed, 10 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index 8743043..a6b777f 100644
--- a/Makefile
+++ b/Makefile
@@ -13,16 +13,20 @@ openrussian : openrussian.lua
chmod a+x $@
# Marking the ZIP intermediate makes sure it is automatically deleted after
-# generating the SQLITE database while we don't always re-download it.
+# generating the SQLite database while we don't always re-download it.
# Effectively, it will behave like a temporary file.
-.INTERMEDIATE: openrussian-sql.zip
+# NOTE: This is disabled for the time being since the database schema changes
+# from time to time, so a rebuild could easily break the script.
+# Instead, we add the file to Git, so every clone is guaranteed to contain
+# a database matching the openrussian.lua script.
+#.INTERMEDIATE: openrussian-sql.zip
openrussian-sql.zip:
wget -O $@ 'https://en.openrussian.org/downloads/openrussian-sql.zip'
-# NOTE: VACUUMing the database saves a few megabytes
-openrussian-sqlite3.db : openrussian-sql.zip mysql2sqlite
+openrussian-sqlite3.db : openrussian-sql.zip mysql2sqlite postprocess.sql
+ $(RM) $@
unzip -p $< openrussian.sql | ./mysql2sqlite - | sqlite3 $@
- sqlite3 $@ VACUUM
+ sqlite3 $@ -batch <postprocess.sql
# NOTE: Installation of the Bash completions depends on the Debain bash-completion
# package being installed or something similar
@@ -33,4 +37,4 @@ install : openrussian openrussian-sqlite3.db openrussian-completion.bash
cp openrussian-completion.bash $(DESTDIR)$(COMPLETIONSDIR)/openrussian
clean:
- $(RM) -f openrussian openrussian-sql.zip openrussian-sqlite3.db
+ $(RM) openrussian openrussian-sql.zip openrussian-sqlite3.db