util.sh

* Import some fixes from pacman-g2/script/makepkg (see commit
  6c90c804fce51770567e5e1f364368d9c59b92a5)