gentoo.sh 862 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. # shellcheck shell=sh
  2. # shellcheck disable=3043
  3. upmanifest() (
  4. umask 022
  5. doas pkgdev manifest "${@}"
  6. )
  7. up() (
  8. umask 022
  9. doas sh -uec "$(
  10. printf '%s && ' \
  11. '(eix-sync || :)' \
  12. 'cd /var/db/repos' \
  13. "fd . -t d -X chmod o+rx '{}'" \
  14. "fd . -t f -X chmod o+r '{}'"
  15. ):"
  16. )
  17. pkg() {
  18. : "${PWD:=$(pwd)}"
  19. local __category="${PWD%/*}"
  20. printf '%s/%s\n' "${__category##*/}" "${PWD##*/}"
  21. }
  22. curless() { curl -sL "${@}" | less; }
  23. echlog() {
  24. local url
  25. url="$(epkginfo -U "${@}" | sed -n 's/^ChangeLog:\s\+\(.*\)/\1/p')"
  26. [ "${url}" ] && curless -- "${url}"
  27. }
  28. # shellcheck disable=2016
  29. kmake() (
  30. env="$(
  31. printf '%s; ' \
  32. 'if [ -r /usr/src/.env ]' \
  33. 'then . /usr/src/.env' \
  34. 'fi && exec make "${@}"'
  35. )"
  36. cd /usr/src/linux && exec doas -- sh -xlc "${env}" sh "${@}"
  37. )
  38. kconf() { kmake nconfig "${@}"; }
  39. kinstall() { kmake install "${@}"; }