lib_sxng_data.sh 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. #!/usr/bin/env bash
  2. # SPDX-License-Identifier: AGPL-3.0-or-later
  3. data.help(){
  4. cat <<EOF
  5. data.:
  6. all : update searx/sxng_locales.py and searx/data/*
  7. traits : update searx/data/engine_traits.json & searx/sxng_locales.py
  8. useragents: update searx/data/useragents.json with the most recent versions of Firefox
  9. locales : update searx/data/locales.json from babel
  10. EOF
  11. }
  12. data.all() {
  13. ( set -e
  14. pyenv.activate
  15. data.traits
  16. data.useragents
  17. data.locales
  18. build_msg DATA "update searx/data/osm_keys_tags.json"
  19. pyenv.cmd python searxng_extra/update/update_osm_keys_tags.py
  20. build_msg DATA "update searx/data/ahmia_blacklist.txt"
  21. python searxng_extra/update/update_ahmia_blacklist.py
  22. build_msg DATA "update searx/data/wikidata_units.json"
  23. python searxng_extra/update/update_wikidata_units.py
  24. build_msg DATA "update searx/data/currencies.json"
  25. python searxng_extra/update/update_currencies.py
  26. build_msg DATA "update searx/data/external_bangs.json"
  27. python searxng_extra/update/update_external_bangs.py
  28. build_msg DATA "update searx/data/engine_descriptions.json"
  29. python searxng_extra/update/update_engine_descriptions.py
  30. )
  31. }
  32. data.traits() {
  33. ( set -e
  34. pyenv.activate
  35. build_msg DATA "update searx/data/engine_traits.json"
  36. python searxng_extra/update/update_engine_traits.py
  37. build_msg ENGINES "update searx/sxng_locales.py"
  38. )
  39. dump_return $?
  40. }
  41. data.useragents() {
  42. build_msg DATA "update searx/data/useragents.json"
  43. pyenv.cmd python searxng_extra/update/update_firefox_version.py
  44. dump_return $?
  45. }
  46. data.locales() {
  47. ( set -e
  48. pyenv.activate
  49. build_msg DATA "update searx/data/locales.json"
  50. python searxng_extra/update/update_locales.py
  51. )
  52. dump_return $?
  53. }
  54. docs.prebuild() {
  55. build_msg DOCS "build ${DOCS_BUILD}/includes"
  56. (
  57. set -e
  58. [ "$VERBOSE" = "1" ] && set -x
  59. mkdir -p "${DOCS_BUILD}/includes"
  60. ./utils/searxng.sh searxng.doc.rst > "${DOCS_BUILD}/includes/searxng.rst"
  61. pyenv.cmd searxng_extra/docs_prebuild
  62. )
  63. dump_return $?
  64. }