check.sh 631 B

12345678910111213141516171819
  1. #!/bin/bash
  2. # helper script to check the local language list against upstream
  3. # extract pkgbase from pkgbuild
  4. pkgbase="$(bash -c "source PKGBUILD && echo \"\$pkgbase\"")"
  5. # extract language list from pkgbuild
  6. bash -c "source PKGBUILD && printf '%s\n' \"\${_languages[@]}\" | cut -d ' ' -f1 | sort" \
  7. > $pkgbase-l10n.local
  8. # load language list from upstream
  9. url="$(bash -c "source PKGBUILD && echo \"\$_url\"")/"
  10. curl -sL $url | \
  11. grep '\.xpi' | cut -d'"' -f2 | rev | cut -d'/' -f1 | cut -d'.' -f3 | rev | sort\
  12. > $pkgbase-l10n.remote
  13. diff -rupN $pkgbase-l10n.local $pkgbase-l10n.remote
  14. rm -f $pkgbase-l10n.{local,remote}