patch.sh 444 B

12345678910111213141516171819202122
  1. #!/bin/sh --
  2. set -ue
  3. # patch to remove dbus dependencie
  4. #
  5. # deps: sed
  6. # usage: ./patch.sh *.ebuild
  7. for ebuild; do
  8. if [ "$(sed -n '/^IUSE=".*dbus.*"$/p' "${ebuild}")" ]; then
  9. >&2 echo "${ebuild}: already patched"
  10. continue
  11. fi
  12. >&2 echo "patching ${ebuild}"
  13. sed -i "${ebuild}" \
  14. -e 's/^\(IUSE="aqua\s\)\(.*\)$/\1dbus \2/' \
  15. -e '/^REQUIRED_USE/a\ geolocation? ( dbus )' \
  16. -e 's/^\(\s\+\)\(.*at-spi2-core.*\)$/\1dbus? ( \2 )/'
  17. done